X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Ftest_support.c;h=1e5e6572d62257084239d8434fd17c3f4b93dbf2;hb=15fb8a6128ee4f8b4d7096f13422aebe4afd2fec;hp=3e123434a069d7611e5198b8f33aefdd435e04f6;hpb=77526eb4f4ef7b2be5fda0c8d719d3c46c75c5c7;p=ric-plt%2Flib%2Frmr.git diff --git a/test/test_support.c b/test/test_support.c index 3e12343..1e5e657 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++; @@ -198,7 +216,6 @@ static int fail_not_equal( int a, int b, char* what ) { static int fail_if_equal( int a, int b, char* what ) { ts_tests_driven++; - fprintf( stderr, " %s %d\n", what, a==b ); if( a == b ) { fprintf( stderr, " %s values were equal a=%d b=%d\n", what, a, b ); }