summaryrefslogtreecommitdiff
path: root/test.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-04-13 21:45:21 -0400
committerJeffrey Walton <noloader@gmail.com>2017-04-13 21:45:21 -0400
commitbf92cb00395b71a942e4b785c6848f038a961c3a (patch)
treeb562674aec0107c8cdc1ebc5fc792d663b4140e6 /test.cpp
parentbae30d6767ffd2da1271e50387614340371591df (diff)
downloadcryptopp-git-bf92cb00395b71a942e4b785c6848f038a961c3a.tar.gz
Split regtest.cpp into regtest{1|2|3}.cpp
regtest.cpp is where ciphers register by name. The library has added a number of ciphers over the last couple of years and the source file has experienced bloat. Most of the ARM and MIPS test borads were suffering Out of Memory (OOM) kills as the compiler processed the source fille and the included header files. This won't stop the OOM kills, but it will help the situation. An early BeagleBoard with 512 MB of RAM is still going to have trouble, but it can be worked around by building with 1 make job as opposed to 2 or 4.
Diffstat (limited to 'test.cpp')
-rw-r--r--test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test.cpp b/test.cpp
index 45e3ed4d..02753371 100644
--- a/test.cpp
+++ b/test.cpp
@@ -71,7 +71,7 @@ USING_NAMESPACE(CryptoPP)
const int MAX_PHRASE_LENGTH=250;
-void RegisterFactories();
+void RegisterFactories(Test::TestClass suites);
void PrintSeedAndThreads(const std::string& seed);
void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed);
@@ -187,7 +187,7 @@ int CRYPTOPP_API main(int argc, char *argv[])
try
{
- RegisterFactories();
+ RegisterFactories(Test::All);
// Some editors have problems with the '\0' character when redirecting output.
std::string seed = IntToString(time(NULLPTR));
@@ -405,13 +405,13 @@ int CRYPTOPP_API main(int argc, char *argv[])
else if (command == "v" || command == "vv")
return !Validate(argc>2 ? Test::StringToValue<int, true>(argv[2]) : 0, argv[1][1] == 'v', argc>3 ? argv[3] : NULLPTR);
else if (command == "b") // All benchmarks
- Test::Benchmark(7, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
+ Test::Benchmark(Test::All, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
else if (command == "b3") // Public key algorithms
- Test::Benchmark(4, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
+ Test::Benchmark(Test::PublicKey, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
else if (command == "b2") // Shared key algorithms
- Test::Benchmark(2, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
+ Test::Benchmark(Test::SharedKey, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
else if (command == "b1") // Unkeyed algorithms
- Test::Benchmark(1, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
+ Test::Benchmark(Test::Unkeyed, argc<3 ? 1 : Test::StringToValue<float, true>(argv[2]), argc<4 ? 0.0f : Test::StringToValue<float, true>(argv[3])*1e9);
else if (command == "z")
GzipFile(argv[3], argv[4], argv[2][0]-'0');
else if (command == "u")