mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-25 11:00:15 +00:00
[test] Add self-tests for strdup()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
e5878ce65d
commit
5249368950
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user