summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-18 00:36:24 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-18 00:36:24 -0700
commit1b5b7ee4b7a10b39835369ac12462ef2231b6f2b (patch)
tree553c5f39f0693782e5b6fafbb4e1ab0268cf17a4
parentbfeac2fcc8ec3ae417a2ad54b2b40d6a4b4b2754 (diff)
downloadmc-1b5b7ee4b7a10b39835369ac12462ef2231b6f2b.tar.gz
Make tests run faster.
Reduce iterations a bit so we can run them more often.
-rw-r--r--lib/thread/test/atomic.myr4
-rw-r--r--lib/thread/test/mutex.myr4
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)