* 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:
@@ -36,3 +36,4 @@ SEARCH on [ FGristFiles
|
|||||||
SubInclude HAIKU_TOP src tests system libroot posix bonnie ;
|
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 math ;
|
||||||
SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite ;
|
SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite ;
|
||||||
|
SubInclude HAIKU_TOP src tests system libroot posix string ;
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
SubDir HAIKU_TOP src tests system libroot posix string ;
|
||||||
|
|
||||||
|
SimpleTest compare_test
|
||||||
|
: compare_test.cpp
|
||||||
|
;
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2008, Axel Dörfler, [email protected].
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user