Skip to content

Commit 30d7dfb

Browse files
committed
Add integration tests
1 parent 8c2f9e4 commit 30d7dfb

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

Cesium.Compiler/stdlib/strings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stddef.h>
99

1010
__cli_import("Cesium.Runtime.StringsFunctions::StrCaseCmp")
11-
int strncasecmp(char* __s1, char* __s2);
11+
int strcasecmp(char* __s1, char* __s2);
1212

1313
__cli_import("Cesium.Runtime.StringsFunctions::StrNCaseCmp")
1414
int strncasecmp(char* __s1, char* __s2, size_t __n);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Cesium contributors <https://github.com/ForNeVeR/Cesium>
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
#include <strings.h>
8+
9+
10+
int testCaseInsensetiveComparison() {
11+
int result = strcasecmp("a b c", "A B c");
12+
if (result) {
13+
return -1;
14+
}
15+
16+
result = strcasecmp("a b c", "A B B");
17+
if (result != 1) {
18+
return -2;
19+
}
20+
21+
result = strcasecmp("a b c", "A b D");
22+
if (result != -1) {
23+
return -2;
24+
}
25+
26+
return 0;
27+
}
28+
29+
int main(int argc, char* argv[])
30+
{
31+
if (!testConcatenation()) {
32+
return -1;
33+
}
34+
35+
return 42;
36+
}

0 commit comments

Comments
 (0)