Remain silent when sucessful.

2003-05-28  Matthias Clasen  <maclas@gmx.de>

	* tests/patterntest.c: Remain silent when sucessful.

	* tests/Makefile.am: Add patterntest to make check.  (#113143,
	Zach Frey)
This commit is contained in:
Matthias Clasen 2003-05-27 22:12:40 +00:00 committed by Matthias Clasen
parent c868c58694
commit 25e8ae683e
8 changed files with 99 additions and 13 deletions

View File

@ -1,3 +1,14 @@
2003-05-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c: Remain silent when sucessful.
* tests/Makefile.am: Add patterntest to make check. (113143)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of

View File

@ -1,3 +1,14 @@
2003-05-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c: Remain silent when sucessful.
* tests/Makefile.am: Add patterntest to make check. (113143)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of

View File

@ -1,3 +1,14 @@
2003-05-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c: Remain silent when sucessful.
* tests/Makefile.am: Add patterntest to make check. (113143)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of

View File

@ -1,3 +1,14 @@
2003-05-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c: Remain silent when sucessful.
* tests/Makefile.am: Add patterntest to make check. (113143)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of

View File

@ -1,3 +1,14 @@
2003-05-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c: Remain silent when sucessful.
* tests/Makefile.am: Add patterntest to make check. (113143)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of

View File

@ -1,3 +1,14 @@
2003-05-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c: Remain silent when sucessful.
* tests/Makefile.am: Add patterntest to make check. (113143)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of

View File

@ -49,7 +49,7 @@ endif
if ENABLE_TIMELOOP
timeloop = timeloop timeloop-closure
endif
noinst_PROGRAMS = testglib patterntest testgdate testgdateparser unicode-normalize unicode-collate $(timeloop)
noinst_PROGRAMS = testglib testgdate testgdateparser unicode-normalize unicode-collate $(timeloop)
testglib_LDADD = $(libglib)
patterntest_LDADD = $(libglib)
testgdate_LDADD = $(libglib)
@ -73,6 +73,8 @@ test_programs = \
mainloop-test \
module-test \
node-test \
patterntest \
printf-test \
queue-test \
qsort-test \
rand-test \
@ -118,6 +120,7 @@ markup_test_LDADD = $(progs_ldadd)
module_test_LDADD = $(module_ldadd) $(module_test_exp)
module_test_LDFLAGS = $(G_MODULE_LDFLAGS)
node_test_LDADD = $(progs_ldadd)
printf_test_LDADD = $(progs_ldadd)
queue_test_LDADD = $(progs_ldadd)
qsort_test_LDADD = $(progs_ldadd)
rand_test_LDADD = $(progs_ldadd)

View File

@ -19,6 +19,7 @@
#undef G_DISABLE_ASSERT
#undef G_LOG_DOMAIN
#undef NOISY
#include <string.h>
@ -86,7 +87,9 @@ test_compilation (gchar *src,
{
GPatternSpec *spec;
#ifdef NOISY
g_print ("compiling \"%s\" \t", utf8(src));
#endif
spec = g_pattern_spec_new (src);
if (spec->match_type != match_type)
@ -121,9 +124,11 @@ test_compilation (gchar *src,
return FALSE;
}
#ifdef NOISY
g_print ("passed (%s: \"%s\")\n",
match_type_name (spec->match_type),
spec->pattern);
#endif
return TRUE;
}
@ -133,7 +138,9 @@ test_match (gchar *pattern,
gchar *string,
gboolean match)
{
#ifdef NOISY
g_print ("matching \"%s\" against \"%s\" \t", utf8(string), utf8(pattern));
#endif
if (g_pattern_match_simple (pattern, string) != match)
{
@ -141,7 +148,9 @@ test_match (gchar *pattern,
return FALSE;
}
#ifdef NOISY
g_print ("passed (%s)\n", match ? "match" : "nomatch");
#endif
return TRUE;
}
@ -154,7 +163,9 @@ test_equal (gchar *pattern1,
GPatternSpec *p2 = g_pattern_spec_new (pattern2);
gboolean equal = g_pattern_spec_equal (p1, p2);
#ifdef NOISY
g_print ("comparing \"%s\" with \"%s\" \t", utf8(pattern1), utf8(pattern2));
#endif
if (expected != equal)
{
@ -163,8 +174,10 @@ test_equal (gchar *pattern1,
expected ? "!=" : "==",
match_type_name (p2->match_type), p2->pattern_length, utf8(p2->pattern));
}
#ifdef NOISY
else
g_print ("passed (%s)\n", equal ? "equal" : "unequal");
#endif
g_pattern_spec_free (p1);
g_pattern_spec_free (p2);
@ -258,7 +271,11 @@ main (int argc, char** argv)
TEST_MATCH("ab*\xf6", "ab\xe4\xf6", TRUE);
TEST_MATCH("ab*\xf6", "aba\xf6x\xf6", TRUE);
#ifdef NOISY
g_print ("\n%u tests passed, %u failed\n", passed, failed);
#endif
return 0;
return failed;
}