diff options
author | Ori Bernstein <ori@eigenstate.org> | 2015-09-18 00:36:24 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2015-09-18 00:36:24 -0700 |
commit | 1b5b7ee4b7a10b39835369ac12462ef2231b6f2b (patch) | |
tree | 553c5f39f0693782e5b6fafbb4e1ab0268cf17a4 /lib/thread | |
parent | bfeac2fcc8ec3ae417a2ad54b2b40d6a4b4b2754 (diff) | |
download | mc-1b5b7ee4b7a10b39835369ac12462ef2231b6f2b.tar.gz |
Make tests run faster.
Reduce iterations a bit so we can run them more often.
Diffstat (limited to 'lib/thread')
-rw-r--r-- | lib/thread/test/atomic.myr | 4 | ||||
-rw-r--r-- | lib/thread/test/mutex.myr | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/thread/test/atomic.myr b/lib/thread/test/atomic.myr index a6f72c6..97cf448 100644 --- a/lib/thread/test/atomic.myr +++ b/lib/thread/test/atomic.myr @@ -15,13 +15,13 @@ const main = { while thread.xget(&done) != Nherd /* nothing */ ;; - std.assert(val == 20_000_000, "atomics are broken\n") + std.assert(val == 2_000_000, "atomics are broken\n") } const incvar = { var i - for i = 0; i < 1_000_000; i++ + for i = 0; i < 100_000; i++ thread.xadd(&val, 1) ;; std.write(1, "done\n") diff --git a/lib/thread/test/mutex.myr b/lib/thread/test/mutex.myr index e971490..5a439d7 100644 --- a/lib/thread/test/mutex.myr +++ b/lib/thread/test/mutex.myr @@ -18,13 +18,13 @@ const main = { while thread.xget(&done) != Nherd /* nothing */ ;; - if val != 100_000 * 20 + if val != 10_000 * 20 std.fatal("mutexes are broken, got {}\n", val) ;; } const incvar = { - for var i = 0; i < 100_000; i++ + for var i = 0; i < 10_000; i++ thread.mtxlock(&mtx) val++ thread.mtxunlock(&mtx) |