diff options
author | Jack Lloyd <[email protected]> | 2016-12-24 21:21:39 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-24 21:21:39 -0500 |
commit | 0f3bf4d4d056c41b585b62145d03e1588c24fcec (patch) | |
tree | 24ea7b692eba2f279b3aae9913cf21fe2241f93e /src/tests/test_dl_group.cpp | |
parent | 2ee2d884167e43f84830cd45af63ddbf245b540b (diff) |
Add test option --run-long-tests
Previously longer tests were hidden behind higher 'soak levels'
but these arbitrary cutoffs are confusing compared to a simple
short tests/long tests split.
Diffstat (limited to 'src/tests/test_dl_group.cpp')
-rw-r--r-- | src/tests/test_dl_group.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/tests/test_dl_group.cpp b/src/tests/test_dl_group.cpp index 985d77a1f..27757fdfe 100644 --- a/src/tests/test_dl_group.cpp +++ b/src/tests/test_dl_group.cpp @@ -115,13 +115,11 @@ class DL_Group_Tests : public Test for(std::string name : dl_named) { + // Confirm we can load every group we expect Botan::DL_Group group(name); - // These two groups fail verification because pow(g,q,p) != 1 - if(name != "modp/srp/1024" && name != "modp/srp/2048") - { - result.test_eq(name + " verifies", group.verify_group(rng, false), true); - } + result.test_ne("DL_Group p is set", group.get_p(), 0); + result.test_ne("DL_Group g is set", group.get_g(), 0); if(name.find("/srp/") == std::string::npos) { @@ -134,6 +132,16 @@ class DL_Group_Tests : public Test result.test_failure("Group " + name + " has no q"); } } + + if(group.get_p().bits() < 2048 || Test::run_long_tests()) + { + // These two groups fail verification because pow(g,q,p) != 1 + if(name != "modp/srp/1024" && name != "modp/srp/2048") + { + result.test_eq(name + " verifies", group.verify_group(rng, false), true); + } + } + } result.end_timer(); |