Make TestStringSink a debug test
parent
ae34c2d2ff
commit
9a8b4a8024
22
validat0.cpp
22
validat0.cpp
|
|
@ -1488,5 +1488,27 @@ bool TestASN1Parse()
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_EXTENDED_VALIDATION)
|
||||
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(const std::exception&)
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
NAMESPACE_END // Test
|
||||
NAMESPACE_END // CryptoPP
|
||||
|
|
|
|||
23
validat3.cpp
23
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";
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ NAMESPACE_BEGIN(Test)
|
|||
bool ValidateAll(bool thorough);
|
||||
bool TestSettings();
|
||||
bool TestOS_RNG();
|
||||
bool TestStringSink();
|
||||
// bool TestSecRandom();
|
||||
bool TestRandomPool();
|
||||
#if !defined(NO_OS_DEPENDENCE)
|
||||
|
|
@ -150,6 +149,8 @@ bool TestRounding();
|
|||
bool TestHuffmanCodes();
|
||||
// http://github.com/weidai11/cryptopp/issues/346
|
||||
bool TestASN1Parse();
|
||||
// https://github.com/weidai11/cryptopp/pull/334
|
||||
bool TestStringSink();
|
||||
// Additional tests due to no coverage
|
||||
bool TestCompressors();
|
||||
bool TestEncryptors();
|
||||
|
|
|
|||
Loading…
Reference in New Issue