aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_rng.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-05 06:23:21 +0000
committerlloyd <[email protected]>2014-01-05 06:23:21 +0000
commitc431fb65b883a0a5fa060ea7caace0aca3628ec6 (patch)
tree09898d2307801bffa7e1aeee9251d57ed4837870 /src/tests/test_rng.cpp
parent052345203b67eb5cacacd5659ec9837eeb59af35 (diff)
Split up public key tests and data, use new test framework
Diffstat (limited to 'src/tests/test_rng.cpp')
-rw-r--r--src/tests/test_rng.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tests/test_rng.cpp b/src/tests/test_rng.cpp
index 99b2fbf8f..88e21f62c 100644
--- a/src/tests/test_rng.cpp
+++ b/src/tests/test_rng.cpp
@@ -30,10 +30,10 @@ RandomNumberGenerator* get_x931(const std::string& algo, const std::string& ikm_
return nullptr;
}
-bool x931_test(const std::string& algo,
- const std::string& ikm,
- const std::string& out,
- size_t L)
+size_t x931_test(const std::string& algo,
+ const std::string& ikm,
+ const std::string& out,
+ size_t L)
{
std::unique_ptr<RandomNumberGenerator> x931(get_x931(algo, ikm));
x931->reseed(0);
@@ -43,20 +43,20 @@ bool x931_test(const std::string& algo,
if(got != out)
{
std::cout << "X9.31 " << got << " != " << out << "\n";
- return false;
+ return 1;
}
- return true;
+ return 0;
}
}
size_t test_rngs()
{
- std::ifstream vec(CHECKS_DIR "/x931.vec");
+ std::ifstream vec(TEST_DATA_DIR "/x931.vec");
return run_tests_bb(vec, "RNG", "Out", true,
- [](std::map<std::string, std::string> m) -> bool
+ [](std::map<std::string, std::string> m) -> size_t
{
return x931_test(m["RNG"], m["IKM"], m["Out"], to_u32bit(m["L"]));
});