2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 01:21:45 +00:00

[test] Add self-tests for strdup()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-05-18 20:39:04 +01:00
parent e5878ce65d
commit 5249368950

View File

@ -124,6 +124,16 @@ static void string_test_exec ( void ) {
memswap ( ( test + 1 ), ( test + 4 ), 3 );
ok ( memcmp ( test, expected, sizeof ( test ) ) == 0 );
}
/* Test strdup() */
{
const char *orig = "testing testing";
char *dup = strdup ( orig );
ok ( dup != NULL );
ok ( dup != orig );
ok ( strcmp ( dup, orig ) == 0 );
free ( dup );
}
}
/** String self-test */