svn commit: trunk/uClibc/test/misc

vapier at uclibc.org vapier at uclibc.org
Wed Feb 15 04:03:25 UTC 2006


Author: vapier
Date: 2006-02-14 20:03:24 -0800 (Tue, 14 Feb 2006)
New Revision: 14029

Log:
skip collating and equivalence stuff

Modified:
   trunk/uClibc/test/misc/tst-fnmatch.c


Changeset:
Modified: trunk/uClibc/test/misc/tst-fnmatch.c
===================================================================
--- trunk/uClibc/test/misc/tst-fnmatch.c	2006-02-15 04:02:19 UTC (rev 14028)
+++ trunk/uClibc/test/misc/tst-fnmatch.c	2006-02-15 04:03:24 UTC (rev 14029)
@@ -42,6 +42,14 @@
 			return 0;
 	return 1;
 }
+int str_has_funk(const char *str, const char x)
+{
+	size_t i, max = strlen(str);
+	for (i=0; i+1<max; ++i)
+		if (str[i] == '[' && str[i+1] == x)
+			return 1;
+	return 0;
+}
 
 
 int
@@ -51,6 +59,7 @@
   size_t linebuflen = 0;
   int ntests = 0;
   int nfailed = 0;
+  int nskipped = 0;
   char *escinput = NULL;
   size_t escinputlen = 0;
   char *escpattern = NULL;
@@ -141,9 +150,24 @@
       /* skip non-ascii strings */
       if (!str_isalpha(pattern) || !str_isalpha(input))
 	{
-	  printf("%3d: Skipping test that requires locale support\n", ++nr);
+	  ++nskipped;
+	  printf("%3d: fnmatch (\"%s\", \"%s\"): SKIP multibyte test (requires locale support)\n", ++nr, pattern, input);
 	  continue;
 	}
+      /* skip collating symbols */
+      if (str_has_funk(pattern, '.') || str_has_funk(input, '.'))
+	{
+	  ++nskipped;
+	  printf("%3d: fnmatch (\"%s\", \"%s\"): SKIP collating symbol test (requires locale support)\n", ++nr, pattern, input);
+	  continue;
+	}
+      /* skip equivalence class expressions */
+      if (str_has_funk(pattern, '=') || str_has_funk(input, '='))
+	{
+	  ++nskipped;
+	  printf("%3d: fnmatch (\"%s\", \"%s\"): SKIP equivalence class test (requires locale support)\n", ++nr, pattern, input);
+	  continue;
+	}
 #endif
 
       fnmres = fnmatch (pattern, input, flags_val);
@@ -170,7 +194,7 @@
 	}
     }
 
-  printf ("=====================\n%3d tests, %3d failed\n", ntests, nfailed);
+  printf ("=====================\n%3d tests, %3d failed, %3d skipped\n", ntests, nfailed, nskipped);
 
   free (escpattern);
   free (escinput);




More information about the uClibc-cvs mailing list