summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-18 04:00:46 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-18 04:00:46 -0400
commit0c412ee90025ab191463aaa43a90975d2890dc7c (patch)
treeb450e375b71e3f4cc10b4a455acdd4dae1f01df3 /datatest.cpp
parentdd59d58c195c1f6b82f2ea7589489297200cd362 (diff)
downloadcryptopp-git-0c412ee90025ab191463aaa43a90975d2890dc7c.tar.gz
Update datatest.cpp
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 62d2f775..798a13c8 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -1058,13 +1058,14 @@ void TestDataFile(std::string filename, const NameValuePairs &overrideParameters
if (name == "Test" && (s_thorough || v["SlowTest"] != "1"))
{
- bool failed = true;
+ bool failed = false;
std::string algType = GetRequiredDatum(v, "AlgorithmType");
+ std::string algName = GetRequiredDatum(v, "Name");
- if (lastAlgName != GetRequiredDatum(v, "Name"))
+ if (lastAlgName != algName)
{
- lastAlgName = GetRequiredDatum(v, "Name");
- std::cout << "\nTesting " << algType.c_str() << " algorithm " << lastAlgName.c_str() << ".\n";
+ std::cout << "\nTesting " << algType << " algorithm " << algName << ".\n";
+ lastAlgName = algName;
}
try
@@ -1090,18 +1091,20 @@ void TestDataFile(std::string filename, const NameValuePairs &overrideParameters
TestDataFile(GetRequiredDatum(v, "Test"), g_nullNameValuePairs, totalTests, failedTests);
else
SignalUnknownAlgorithmError(algType);
- failed = false;
}
catch (const TestFailure &)
{
+ failed = true;
std::cout << "\nTest FAILED.\n";
}
- catch (const CryptoPP::Exception &e)
+ catch (const Exception &e)
{
+ failed = true;
std::cout << "\nCryptoPP::Exception caught: " << e.what() << std::endl;
}
catch (const std::exception &e)
{
+ failed = true;
std::cout << "\nstd::exception caught: " << e.what() << std::endl;
}