+2007-03-17 Hans Breuer <hans@breuer.org>
+
+ * glib/makefile.msc.in glib/pcre/makefile.msc
+ glib/update-pcre/update.sh : define PCRE_STATIC to reflect the
+ inclusion of pcre as LIB, not stand-alone DLL. Also set NEWLINE=-1
+ to match any newline by default, use of ../../build/win32/make.msc
+
+ * glib/gregex.h : minimal includes of <glib/*.H> instead of <glib.h>
+
+ * glib/gnulib/makefile.msc : make use of ../../build/win32/make.msc
+
+ * tests/regex-test.c(verbose): don't pass a string containing '%'
+ as first parameter to g_print ()
+ (test_match) : for the unexpected case output pattern and string
+ escaped
+
+ * tests/child-test.c tests/slice-color.c : fix c99ism
+ * tests/slice-test.c : fix c99ism and gccism
+ * tests/mapping-test.c tests/base-64-tests.c : don't
+ #include <unistd.h> unconditionally
+ * tests/option-test.c : use G_GINT64_CONSTANT() instead of direct LL
+
+ * tests/makefile.msc.in : more tests build
+
2007-03-17 Matthias Clasen <mclasen@redhat.com>
* glib/gsequence.[hc]:
* glib/gscanner.c (g_scanner_get_token_ll): Fix a typo
in the last commit. (#415323, Richard Hult)
+>>>>>>> .r5422
2007-03-15 Tor Lillqvist <tml@novell.com>
* glib/gnulib/Makefile.am (INCLUDES): Add -I$(top_srcdir)/glib so
-!IFDEF DEBUG
-CRT=-MDd
-!ELSE
-CRT=-MD
-!ENDIF
+TOP = ..\..\..
+!INCLUDE ..\..\build\win32\make.msc
-CFLAGS = -I ..\.. -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT
+INCLUDES = -I ..\..
+DEFINES = -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT
OBJECTS = \
asnprintf.obj \
printf-parse.obj \
vasnprintf.obj
+all : gnulib.lib
+
gnulib.lib : $(OBJECTS)
lib -out:gnulib.lib $(OBJECTS)
-.c.obj:
- $(CC) $(CRT) $(CFLAGS) -Ox -GD -c $<
#ifndef __G_REGEX_H__
#define __G_REGEX_H__
-#include <glib.h>
+#include <glib/gerror.h>
+#include <glib/gstring.h>
G_BEGIN_DECLS
################################################################
INCLUDES = -FImsvc_recommended_pragmas.h -I . -I ..
-DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG
+DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG -DPCRE_STATIC
DEPCFLAGS = -Zm400 $(INTL_CFLAGS) $(LIBICONV_CFLAGS) $(DIRENT_CFLAGS)
all : \
-!IFDEF DEBUG
-CRT=-MDd
-!ELSE
-CRT=-MD
-!ENDIF
+TOP = ..\..\..
+!INCLUDE ..\..\build\win32\make.msc
-CFLAGS = \
+INCLUDES = \
-I ..\.. \
+ -I ..
+
+DEFINES = \
+ -DPCRE_STATIC \
-DHAVE_CONFIG_H \
-DHAVE_LONG_LONG_FORMAT \
-DSUPPORT_UCP \
-DSUPPORT_UTF8 \
- -DNEWLINE=10 \
+ -DNEWLINE=-1 \
-DMATCH_LIMIT=10000000 \
-DMATCH_LIMIT_RECURSION=10000000 \
-DMAX_NAME_SIZE=32 \
pcre_version.obj \
pcre_xclass.obj \
+all : pcre.lib
+
pcre.lib : $(OBJECTS)
lib -out:pcre.lib $(OBJECTS)
-
-.c.obj:
- $(CC) $(CRT) $(CFLAGS) -Ox -GD -c $<
# Generate makefile.msc
cat > makefile.msc << EOF
-!IFDEF DEBUG
-CRT=-MDd
-!ELSE
-CRT=-MD
-!ENDIF
-
-CFLAGS = \\
- -I ..\\.. \\
+TOP = ..\..\..
+!INCLUDE ..\..\build\win32\make.msc
+
+INCLUDES = \\
+ -I ..\.. \\
+ -I ..
+
+DEFINES = \\
+ -DPCRE_STATIC \\
-DHAVE_CONFIG_H \\
-DHAVE_LONG_LONG_FORMAT \\
-DSUPPORT_UCP \\
-DSUPPORT_UTF8 \\
- -DNEWLINE=10 \\
+ -DNEWLINE=-1 \\
-DMATCH_LIMIT=10000000 \\
-DMATCH_LIMIT_RECURSION=10000000 \\
-DMAX_NAME_SIZE=32 \\
+#include "config.h"
+
#include <glib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <stdlib.h>
#define DATA_SIZE 1024
int
main (int argc, char *argv[])
{
+#ifndef TEST_THREAD
+ GPid pid;
+#endif
#ifdef G_OS_WIN32
argv0 = argv[0];
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'c')
#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
#ifdef TEST_THREAD
g_thread_init (NULL);
-#else
- GPid pid;
#endif
main_loop = g_main_loop_new (NULL, FALSE);
################################################################
INCLUDES = -FImsvc_recommended_pragmas.h -I .. -I ..\glib -I ..\gmodule
-DEFINES = -DHAVE_CONFIG_H
+DEFINES = -DHAVE_CONFIG_H -DENABLE_REGEX
NONAUTOMATIC_TESTS = \
testglib.exe \
testgdate.exe \
testgdateparser.exe \
- patterntest.exe \
unicode-normalize.exe \
unicode-collate.exe
TESTS = \
+ atomic-test.exe \
array-test.exe \
+ asyncqueue-test.exe \
+ base64-test.exe \
+ bit-test.exe \
+ bookmarkfile-test.exe \
+ child-test.exe \
+ completion-test.exe \
+ convert-test.exe \
date-test.exe \
- dirname-test.exe\
+ dirname-test.exe \
+ env-test.exe \
+ errorcheck-mutex-test.exe \
+ file-test.exe \
gio-test.exe \
iochannel-test.exe \
hash-test.exe \
+ keyfile-test.exe \
list-test.exe \
mainloop-test.exe \
+ mapping-test.exe \
+ markup-escape-test.exe \
markup-test.exe \
+#main? memchunks.exe \
module-test.exe \
node-test.exe \
+ option-test.exe \
+ patterntest.exe \
+ printf-test.exe \
queue-test.exe \
+ qsort-test.exe \
rand-test.exe \
- relation-test.exe\
+ regex-test.exe \
+ relation-test.exe \
+#_? sequence-test.exe \
shell-test.exe \
+ slice-color.exe \
+ slice-test.exe \
slist-test.exe \
spawn-test.exe \
# strfunc-test doesn't compile with MSVC
type-test.exe \
unicode-caseconv.exe \
unicode-encoding.exe \
- uri-test.exe
+ utf8-validate.exe \
+ utf8-pointer.exe \
+ uri-test.exe \
DLLS = \
libmoduletestplugin_a.dll \
$(CC) $(CFLAGS) -c $<
$(CC) $(CFLAGS) -Fe$@ $< ..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
+slice-test.exe : memchunks.obj slice-test.obj
+ $(CC) $(CFLAGS) -Fe$@ memchunks.obj slice-test.obj \
+ ..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
+
libmoduletestplugin_a.dll : libmoduletestplugin_a.obj
$(CC) $(CFLAGS) -LD libmoduletestplugin_a.obj ..\gmodule\gmodule-2.0.lib ..\glib\glib-2.0.lib $(LDFLAGS)
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#include "config.h"
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <sys/types.h>
#include <signal.h>
g_assert (retval);
/* Last arg specified is the one that should be stored */
- g_assert (arg_test6_int64 == 4294967296LL);
- g_assert (arg_test6_int64_2 == 0xfffffffffLL);
+ g_assert (arg_test6_int64 == G_GINT64_CONSTANT(4294967296));
+ g_assert (arg_test6_int64_2 == G_GINT64_CONSTANT(0xfffffffff));
g_strfreev (argv);
g_option_context_free (context);
va_end (args);
if (noisy)
- g_print (msg);
+ g_print ("%s", msg);
g_free (msg);
}
gboolean expected)
{
gboolean match;
-
- verbose ("matching \"%s\" against \"%s\" \t", string, pattern);
+ \r
+ verbose ("matching \"%s\" against \"%s\" \t", string, pattern);\r
match = g_regex_match_simple (pattern, string, compile_opts, match_opts);
if (match != expected)
match = g_regex_match_full (regex, string, string_len,
start_position, match_opts2, NULL);
if (match != expected)
- {
- g_print ("failed \t(unexpected %s)\n", match ? "match" : "mismatch");
+ {\r
+ gchar *e1 = g_strescape (pattern, NULL);\r
+ gchar *e2 = g_strescape (string, NULL);
+ g_print ("failed \t(unexpected %s) '%s' against '%s'\n", match ? "match" : "mismatch", e1, e2);\r
+ g_free (e1);\r
+ g_free (e2);\r
g_regex_free (regex);
return FALSE;
}
guint64 repeats)
{
guint64 j, accu, n = n_blocks;
+ GTimer *timer;
+ guint **memc;
+ guint **memb;
guint **mema = g_new (guint*, n);
for (j = 0; j < n; j++)
mema[j] = g_slice_alloc (block_size);
- guint **memb = g_new (guint*, n);
+ memb = g_new (guint*, n);
for (j = 0; j < n; j++)
memb[j] = g_slice_alloc (block_size);
- guint **memc = g_new (guint*, n);
+ memc = g_new (guint*, n);
for (j = 0; j < n; j++)
memc[j] = g_slice_alloc (block_size);
- GTimer *timer = g_timer_new();
+ timer = g_timer_new();
fill_memory (mema, n, 2);
fill_memory (memb, n, 3);
fill_memory (memc, n, 4);
gchar *string = g_strstrip (mem);
guint l = strlen (string);
gdouble f = 0;
+ gchar *derr = NULL;
+ gdouble msize;
+
switch (l ? string[l - 1] : 0)
{
case 'k': f = 1000; break;
}
if (f)
string[l - 1] = 0;
- gchar *derr = NULL;
- gdouble msize = g_ascii_strtod (string, &derr);
+ msize = g_ascii_strtod (string, &derr);
g_free (mem);
if (derr && *derr)
{
test_sliced_mem_thread (gpointer data)
{
guint32 rand_accu = 2147483563;
+ guint i, j;
+ guint8 **ps;
+ guint *ss;
+
/* initialize random numbers */
if (data)
rand_accu = *(guint32*) data;
rand_accu = rand_tv.tv_usec + (rand_tv.tv_sec << 16);
}
- guint i, j;
- guint8 **ps = g_new (guint8*, number_of_blocks);
- guint *ss = g_new (guint, number_of_blocks);
+ ps = g_new (guint8*, number_of_blocks);
+ ss = g_new (guint, number_of_blocks);
/* create number_of_blocks random sizes */
for (i = 0; i < number_of_blocks; i++)
ss[i] = quick_rand32() % prime_size;
if (argc <= 1)
usage();
- gchar strseed[64] = "<random>";
- if (seedp)
- g_snprintf (strseed, 64, "%u", *seedp);
- g_print ("Starting %d threads allocating random blocks <= %u bytes with seed=%s using %s%s\n", n_threads, prime_size, strseed, mode, emode);
+ {
+ gchar strseed[64] = "<random>";
+ GThread **threads;
+ guint i;
+
+ if (seedp)
+ g_snprintf (strseed, 64, "%u", *seedp);
+ g_print ("Starting %d threads allocating random blocks <= %u bytes with seed=%s using %s%s\n", n_threads, prime_size, strseed, mode, emode);
- GThread *threads[n_threads];
- guint i;
- if (!use_memchunks)
- for (i = 0; i < n_threads; i++)
- threads[i] = g_thread_create_full (test_sliced_mem_thread, seedp, 0, TRUE, FALSE, 0, NULL);
- else
- {
- old_mem_chunks_init();
+ threads = g_alloca (sizeof(GThread*) * n_threads);
+ if (!use_memchunks)
for (i = 0; i < n_threads; i++)
- threads[i] = g_thread_create_full (test_memchunk_thread, seedp, 0, TRUE, FALSE, 0, NULL);
- }
- for (i = 0; i < n_threads; i++)
- g_thread_join (threads[i]);
+ threads[i] = g_thread_create_full (test_sliced_mem_thread, seedp, 0, TRUE, FALSE, 0, NULL);
+ else
+ {
+ old_mem_chunks_init();
+ for (i = 0; i < n_threads; i++)
+ threads[i] = g_thread_create_full (test_memchunk_thread, seedp, 0, TRUE, FALSE, 0, NULL);
+ }
+ for (i = 0; i < n_threads; i++)
+ g_thread_join (threads[i]);
- if (ccounters)
- {
- guint n, n_chunks = g_slice_get_config (G_SLICE_CONFIG_CHUNK_SIZES);
- g_print (" ChunkSize | MagazineSize | Contention\n");
- for (i = 0; i < n_chunks; i++)
- {
- gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
- g_print (" %9llu | %9llu | %9llu\n", vals[0], vals[2], vals[1]);
- g_free (vals);
- }
- }
- else
- g_print ("Done.\n");
- return 0;
+ if (ccounters)
+ {
+ guint n, n_chunks = g_slice_get_config (G_SLICE_CONFIG_CHUNK_SIZES);
+ g_print (" ChunkSize | MagazineSize | Contention\n");
+ for (i = 0; i < n_chunks; i++)
+ {
+ gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
+ g_print (" %9llu | %9llu | %9llu\n", vals[0], vals[2], vals[1]);
+ g_free (vals);
+ }
+ }
+ else
+ g_print ("Done.\n");
+ return 0;
+ }
}