From df1ffe1e41f89222c379d982e543c2a32da78cbd Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 4 May 2007 15:24:09 +0000 Subject: 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 --- datatest.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'datatest.cpp') 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 #include USING_NAMESPACE(CryptoPP) USING_NAMESPACE(std) -RandomPool & GlobalRNG(); - typedef std::map 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); + } } } -- cgit v1.2.1