From fca6cd786b70fafa2ffbe024089bd3f8c30efaa9 Mon Sep 17 00:00:00 2001 From: Michael Ploujnikov Date: Wed, 20 Jan 2010 07:54:26 -0500 Subject: [PATCH] fix the prime test algorithm actually test for the output of the function --- tests/30backend-threadpool.tests | 2 +- tests/backend/test-threadpool.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/30backend-threadpool.tests b/tests/30backend-threadpool.tests index 6ba717091..65125489d 100644 --- a/tests/30backend-threadpool.tests +++ b/tests/30backend-threadpool.tests @@ -10,7 +10,7 @@ END TEST "process a function" process-function <= sqrt(number); --x) + for (unsigned long long x = number-1; x >= sqrt(number); --x) { - if (number % x == 0) + if ((number % x) == 0) { prime = 0; break; @@ -180,7 +180,7 @@ TEST ("process-function") { // this is what the scheduler would do once it figures out what function a job needs to run LumieraThread t; - unsigned long long number = 18014398241046527; + unsigned long long number = 10000019; lumiera_threadpool_init(); @@ -193,8 +193,9 @@ TEST ("process-function") &NOBUG_FLAG(NOBUG_ON)); // struct nobug_flag* flag) // cleanup - ECHO("finished waiting"); lumiera_threadpool_destroy(); + ECHO("the result is %llu", number); + } TESTS_END