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 @@
1#include <stdio.h>1#include <stdio.h>
2#include <string.h>2#include <string.h>
3#include <strings.h>
4 3
5int main()4int main()
6{5{
@@ -26,9 +25,9 @@ int main() · 19 unmodified lines
26 printf("%d\n", strncmp(a, "goerg", 2) == 0);25 printf("%d\n", strncmp(a, "goerg", 2) == 0);
27 printf("%d\n", strncmp(a, "zebra", 2) < 0);26 printf("%d\n", strncmp(a, "zebra", 2) < 0);
28 27
29 printf("%s\n", index(a, 'o'));28 printf("%s\n", strchr(a, 'o'));
30 printf("%s\n", rindex(a, 'l'));29 printf("%s\n", strrchr(a, 'l'));
31 printf("%d\n", rindex(a, 'x') == NULL);30 printf("%d\n", strrchr(a, 'x') == NULL);
32 31
33 memset(&a[1], 'r', 4);32 memset(&a[1], 'r', 4);
34 printf("%s\n", a);33 printf("%s\n", a);
tests/tests2/Makefile+0−4
@@ -22,10 +22,6 @@ endif · 21 unmodified lines
22ifeq ($(TARGETOS),Darwin)22ifeq ($(TARGETOS),Darwin)
23 SKIP += 40_stdio.test23 SKIP += 40_stdio.test
24endif24endif
25ifdef CONFIG_WIN32
26 SKIP += 24_math_library.test # don't have round()
27 SKIP += 28_strings.test # don't have r/index() / strings.h
28endif
29ifeq ($(ARCH),x86-64)25ifeq ($(ARCH),x86-64)
30 SKIP += 73_arm64.test26 SKIP += 73_arm64.test
31endif27endif

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