Fix benchmark selection code (GH )

This commit is contained in:
Jeffrey Walton 2017-08-22 05:10:25 -04:00 committed by GitHub
parent 7851a0d510
commit 559fc3bd89
2 changed files with 6 additions and 5 deletions

@ -16,13 +16,14 @@ NAMESPACE_BEGIN(Test)
// More granular control over benchmarks
enum TestClass {
UnkeyedRNG=1,UnkeyedHash=2,UnkeyedOther=4,
SharedKeyMAC=8,SharedKeyStream=16,SharedKeyBlock=32,SharedKeyOther=64,
PublicKeyAgreement=128,PublicKeyEncryption=256,PublicKeySignature=512,PublicKeyOther=1024,
UnkeyedRNG=(1<<0),UnkeyedHash=(1<<1),UnkeyedOther=(1<<2),
SharedKeyMAC=(1<<3),SharedKeyStream=(1<<4),SharedKeyBlock=(1<<5),SharedKeyOther=(1<<6),
PublicKeyAgreement=(1<<7),PublicKeyEncryption=(1<<8),PublicKeySignature=(1<<9),PublicKeyOther=(1<<10),
Unkeyed=UnkeyedRNG|UnkeyedHash|UnkeyedOther,
SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther,
PublicKey=PublicKeyAgreement|PublicKeyEncryption|PublicKeySignature|PublicKeyOther,
All=Unkeyed|SharedKey|PublicKey
All=Unkeyed|SharedKey|PublicKey,
TestFirst=(0), TestLast=(1<<11)
};
extern const double CLOCK_TICKS_PER_SECOND;

@ -375,7 +375,7 @@ void Benchmark(Test::TestClass suites, double t, double hertz)
g_testBegin = std::time(NULLPTR);
if (static_cast<int>(suites) > 256 || static_cast<int>(suites) == 0)
if (static_cast<int>(suites) == 0 || static_cast<int>(suites) > TestLast)
suites = Test::All;
// Unkeyed algorithms