summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 4a32609..950e4f9 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -5,14 +5,14 @@
#include "randpool.h"
#include "files.h"
#include "trunhash.h"
+#include "queue.h"
+#include "validate.h"
#include <iostream>
#include <memory>
USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
-RandomPool & GlobalRNG();
-
typedef std::map<std::string, std::string> TestData;
class TestFailure : public Exception
@@ -67,7 +67,7 @@ void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransfo
s1 = s1.substr(s1.find(' ')+1);
}
- s2.clear();
+ s2 = ""; // MSVC 6 doesn't have clear();
if (s1[0] == '\"')
{
@@ -85,8 +85,13 @@ void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransfo
s1 = s1.substr(STDMIN(s1.find(' '), s1.length()));
}
+ ByteQueue q;
while (repeat--)
- target.Put((const byte *)s2.data(), s2.size());
+ {
+ q.Put((const byte *)s2.data(), s2.size());
+ if (q.MaxRetrievable() > 4*1024 || repeat == 0)
+ q.TransferTo(target);
+ }
}
}