diff --git a/src/tests/system/libroot/posix/Jamfile b/src/tests/system/libroot/posix/Jamfile index 59e440aa11..b9725e4625 100644 --- a/src/tests/system/libroot/posix/Jamfile +++ b/src/tests/system/libroot/posix/Jamfile @@ -36,3 +36,4 @@ SEARCH on [ FGristFiles SubInclude HAIKU_TOP src tests system libroot posix bonnie ; SubInclude HAIKU_TOP src tests system libroot posix math ; SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite ; +SubInclude HAIKU_TOP src tests system libroot posix string ; diff --git a/src/tests/system/libroot/posix/string/Jamfile b/src/tests/system/libroot/posix/string/Jamfile new file mode 100644 index 0000000000..1780e58da7 --- /dev/null +++ b/src/tests/system/libroot/posix/string/Jamfile @@ -0,0 +1,5 @@ +SubDir HAIKU_TOP src tests system libroot posix string ; + +SimpleTest compare_test + : compare_test.cpp +; diff --git a/src/tests/system/libroot/posix/string/compare_test.cpp b/src/tests/system/libroot/posix/string/compare_test.cpp new file mode 100644 index 0000000000..9aee12efa0 --- /dev/null +++ b/src/tests/system/libroot/posix/string/compare_test.cpp @@ -0,0 +1,24 @@ +/* + * Copyright 2008, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT license. + */ + + +#include +#include + + +int +main(int argc, char** argv) +{ + char a[] = { -26, '\0' }; + char b[] = { '.', '\0' }; + + printf("strcmp(): %d\n", strcmp(a, b)); + printf("memcmp(): %d\n", memcmp(a, b, 1)); + printf("strncmp(): %d\n", strncmp(a, b, 1)); + printf("strcasecmp(): %d\n", strcasecmp(a, b)); + printf("strncasecmp(): %d\n", strncasecmp(a, b, 1)); + + return 0; +}