[poincare/tests] Use quiz_assert instead of assert in tests

This commit is contained in:
Léa Saviot
2018-09-21 15:03:37 +02:00
parent 732a8713e4
commit d93ed2a1ce
4 changed files with 9 additions and 9 deletions

View File

@@ -22,14 +22,14 @@ QUIZ_CASE(poincare_helpers_insert_simple_swap) {
}
Poincare::Helpers::Rotate(&buf[0], &buf[1], 1);
assert(buf[0] == 1);
assert(buf[1] == 0);
assert(buf[2] == 2);
quiz_assert(buf[0] == 1);
quiz_assert(buf[1] == 0);
quiz_assert(buf[2] == 2);
Poincare::Helpers::Rotate(&buf[2], &buf[0], 1);
assert(buf[0] == 0);
assert(buf[1] == 1);
assert(buf[2] == 2);
quiz_assert(buf[0] == 0);
quiz_assert(buf[1] == 1);
quiz_assert(buf[2] == 2);
}
static inline void test_rotate(uint32_t buf[], size_t bufSize, size_t dstIndex, size_t srcIndex, size_t len) {

View File

@@ -51,7 +51,7 @@ QUIZ_CASE(poincare_parser_memory_exhaustion) {
}
}
assert(memoryFailureHasBeenHandled);
quiz_assert(memoryFailureHasBeenHandled);
assert_pool_size(initialPoolSize);
Expression e = Expression::parse("1+1");
/* Stupid check to make sure the global variable generated by Bison is not

View File

@@ -24,7 +24,7 @@ static void assert_pool_size(int i) {
if (poolSize != i) {
std::cout << "Expected pool of size " << i << " but got " << poolSize << std::endl;
log_pool();
assert(false);
quiz_assert(false);
}
#else
quiz_assert(pool_size() == i);

View File

@@ -72,7 +72,7 @@ QUIZ_CASE(tree_handle_memory_failure) {
} else {
memoryFailureHasBeenHandled = true;
}
assert(memoryFailureHasBeenHandled);
quiz_assert(memoryFailureHasBeenHandled);
assert_pool_size(initialPoolSize);
}