[ci skip] Add test of short int to see if there's any obvious places for overflow (none are obvious, but no guarantees they still aren't there). Print basic information about the test to console so that failures are easier to track down.

This commit is contained in:
Nick Thompson
2018-02-10 13:56:11 -06:00
parent 8c415f77b1
commit b3966428c4
4 changed files with 11 additions and 4 deletions

View File

@ -17,6 +17,7 @@ using boost::integer::gcd;
template<class Z>
void test_extended_euclidean()
{
std::cout << "Testing the extended Euclidean algorithm on type " << boost::typeindex::type_id<Z>().pretty_name() << "\n";
Z max_arg = 1000;
for (Z m = 1; m < max_arg; ++m)
{
@ -34,6 +35,7 @@ void test_extended_euclidean()
BOOST_AUTO_TEST_CASE(extended_euclidean_test)
{
test_extended_euclidean<short int>();
test_extended_euclidean<int>();
test_extended_euclidean<long>();
test_extended_euclidean<long long>();