* A simple test that shows that our string compare functions inherited
by NewOS are all broken. This is the actual reason for bug #724. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24457 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
974e087ef1
commit
b0543bd23b
@ -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 ;
|
||||
|
5
src/tests/system/libroot/posix/string/Jamfile
Normal file
5
src/tests/system/libroot/posix/string/Jamfile
Normal file
@ -0,0 +1,5 @@
|
||||
SubDir HAIKU_TOP src tests system libroot posix string ;
|
||||
|
||||
SimpleTest compare_test
|
||||
: compare_test.cpp
|
||||
;
|
24
src/tests/system/libroot/posix/string/compare_test.cpp
Normal file
24
src/tests/system/libroot/posix/string/compare_test.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2008, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user