Avoid defining custom assert() macro in one of the C tests
This was inconsistent with all the other tests and the macro suffered from several problems. Just drop it and use the standard macro with the same name instead.
This commit is contained in:
parent
3b7f772dde
commit
92c3b37337
1 changed files with 7 additions and 8 deletions
|
|
@ -1,23 +1,22 @@
|
|||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "operator_overload/operator_overload_wrap.h"
|
||||
|
||||
#define assert(x,msg) if (!x) { printf("%d: %s\n", x, msg); exit(1); }
|
||||
|
||||
int main() {
|
||||
operator_overload_Op_sanity_check();
|
||||
|
||||
operator_overload_Op *op1 = operator_overload_Op_new_i(1), *op2 = operator_overload_Op_new_i(2), *op3 = operator_overload_Op_copy(op1);
|
||||
|
||||
assert(operator_overload_Op_NotEqual(op1, op2), "neq failed");
|
||||
assert(operator_overload_Op_NotEqual(op1, op2));
|
||||
operator_overload_Op_PlusPlusPrefix(op3);
|
||||
assert(operator_overload_Op_EqualEqual(op2, op3), "eqeq failed");
|
||||
assert(operator_overload_Op_GreaterThanEqual(op2, op1), "geq failed");
|
||||
assert(operator_overload_Op_EqualEqual(op2, op3));
|
||||
assert(operator_overload_Op_GreaterThanEqual(op2, op1));
|
||||
operator_overload_Op_PlusEqual(op3, op1);
|
||||
assert(operator_overload_Op_LessThan(op1, op2) && operator_overload_Op_LessThan(op2, op3), "lt failed");
|
||||
assert(3 == *operator_overload_Op_IndexInto(op3, operator_overload_Op_IndexIntoConst(op2, operator_overload_Op_Functor(op1))), "[] or () failed");
|
||||
assert(5 == operator_overload_Op_Functor_i(op3, 2), "f(x) failed");
|
||||
assert(operator_overload_Op_LessThan(op1, op2) && operator_overload_Op_LessThan(op2, op3));
|
||||
assert(3 == *operator_overload_Op_IndexInto(op3, operator_overload_Op_IndexIntoConst(op2, operator_overload_Op_Functor(op1))));
|
||||
assert(5 == operator_overload_Op_Functor_i(op3, 2));
|
||||
|
||||
operator_overload_Op_delete(op1);
|
||||
operator_overload_Op_delete(op2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue