Added some regression tests from patch #2321830
[fw/sdcc] / support / regression / tests / strncmp.c
1 /** tests for strncmp
2 */
3 #include <testfwk.h>
4 #include <string.h>
5
6 static void 
7 teststrncmp(void)
8 {
9   ASSERT( strncmp("", "", 0) == 0);
10   ASSERT( strncmp("ab", "ab", 0) == 0);
11   ASSERT( strncmp("a", "a", 2) == 0);
12   ASSERT( strncmp("aa", "ab", 1) == 0);
13   ASSERT( strncmp("aa", "ab", 2) < 0);
14   ASSERT( strncmp("abc", "abd", 2) == 0);
15   ASSERT( strncmp("abc", "abc", 3) == 0);
16 }