GRegex(win32) : 500 tests passed, 3 failed



with only small modifications I was able to compile GRegex with msvc,
thanks for providing an almost working makefile.msc ;-)

The first attempt to run

	regex-test.exe --noisy

did crash due to gnulib not liking

g_strdup_vprintf ("matching \"%s\" against \"%s\" \t", "%", "\p{Common}")

The attached patch works around this and also removes the
#include <glib.h> from gregex.h. I think it is better to only include
required sub-headers like almost all glib/*.h do.

But now for the question: are these 3 failed specific to my build so I
should investigate them further?

Thanks,
	Hans

matching "a

b

c" against "^b$" (start: 0, len: -1) 	failed 	(unexpected mismatch)
matching "a
b
c" against "^b$" (start: 0, len: -1) 	failed 	(unexpected mismatch)

matching "a" against "a#
b" (start: 0, len: -1) 	failed 	(unexpected match)


-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert
Index: glib/gregex.h
===================================================================
--- glib/gregex.h	(revision 5410)
+++ glib/gregex.h	(working copy)
@@ -22,7 +22,8 @@
 #ifndef __G_REGEX_H__
 #define __G_REGEX_H__
 
-#include <glib.h>
+#include <glib/gerror.h>
+#include <glib/gstring.h>
 
 G_BEGIN_DECLS
 
Index: tests/regex-test.c
===================================================================
--- tests/regex-test.c	(revision 5409)
+++ tests/regex-test.c	(working copy)
@@ -230,7 +230,10 @@
 		   gboolean            expected)
 {
   gboolean match;
-  
+  
+  if (string[0] == '%' && string[1] == '\0')
+      string = "%%";
+
   verbose ("matching \"%s\" against \"%s\" \t", string, pattern);
 
   match = g_regex_match_simple (pattern, string, compile_opts, match_opts);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]