diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-04 15:24:09 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-04 15:24:09 +0000 |
commit | df1ffe1e41f89222c379d982e543c2a32da78cbd (patch) | |
tree | 3ddcd92ac078642dfed5375980dc2db4006d1498 /datatest.cpp | |
parent | 1bb93ea95e3131c2b9a4f8f8bd3f3197e4d52a76 (diff) | |
download | cryptopp-df1ffe1e41f89222c379d982e543c2a32da78cbd.tar.gz |
fix compile for x64, DLL and VC 6
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@332 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'datatest.cpp')
-rw-r--r-- | datatest.cpp | 13 |
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); + } } } |