mirror of https://github.com/ipxe/ipxe.git
[test] Add self-tests for strdup()
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/10/merge
parent
e5878ce65d
commit
5249368950
|
@ -124,6 +124,16 @@ static void string_test_exec ( void ) {
|
||||||
memswap ( ( test + 1 ), ( test + 4 ), 3 );
|
memswap ( ( test + 1 ), ( test + 4 ), 3 );
|
||||||
ok ( memcmp ( test, expected, sizeof ( test ) ) == 0 );
|
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 */
|
/** String self-test */
|
||||||
|
|
Loading…
Reference in New Issue