diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-09-08 21:52:14 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-09-08 21:52:14 -0400 |
commit | 9a8b4a80240dc25f0547a76b9bd1054d7e307402 (patch) | |
tree | b1848b6cca2b6ef92f820cdcce7280838f22b650 /validat3.cpp | |
parent | ae34c2d2ffcf2dc9791a27427647d8911af52eb6 (diff) | |
download | cryptopp-git-9a8b4a80240dc25f0547a76b9bd1054d7e307402.tar.gz |
Make TestStringSink a debug test
Diffstat (limited to 'validat3.cpp')
-rw-r--r-- | validat3.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/validat3.cpp b/validat3.cpp index fc658501..ad9660aa 100644 --- a/validat3.cpp +++ b/validat3.cpp @@ -41,7 +41,6 @@ bool ValidateAll(bool thorough) {
bool pass=TestSettings();
pass=TestOS_RNG() && pass;
- pass=TestStringSink() && pass;
pass=TestRandomPool() && pass;
#if !defined(NO_OS_DEPENDENCE) && defined(OS_RNG_AVAILABLE)
pass=TestAutoSeededX917() && pass;
@@ -70,6 +69,8 @@ bool ValidateAll(bool thorough) pass=TestHuffmanCodes() && pass;
// http://github.com/weidai11/cryptopp/issues/346
pass=TestASN1Parse() && pass;
+ // https://github.com/weidai11/cryptopp/pull/334
+ pass=TestStringSink() && pass;
// Always part of the self tests; call in Debug
# if defined(CRYPTOPP_ALTIVEC_AVAILABLE)
pass=TestAltivecOps() && pass;
@@ -562,26 +563,6 @@ bool TestOS_RNG() return pass;
}
-bool TestStringSink()
-{
- try
- {
- std::string in = "The quick brown fox jumps over the lazy dog";
-
- std::string str;
- StringSource s1(in, true, new StringSink(str));
-
- std::vector<byte> vec;
- StringSource s2(in, true, new VectorSink(vec));
-
- return str.size() == vec.size() && std::equal(str.begin(), str.end(), vec.begin());
- }
- catch(...)
- {
- }
- return false;
-}
-
bool TestRandomPool()
{
std::cout << "\nTesting RandomPool generator...\n\n";
|