tests,cpu-tests,string: test the return value of strcmp() according to the manual
This commit is contained in:
parent
1d1ff1431d
commit
242c1f1f53
1 changed files with 4 additions and 4 deletions
|
@ -14,10 +14,10 @@ char str[20];
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
check(strcmp(s[0], s[2]) == 0);
|
check(strcmp(s[0], s[2]) == 0);
|
||||||
check(strcmp(s[0], s[1]) == -1);
|
check(strcmp(s[0], s[1]) < 0);
|
||||||
check(strcmp(s[0] + 1, s[1] + 1) == -1);
|
check(strcmp(s[0] + 1, s[1] + 1) < 0);
|
||||||
check(strcmp(s[0] + 2, s[1] + 2) == -1);
|
check(strcmp(s[0] + 2, s[1] + 2) < 0);
|
||||||
check(strcmp(s[0] + 3, s[1] + 3) == -1);
|
check(strcmp(s[0] + 3, s[1] + 3) < 0);
|
||||||
|
|
||||||
check(strcmp( strcat(strcpy(str, str1), s[3]), s[4]) == 0);
|
check(strcmp( strcat(strcpy(str, str1), s[3]), s[4]) == 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue