X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Ftest_support.c;h=fce0449437a5713b1be28e0553eda63607f37f7b;hb=f4a2227da63b7dd64310d24b285cffb44d159746;hp=3e123434a069d7611e5198b8f33aefdd435e04f6;hpb=77526eb4f4ef7b2be5fda0c8d719d3c46c75c5c7;p=ric-plt%2Flib%2Frmr.git diff --git a/test/test_support.c b/test/test_support.c index 3e12343..fce0449 100644 --- a/test/test_support.c +++ b/test/test_support.c @@ -186,6 +186,24 @@ static int fail_if( int bv, char* what ) { return bv ? BAD : GOOD; } +static int fail_pequal( void* a, void* b, char* what ) { + ts_tests_driven++; + + if( a == b ) { + fprintf( stderr, " %s: pointers were not equal a=%p b=%p\n", what, a, b ); + } + return a == b ? GOOD : BAD; // user may override good/bad so do NOT return a==b directly! +} + +static int fail_not_pequal( void* a, void* b, char* what ) { + ts_tests_driven++; + + if( a != b ) { + fprintf( stderr, " %s: pointers were not equal a=%p b=%p\n", what, a, b ); + } + return a == b ? GOOD : BAD; // user may override good/bad so do NOT return a==b directly! +} + static int fail_not_equal( int a, int b, char* what ) { ts_tests_driven++;