Updated documentation. Added calls to unused functions for coverage analytcs. Squashed unused variable warning

pull/98/head
Jeffrey Walton 2015-12-31 04:42:21 -05:00
parent 6652e94d20
commit 4f57c8f303
2 changed files with 38 additions and 26 deletions

View File

@ -89,7 +89,7 @@ public:
}
#endif
//! Update RNG state with additional unpredictable values
//! \brief Update RNG state with additional unpredictable values
//! \param input unused
//! \param length unused
//! \details The operation is a nop for this generator.
@ -171,7 +171,7 @@ public:
}
#endif
//! Update RNG state with additional unpredictable values
//! \brief Update RNG state with additional unpredictable values
//! \param input unused
//! \param length unused
//! \details The operation is a nop for this generator.

View File

@ -329,7 +329,7 @@ bool TestSecBlock()
temp &= (a[0] == 'a' && a[1] == 'b');
temp &= (b[0] == 'c' && b[1] == 'd');
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -365,7 +365,7 @@ bool TestSecBlock()
temp &= (a[0] == 1 && a[1] == 2);
temp &= (b[0] == 3 && b[1] == 4);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -409,7 +409,7 @@ bool TestSecBlock()
temp &= (a.SizeInBytes() == 4);
temp &= (a[0] == 'a' && a[1] == 'b' && a[2] == 'a' && a[3] == 'b');
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -456,7 +456,7 @@ bool TestSecBlock()
temp &= (a[0] == 1 && a[1] == 2 && a[2] == 1 && a[3] == 2);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -492,7 +492,7 @@ bool TestSecBlock()
temp &= (c.SizeInBytes() == 4);
temp &= (c[0] == 'a' && c[1] == 'b' && c[2] == 'c' && c[3] == 'd');
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -530,7 +530,7 @@ bool TestSecBlock()
temp &= (c.SizeInBytes() == 16);
temp &= (c[0] == 1 && c[1] == 2 && c[2] == 3 && c[3] == 4);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -569,7 +569,7 @@ bool TestSecBlock()
b.Assign(str3, COUNTOF(str3));
temp &= (a != b);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -606,7 +606,7 @@ bool TestSecBlock()
b.Assign(str3, COUNTOF(str3));
temp &= (a != b);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = false;
}
@ -628,11 +628,11 @@ bool TestSecBlock()
SecBlock<word32> t(max+1);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = true;
}
catch(const std::exception& ex)
catch(const std::exception& /*ex*/)
{
temp = true;
}
@ -652,11 +652,11 @@ bool TestSecBlock()
SecBlock<word64> t(max+1);
}
catch(const Exception& ex)
catch(const Exception& /*ex*/)
{
temp = true;
}
catch(const std::exception& ex)
catch(const std::exception& /*ex*/)
{
temp = true;
}
@ -844,13 +844,13 @@ bool TestRDRAND()
MeterFilter meter(new Redirector(TheBitBucket()));
Deflator deflator(new Redirector(meter));
MaurerRandomnessTest maurer;
ChannelSwitch chsw;
chsw.AddDefaultRoute(deflator);
chsw.AddDefaultRoute(maurer);
RandomNumberSource rns(rdrand, SIZE, true, new Redirector(chsw));
deflator.Flush(true);
deflator.Flush(false);
assert(0 == maurer.BytesNeeded());
const double mv = maurer.GetTestValue();
@ -874,7 +874,7 @@ bool TestRDRAND()
else
cout << "passed:";
cout << " " << SIZE << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE\n";
try
{
rdrand.DiscardBytes(SIZE);
@ -883,7 +883,7 @@ bool TestRDRAND()
{
discard = false;
}
if (!discard)
cout << "FAILED:";
else
@ -892,10 +892,16 @@ bool TestRDRAND()
}
else
cout << "\nRDRAND generator not available, skipping test.\n";
// Squash code coverage warnings on unused functions
(void)rdrand.AlgorithmName();
(void)rdrand.CanIncorporateEntropy();
rdrand.SetRetries(rdrand.GetRetries());
rdrand.IncorporateEntropy(NULL, 0);
if (!(entropy && compress && discard))
cout.flush();
return entropy && compress && discard;
}
#endif
@ -915,13 +921,13 @@ bool TestRDSEED()
MeterFilter meter(new Redirector(TheBitBucket()));
Deflator deflator(new Redirector(meter));
MaurerRandomnessTest maurer;
ChannelSwitch chsw;
chsw.AddDefaultRoute(deflator);
chsw.AddDefaultRoute(maurer);
RandomNumberSource rns(rdseed, SIZE, true, new Redirector(chsw));
deflator.Flush(true);
deflator.Flush(false);
assert(0 == maurer.BytesNeeded());
const double mv = maurer.GetTestValue();
@ -945,7 +951,7 @@ bool TestRDSEED()
else
cout << "passed:";
cout << " " << SIZE << " generated bytes compressed to " << meter.GetTotalBytes() << " bytes by DEFLATE\n";
try
{
rdseed.DiscardBytes(SIZE);
@ -954,7 +960,7 @@ bool TestRDSEED()
{
discard = false;
}
if (!discard)
cout << "FAILED:";
else
@ -963,10 +969,16 @@ bool TestRDSEED()
}
else
cout << "\nRDSEED generator not available, skipping test.\n";
// Squash code coverage warnings on unused functions
(void)rdseed.AlgorithmName();
(void)rdseed.CanIncorporateEntropy();
rdseed.SetRetries(rdseed.GetRetries());
rdseed.IncorporateEntropy(NULL, 0);
if (!(entropy && compress && discard))
cout.flush();
return entropy && compress && discard;
}
#endif