summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tests/string_test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/string_test.c b/src/tests/string_test.c
index 88181cc21..934c537cf 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 */