svn commit: branches/uClibc-nptl/test: misc string

carmelo at uclibc.org carmelo at uclibc.org
Thu Nov 27 14:41:51 UTC 2008


Author: carmelo
Date: 2008-11-27 06:41:51 -0800 (Thu, 27 Nov 2008)
New Revision: 24163

Log:
Synch with trunk @ 24160
Step 15: test folder synch.


Added:
   branches/uClibc-nptl/test/misc/tst-scandir.c

Modified:
   branches/uClibc-nptl/test/README
   branches/uClibc-nptl/test/Rules.mak
   branches/uClibc-nptl/test/Test.mak
   branches/uClibc-nptl/test/misc/bug-readdir1.c
   branches/uClibc-nptl/test/string/tester.c


Changeset:
Modified: branches/uClibc-nptl/test/README
===================================================================
--- branches/uClibc-nptl/test/README	2008-11-27 14:38:34 UTC (rev 24162)
+++ branches/uClibc-nptl/test/README	2008-11-27 14:41:51 UTC (rev 24163)
@@ -57,6 +57,7 @@
 
 Or to control all tests in a subdir:
 EXTRA_CLEAN   := extra files to remove in the clean target
+EXTRA_DIRS    := extra directories to remove in the clean target
 EXTRA_CFLAGS  := -DFOO
 EXTRA_LDFLAGS := -lpthread
 OPTS          := 

Modified: branches/uClibc-nptl/test/Rules.mak
===================================================================
--- branches/uClibc-nptl/test/Rules.mak	2008-11-27 14:38:34 UTC (rev 24162)
+++ branches/uClibc-nptl/test/Rules.mak	2008-11-27 14:41:51 UTC (rev 24163)
@@ -58,6 +58,7 @@
 CROSS      = $(subst ",, $(strip $(CROSS_COMPILER_PREFIX)))
 CC         = $(CROSS)gcc
 RM         = rm -f
+RM_R       = $(RM) -r
 
 # Select the compiler needed to build binaries for your development system
 HOSTCC     = gcc

Modified: branches/uClibc-nptl/test/Test.mak
===================================================================
--- branches/uClibc-nptl/test/Test.mak	2008-11-27 14:38:34 UTC (rev 24162)
+++ branches/uClibc-nptl/test/Test.mak	2008-11-27 14:41:51 UTC (rev 24163)
@@ -59,7 +59,7 @@
 	$(showtest)
 	$(Q)\
 	$(WRAPPER) $(WRAPPER_$(patsubst %_glibc,%,$(binary_name))) \
-	./$(binary_name) $(OPTS) $(OPTS_$(patsubst %_glibc,%,$(binary_name))) >/dev/null 2>&1 > "$(binary_name).out" ; \
+	./$(binary_name) $(OPTS) $(OPTS_$(patsubst %_glibc,%,$(binary_name))) > "$(binary_name).out" 2>&1 ; \
 		ret=$$? ; \
 		expected_ret="$(RET_$(patsubst %_glibc,%,$(binary_name)))" ; \
 		test -z "$$expected_ret" && export expected_ret=0 ; \
@@ -111,5 +111,6 @@
 clean:
 	$(showclean)
 	$(Q)$(RM) *.a *.o *.so *~ core *.out *.gdb $(CLEAN_TARGETS) $(EXTRA_CLEAN)
+	$(Q)$(RM_R) $(EXTRA_DIRS)
 
 .PHONY: all check clean test run compile

Modified: branches/uClibc-nptl/test/misc/bug-readdir1.c
===================================================================
--- branches/uClibc-nptl/test/misc/bug-readdir1.c	2008-11-27 14:38:34 UTC (rev 24162)
+++ branches/uClibc-nptl/test/misc/bug-readdir1.c	2008-11-27 14:41:51 UTC (rev 24163)
@@ -1,6 +1,5 @@
 #include <dirent.h>
 #include <errno.h>
-#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>

Added: branches/uClibc-nptl/test/misc/tst-scandir.c
===================================================================
--- branches/uClibc-nptl/test/misc/tst-scandir.c	                        (rev 0)
+++ branches/uClibc-nptl/test/misc/tst-scandir.c	2008-11-27 14:41:51 UTC (rev 24163)
@@ -0,0 +1,23 @@
+#include <dirent.h>
+#include <errno.h>
+#include <stdio.h> /* perror() */
+#include <stdlib.h>
+
+int skip_all(const struct dirent *dirbuf)
+{
+	errno = EBADF;
+	return 0;
+}
+
+int main(void)
+{
+	struct dirent **namelist;
+	int n;
+
+	n = scandir(".", &namelist, skip_all, 0);
+	if (n < 0) {
+		perror("scandir");
+		return EXIT_FAILURE;
+	}
+	return EXIT_SUCCESS;
+}

Modified: branches/uClibc-nptl/test/string/tester.c
===================================================================
--- branches/uClibc-nptl/test/string/tester.c	2008-11-27 14:38:34 UTC (rev 24162)
+++ branches/uClibc-nptl/test/string/tester.c	2008-11-27 14:41:51 UTC (rev 24163)
@@ -427,6 +427,7 @@
   check (strncmp ("abc", "def", 0) == 0, 13);	/* Zero count. */
   check (strncmp ("abc", "", (size_t)-1) > 0, 14);	/* set sign bit in count */
   check (strncmp ("abc", "abc", (size_t)-2) == 0, 15);
+  check (strncmp ("aa", "ab", (size_t)-1) < 0, 16);
 }
 
 static void




More information about the uClibc-cvs mailing list