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=2393d3a89e4ed67e90551219bd7b8e6757c7c779;hb=0ce8df17fae3ec986bd9570e5552aed92c080088;hpb=8c88a35a1fb0dfc9e542bb1a1c13c5f3e36eb3e5 diff --git a/src/tests/arbint_vs_gmpint.cpp b/src/tests/arbint_vs_gmpint.cpp index 2393d3a..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(); @@ -26,12 +27,27 @@ int main(int argc, char ** argv) { arb_a *= b; gmp_a *= b; - - Debug("Arbint - %s", arb_a.Str().c_str()); - Debug("Gmpint - %s", gmp_a.Str().c_str()); } + for (unsigned j = 0; j < 5; ++j) + { + arb_a += b; + 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; + gmp_a -= b; + } } return 0; }