X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Ftests%2Frealops.cpp;h=b9ce4414c0213842d67b9a849bdde3107a3731e4;hp=400ce8660d03f5a4e04ea580906f0b1e5b437dea;hb=85e08223a33439f9b4911129b48ee45ff65869eb;hpb=ba945308b9273fcd420b3d4f1395b44bd6625929 diff --git a/src/tests/realops.cpp b/src/tests/realops.cpp index 400ce86..b9ce441 100644 --- a/src/tests/realops.cpp +++ b/src/tests/realops.cpp @@ -4,13 +4,13 @@ using namespace std; using namespace IPDF; -#define TEST_CASES 100 +#define TEST_CASES 1000 static double g_totalerror = 0; bool NotEqual(double a, double b, double threshold=1e-1) { - double error = (fabs(a-b) > threshold); + double error = fabs(a-b); g_totalerror += error; return (error > threshold); } @@ -22,8 +22,9 @@ int main(int argc, char ** argv) unsigned failures = 0; for (unsigned i = 0; i < TEST_CASES; ++i) { - double da = (double)(rand()%100 + 1) / (double)(rand()%100 + 1); - double db = (double)(rand()%100 + 1) / (double)(rand()%100 + 1); + //Debug("Test %u of %u", i, TEST_CASES); + double da = (double)(rand() + 1) / (double)(rand() + 1); + double db = (double)(rand() + 1) / (double)(rand() + 1); if (rand() % 2 == 0) da = -da;