aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_strcasecmp.in
blob: 2fb69d1a3bbda82359a963d7e798faa4df94b7e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <stdio.h>
#include <strings.h>
int sign(int x) {
  if (x < 0) return -1;
  if (x > 0) return 1;
  return 0;
}
int main() {
  printf("*\n");

  printf("%d\n", sign(strcasecmp("hello", "hello")));
  printf("%d\n", sign(strcasecmp("hello1", "hello")));
  printf("%d\n", sign(strcasecmp("hello", "hello1")));
  printf("%d\n", sign(strcasecmp("hello1", "hello1")));
  printf("%d\n", sign(strcasecmp("iello", "hello")));
  printf("%d\n", sign(strcasecmp("hello", "iello")));
  printf("%d\n", sign(strcasecmp("A", "hello")));
  printf("%d\n", sign(strcasecmp("Z", "hello")));
  printf("%d\n", sign(strcasecmp("a", "hello")));
  printf("%d\n", sign(strcasecmp("z", "hello")));
  printf("%d\n", sign(strcasecmp("hello", "a")));
  printf("%d\n", sign(strcasecmp("hello", "z")));

  printf("%d\n", sign(strcasecmp("Hello", "hello")));
  printf("%d\n", sign(strcasecmp("Hello1", "hello")));
  printf("%d\n", sign(strcasecmp("Hello", "hello1")));
  printf("%d\n", sign(strcasecmp("Hello1", "hello1")));
  printf("%d\n", sign(strcasecmp("Iello", "hello")));
  printf("%d\n", sign(strcasecmp("Hello", "iello")));
  printf("%d\n", sign(strcasecmp("A", "hello")));
  printf("%d\n", sign(strcasecmp("Z", "hello")));
  printf("%d\n", sign(strcasecmp("a", "hello")));
  printf("%d\n", sign(strcasecmp("z", "hello")));
  printf("%d\n", sign(strcasecmp("Hello", "a")));
  printf("%d\n", sign(strcasecmp("Hello", "z")));

  printf("%d\n", sign(strcasecmp("hello", "Hello")));
  printf("%d\n", sign(strcasecmp("hello1", "Hello")));
  printf("%d\n", sign(strcasecmp("hello", "Hello1")));
  printf("%d\n", sign(strcasecmp("hello1", "Hello1")));
  printf("%d\n", sign(strcasecmp("iello", "Hello")));
  printf("%d\n", sign(strcasecmp("hello", "Iello")));
  printf("%d\n", sign(strcasecmp("A", "Hello")));
  printf("%d\n", sign(strcasecmp("Z", "Hello")));
  printf("%d\n", sign(strcasecmp("a", "Hello")));
  printf("%d\n", sign(strcasecmp("z", "Hello")));
  printf("%d\n", sign(strcasecmp("hello", "a")));
  printf("%d\n", sign(strcasecmp("hello", "z")));

  printf("%d\n", sign(strcasecmp("Hello", "Hello")));
  printf("%d\n", sign(strcasecmp("Hello1", "Hello")));
  printf("%d\n", sign(strcasecmp("Hello", "Hello1")));
  printf("%d\n", sign(strcasecmp("Hello1", "Hello1")));
  printf("%d\n", sign(strcasecmp("Iello", "Hello")));
  printf("%d\n", sign(strcasecmp("Hello", "Iello")));
  printf("%d\n", sign(strcasecmp("A", "Hello")));
  printf("%d\n", sign(strcasecmp("Z", "Hello")));
  printf("%d\n", sign(strcasecmp("a", "Hello")));
  printf("%d\n", sign(strcasecmp("z", "Hello")));
  printf("%d\n", sign(strcasecmp("Hello", "a")));
  printf("%d\n", sign(strcasecmp("Hello", "z")));

  printf("%d\n", sign(strncasecmp("hello", "hello", 3)));
  printf("%d\n", sign(strncasecmp("hello1", "hello", 3)));
  printf("%d\n", sign(strncasecmp("hello", "hello1", 3)));
  printf("%d\n", sign(strncasecmp("hello1", "hello1", 3)));
  printf("%d\n", sign(strncasecmp("iello", "hello", 3)));
  printf("%d\n", sign(strncasecmp("hello", "iello", 3)));
  printf("%d\n", sign(strncasecmp("A", "hello", 3)));
  printf("%d\n", sign(strncasecmp("Z", "hello", 3)));
  printf("%d\n", sign(strncasecmp("a", "hello", 3)));
  printf("%d\n", sign(strncasecmp("z", "hello", 3)));
  printf("%d\n", sign(strncasecmp("hello", "a", 3)));
  printf("%d\n", sign(strncasecmp("hello", "z", 3)));

  printf("*\n");

  return 0;
}