X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Ftests%2Farbint_vs_gmpint.cpp;h=a30758c190170dd106abdc10dc0d15b98e7a190c;hp=306bbb7c51e90247d34736a1f2efc9aa81f6b5c3;hb=ac518ad085eb5bc84647e4aebe0c5ff06640cd0d;hpb=e8e6ff92ef0978cbec24dd69a85dbf1bd81681ad diff --git a/src/tests/arbint_vs_gmpint.cpp b/src/tests/arbint_vs_gmpint.cpp index 306bbb7..a30758c 100644 --- a/src/tests/arbint_vs_gmpint.cpp +++ b/src/tests/arbint_vs_gmpint.cpp @@ -7,13 +7,14 @@ #include "gmpint.h" #include "arbint.h" -#define TEST_CASES 100 + using namespace IPDF; int main(int argc, char ** argv) { - for (unsigned i = 0; i < TEST_CASES; ++i) + unsigned test_cases = (argc > 1) ? atoi(argv[1]) : 100; + for (unsigned i = 0; i < test_cases; ++i) { uint64_t a = rand(); @@ -28,6 +29,13 @@ int main(int argc, char ** argv) gmp_a *= b; } + + for (unsigned j = 0; j < 5; ++j) + { + arb_a += b; + gmp_a += b; + } + for (unsigned j = 0; j < 5; ++j) { arb_a /= b; @@ -35,6 +43,11 @@ int main(int argc, char ** argv) } + for (unsigned j = 0; j < 5; ++j) + { + arb_a -= b; + gmp_a -= b; + } } return 0; }