History

Use ISO C string functions instead of obsolete BSD ones that used to be in strings.h. It allows more systems -- i.e. Windows -- to use those tests

Christian Jullien committed 10 years ago

Commit 8986bc81 parent 07ca2df2 files · +3 −8Browse files

Unified · Split

2 files
  1. tests/tests2/28_strings.c +3 −4
  2. tests/tests2/Makefile +0 −4
tests/tests2/28_strings.c+3−4
@@ -1,6 +1,5 @@
11 #include <stdio.h>
22 #include <string.h>
3−#include <strings.h>
43
54 int main()
65 {
@@ -26,9 +25,9 @@ int main() · 19 unmodified lines
2625 printf("%d\n", strncmp(a, "goerg", 2) == 0);
2726 printf("%d\n", strncmp(a, "zebra", 2) < 0);
2827
29− printf("%s\n", index(a, 'o'));
30− printf("%s\n", rindex(a, 'l'));
31− printf("%d\n", rindex(a, 'x') == NULL);
28+ printf("%s\n", strchr(a, 'o'));
29+ printf("%s\n", strrchr(a, 'l'));
30+ printf("%d\n", strrchr(a, 'x') == NULL);
3231
3332 memset(&a[1], 'r', 4);
3433 printf("%s\n", a);
tests/tests2/Makefile+0−4
@@ -22,10 +22,6 @@ endif · 21 unmodified lines
2222 ifeq ($(TARGETOS),Darwin)
2323 SKIP += 40_stdio.test
2424 endif
25−ifdef CONFIG_WIN32
26− SKIP += 24_math_library.test # don't have round()
27− SKIP += 28_strings.test # don't have r/index() / strings.h
28−endif
2925 ifeq ($(ARCH),x86-64)
3026 SKIP += 73_arm64.test
3127 endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t