diff options
author | rpj <rpj> | 2011-03-03 23:37:20 +0000 |
---|---|---|
committer | rpj <rpj> | 2011-03-03 23:37:20 +0000 |
commit | e470da85f7b9426eea03d66086c2822bf29e9b05 (patch) | |
tree | b3747768258dc62752612327904be1f1067d5c7f /tests/benchtest5.c | |
parent | 1170175259781ece4a8d99d517230f4b9ecb7b50 (diff) |
Some cleanups, mostly x86_64 compat plus interlocked macros
Diffstat (limited to 'tests/benchtest5.c')
-rw-r--r-- | tests/benchtest5.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/benchtest5.c b/tests/benchtest5.c index 7700fde..0d5c360 100644 --- a/tests/benchtest5.c +++ b/tests/benchtest5.c @@ -60,18 +60,18 @@ long overHeadMilliSecs = 0; int one = 1; int zero = 0; -#define GetDurationMilliSecs(_TStart, _TStop) ((_TStop.time*1000+_TStop.millitm) \ - - (_TStart.time*1000+_TStart.millitm)) +#define GetDurationMilliSecs(_TStart, _TStop) ((long)((_TStop.time*1000+_TStop.millitm) \ + - (_TStart.time*1000+_TStart.millitm))) /* * Dummy use of j, otherwise the loop may be removed by the optimiser * when doing the overhead timing with an empty loop. */ #define TESTSTART \ - { int i, j = 0, k = 0; _ftime(&currSysTimeStart); for (i = 0; i < ITERATIONS; i++) { j++; + { int i, j = 0, k = 0; PTW32_FTIME(&currSysTimeStart); for (i = 0; i < ITERATIONS; i++) { j++; #define TESTSTOP \ - }; _ftime(&currSysTimeStop); if (j + k == i) j++; } + }; PTW32_FTIME(&currSysTimeStop); if (j + k == i) j++; } void @@ -115,7 +115,7 @@ main (int argc, char *argv[]) */ assert((w32sema = CreateSemaphore(NULL, (long) 0, (long) ITERATIONS, NULL)) != 0); TESTSTART - assert(ReleaseSemaphore(w32sema, 1, NULL) != zero); + assert((ReleaseSemaphore(w32sema, 1, NULL),1) == one); TESTSTOP assert(CloseHandle(w32sema) != 0); @@ -124,7 +124,7 @@ main (int argc, char *argv[]) assert((w32sema = CreateSemaphore(NULL, (long) ITERATIONS, (long) ITERATIONS, NULL)) != 0); TESTSTART - assert(WaitForSingleObject(w32sema, INFINITE) == WAIT_OBJECT_0); + assert((WaitForSingleObject(w32sema, INFINITE),1) == one); TESTSTOP assert(CloseHandle(w32sema) != 0); @@ -133,7 +133,7 @@ main (int argc, char *argv[]) assert(sem_init(&sema, 0, 0) == 0); TESTSTART - assert(sem_post(&sema) == zero); + assert((sem_post(&sema),1) == one); TESTSTOP assert(sem_destroy(&sema) == 0); @@ -142,7 +142,7 @@ main (int argc, char *argv[]) assert(sem_init(&sema, 0, ITERATIONS) == 0); TESTSTART - assert(sem_wait(&sema) == zero); + assert((sem_wait(&sema),1) == one); TESTSTOP assert(sem_destroy(&sema) == 0); |