diff --git a/src/tests/string_test.c b/src/tests/string_test.c index 88181cc2..934c537c 100644 --- a/src/tests/string_test.c +++ b/src/tests/string_test.c @@ -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 */