// 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 ) { char dstbuf[16]; strcpy(dstbuf, "hi"); TESTCASE_NOREG( strlcat(dstbuf, "", 16) == 3 ); TESTCASE_NOREG( strlcat(dstbuf, "hi", 16) == 5 ); TESTCASE_NOREG( strlcat(dstbuf, "hello, world", 16) == 17 ); TESTCASE_NOREG( strlcat(dstbuf, "hi", 16) == 18 ); TESTCASE_NOREG( strcmp(dstbuf, "hihihello, worl") == 0); return TEST_RESULTS; }