#include <boost/timer.hpp>
#include "test.hpp"
+#ifdef _MSC_VER
+#pragma warning(disable:4127) // Conditional expression is constant
+#endif
#if !defined(TEST1) && !defined(TEST2) && !defined(TEST3)
#define TEST1
BOOST_CHECK_EQUAL(msb(a), msb(a1));
}
- void test_bug_cases()
+ static void test_bug_cases()
{
if(!std::numeric_limits<test_type>::is_bounded)
{
BOOST_CHECK(r < b);
BOOST_CHECK_EQUAL(a - c * b, r);
#endif
+ for(ui = 0; ui < 1000; ++ui)
+ {
+ boost::multiprecision::mpz_int t;
+ boost::multiprecision::mpz_int s1 = sqrt(boost::multiprecision::mpz_int(ui), t);
+ a = sqrt(test_type(ui), b);
+ BOOST_CHECK_EQUAL(a.str(), s1.str());
+ BOOST_CHECK_EQUAL(b.str(), t.str());
+ }
}
void test()
// Tests run on the compiler farm time out after 300 seconds,
// so don't get too close to that:
//
+#ifndef CI_SUPPRESS_KNOWN_ISSUES
if(tim.elapsed() > 200)
+#else
+ if (tim.elapsed() > 25)
+#endif
{
std::cout << "Timeout reached, aborting tests now....\n";
break;
int main()
{
using namespace boost::multiprecision;
+
#ifdef TEST1
tester<cpp_int> t1;
t1.test();
// Unchecked test verifies modulo arithmetic:
tester<number<cpp_int_backend<2048, 2048, signed_magnitude, unchecked, void> > > t3;
t3.test();
+#endif
+#ifdef TEST4
+ tester<number<cpp_int_backend<0, 2048, signed_magnitude, unchecked, std::allocator<void> > > > t4;
+ t4.test();
+#endif
+#ifdef TEST5
+ tester<number<cpp_int_backend<0, 2048, signed_magnitude, unchecked > > > t5;
+ t5.test();
#endif
return boost::report_errors();
}