From 8986bc8af473080bed0efa01cb569f3e25f179a9 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Wed, 12 Oct 2016 06:18:38 +0200 Subject: [PATCH] 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 --- tests/tests2/28_strings.c | 7 +++---- tests/tests2/Makefile | 4 ---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/tests2/28_strings.c b/tests/tests2/28_strings.c index 115fe09..2db2298 100644 --- a/tests/tests2/28_strings.c +++ b/tests/tests2/28_strings.c @@ -1,6 +1,5 @@ #include #include -#include int main() { @@ -26,9 +25,9 @@ int main() printf("%d\n", strncmp(a, "goerg", 2) == 0); printf("%d\n", strncmp(a, "zebra", 2) < 0); - printf("%s\n", index(a, 'o')); - printf("%s\n", rindex(a, 'l')); - printf("%d\n", rindex(a, 'x') == NULL); + printf("%s\n", strchr(a, 'o')); + printf("%s\n", strrchr(a, 'l')); + printf("%d\n", strrchr(a, 'x') == NULL); memset(&a[1], 'r', 4); printf("%s\n", a); diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile index 67d65a4..d8556ad 100644 --- a/tests/tests2/Makefile +++ b/tests/tests2/Makefile @@ -22,10 +22,6 @@ endif ifeq ($(TARGETOS),Darwin) SKIP += 40_stdio.test endif -ifdef CONFIG_WIN32 - SKIP += 24_math_library.test # don't have round() - SKIP += 28_strings.test # don't have r/index() / strings.h -endif ifeq ($(ARCH),x86-64) SKIP += 73_arm64.test endif