// S : tags libc c // S : expect --result valid // S : cc -o test.bc -D_PDCLIB_BUILD -DTEST $file // S : verify -o nofail:malloc test.bc #include #include "_PDCLIB_test.h" int main( void ) { #ifndef REGTEST char destbuf[10]; #endif TESTCASE_NOREG( strlcpy(NULL, "a", 0) == 2 ); TESTCASE_NOREG( strlcpy(destbuf, "a", 10) == 2 ); TESTCASE_NOREG( strcmp(destbuf, "a") == 0 ); TESTCASE_NOREG( strlcpy(destbuf, "helloworld", 10) == 11 ); TESTCASE_NOREG( strcmp(destbuf, "helloworl") == 0 ); return TEST_RESULTS; }