summaryrefslogtreecommitdiff
path: root/tests/port
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-02-24 14:04:18 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-02-24 14:04:18 +0100
commitc8808247d13af4a326e69e9c81f8dbf9a62af610 (patch)
tree7fe13322fc0dc64894c448ebc393c0a9a73c726a /tests/port
parentcac9269b115502071175436828c698d7cb4ddc5c (diff)
downloadwolfbones-c8808247d13af4a326e69e9c81f8dbf9a62af610.tar.gz
wolfbones-c8808247d13af4a326e69e9c81f8dbf9a62af610.tar.bz2
better testing: added TEST_ variables in makefiles, added TEST_<feature> macros in test_*.c for easier testing of stub functions
Diffstat (limited to 'tests/port')
-rw-r--r--tests/port/GNUmakefile4
-rw-r--r--tests/port/test_strcasecmp.c8
-rw-r--r--tests/port/test_strdup.c8
-rw-r--r--tests/port/test_strerror_r.c9
-rw-r--r--tests/port/test_strncasecmp.c8
5 files changed, 7 insertions, 30 deletions
diff --git a/tests/port/GNUmakefile b/tests/port/GNUmakefile
index 0e83dd8..8f2e455 100644
--- a/tests/port/GNUmakefile
+++ b/tests/port/GNUmakefile
@@ -6,7 +6,7 @@ INCLUDE_LIBS = \
INCLUDE_DIRS = \
-I$(TOPDIR)/include/wolf -I. -I$(TOPDIR)/src
-BINS = \
+TEST_BINS = \
test_strdup$(EXE) \
test_strerror_r$(EXE) \
test_strcasecmp$(EXE) \
@@ -20,7 +20,7 @@ local_clean:
local_distclean:
-local_test: all
+local_test:
@echo "Testing strdup.."
@./test_strdup >/dev/null
@echo "Testing strerror_r..."
diff --git a/tests/port/test_strcasecmp.c b/tests/port/test_strcasecmp.c
index fb17eed..48b2ed1 100644
--- a/tests/port/test_strcasecmp.c
+++ b/tests/port/test_strcasecmp.c
@@ -1,13 +1,7 @@
#include "port/sys.h"
-#ifdef HAVE_STRCASECMP
-#define SAVE_HAVE_STRCASECMP
-#undef HAVE_STRCASECMP
-#endif
+#define TEST_STRCASECMP
#include "port/string.c" /* for strcasecmp */
-#ifdef SAVE_HAVE_STRCASECMP
-#undef strcasecmp
-#endif
#include <stdlib.h> /* for EXIT_SUCCESS, EXIT_FAILURE */
diff --git a/tests/port/test_strdup.c b/tests/port/test_strdup.c
index 8d08e1b..d8e5959 100644
--- a/tests/port/test_strdup.c
+++ b/tests/port/test_strdup.c
@@ -1,13 +1,7 @@
#include "port/sys.h"
-#ifdef HAVE_STRDUP
-#define SAVE_HAVE_STRDUP
-#undef HAVE_STRDUP
-#endif
+#define TEST_STRDUP
#include "port/string.c" /* for strdup */
-#ifdef SAVE_HAVE_STRDUP
-#undef strdup
-#endif
#include <stdlib.h> /* for exit, EXIT_SUCCESS, free */
diff --git a/tests/port/test_strerror_r.c b/tests/port/test_strerror_r.c
index 0ff53d6..4d5eb7b 100644
--- a/tests/port/test_strerror_r.c
+++ b/tests/port/test_strerror_r.c
@@ -1,16 +1,11 @@
#include "port/sys.h"
-#ifdef HAVE_STRERROR_R
-#define SAVE_HAVE_STRERROR_R
-#undef HAVE_STRERROR_R
-#endif
+#define TEST_STRERROR_R
#include "port/string.c" /* for strerror_r */
-#ifdef SAVE_HAVE_STRERROR_R
-#undef strerror_r
-#endif
#include <stdlib.h> /* for exit, EXIT_SUCCESS, free */
#include <stdio.h> /* for printf */
+#include <errno.h> /* for errno */
int main( void ) {
int i;
diff --git a/tests/port/test_strncasecmp.c b/tests/port/test_strncasecmp.c
index 0483c41..3700613 100644
--- a/tests/port/test_strncasecmp.c
+++ b/tests/port/test_strncasecmp.c
@@ -1,13 +1,7 @@
#include "port/sys.h"
-#ifdef HAVE_STRNCASECMP
-#define SAVE_HAVE_STRNCASECMP
-#undef HAVE_STRNCASECMP
-#endif
+#define TEST_STRNCASECMP
#include "port/string.c" /* for strcasecmp */
-#ifdef SAVE_HAVE_STRNCASECMP
-#undef strncasecmp
-#endif
#include <stdlib.h> /* for EXIT_SUCCESS, EXIT_FAILURE */