* 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:
Axel Dörfler 2008-03-19 08:43:50 +00:00
parent 974e087ef1
commit b0543bd23b
3 changed files with 30 additions and 0 deletions

View File

@ -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 ;

View File

@ -0,0 +1,5 @@
SubDir HAIKU_TOP src tests system libroot posix string ;
SimpleTest compare_test
: compare_test.cpp
;

View 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;
}