swig/Examples/test-suite/c/operator_overload_runme.c
Vadim Zeitlin 92c3b37337 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.
2022-01-04 01:26:40 +01:00

25 lines
963 B
C

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "operator_overload/operator_overload_wrap.h"
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));
operator_overload_Op_PlusPlusPrefix(op3);
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));
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);
operator_overload_Op_delete(op3);
exit(0);
}