Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix test asserts to account for randomness

  • Loading branch information...
commit a40b2add3c6b201fd0b02f50ce485084e5b72dc2 1 parent 9e5045e
@tj tj authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 hash.c
View
16 hash.c
@@ -133,10 +133,10 @@ test_hash_each() {
n++;
});
- assert(0 == strcmp("age", keys[0]));
- assert(0 == strcmp("name", keys[1]));
- assert(0 == strcmp("25", vals[0]));
- assert(0 == strcmp("tj", vals[1]));
+ assert(0 == strcmp("age", keys[0]) || 0 == strcmp("name", keys[0]));
+ assert(0 == strcmp("age", keys[1]) || 0 == strcmp("name", keys[1]));
+ assert(0 == strcmp("25", vals[0]) || 0 == strcmp("tj", vals[0]));
+ assert(0 == strcmp("25", vals[1]) || 0 == strcmp("tj", vals[1]));
}
void
@@ -152,8 +152,8 @@ test_hash_each_key() {
keys[n++] = key;
});
- assert(0 == strcmp("age", keys[0]));
- assert(0 == strcmp("name", keys[1]));
+ assert(0 == strcmp("age", keys[0]) || 0 == strcmp("name", keys[0]));
+ assert(0 == strcmp("age", keys[1]) || 0 == strcmp("name", keys[1]));
}
void
@@ -169,8 +169,8 @@ test_hash_each_val() {
vals[n++] = val;
});
- assert(0 == strcmp("25", vals[0]));
- assert(0 == strcmp("tj", vals[1]));
+ assert(0 == strcmp("25", vals[0]) || 0 == strcmp("tj", vals[0]));
+ assert(0 == strcmp("25", vals[1]) || 0 == strcmp("tj", vals[1]));
}
int
Please sign in to comment.
Something went wrong with that request. Please try again.