Commit Graph

631 Commits

Author SHA1 Message Date
17:40:58 Tim Janik
d6682a1f2d fixed gstdio.h include.
2008-04-18 17:40:58  Tim Janik  <timj@imendio.com>

        * tests/testglib.c: fixed gstdio.h include.

        * tests/Makefile.am: properly list testglib.c SOURCES.



svn path=/trunk/; revision=6862
2008-04-18 15:40:38 +00:00
Matthias Clasen
fe751b255f Small test fixup
svn path=/trunk/; revision=6652
2008-03-10 15:13:29 +00:00
Matthias Clasen
11d7305d5a Don't test user directories for being non-null. (#517084, Yevgen Muntyan)
2008-02-23  Matthias Clasen  <mclasen@redhat.com>

        * tests/testglib.c: Don't test user directories for being
        non-null.  (#517084, Yevgen Muntyan)

svn path=/trunk/; revision=6562
2008-02-23 05:14:34 +00:00
Marco Barisione
7e0677b076 Don't return duplicate matches when matching empty strings. (#515944) Add
2008-02-17  Marco Barisione  <marco@barisione.org>

	* glib/gregex.c: (match_info_new), (g_match_info_next): Don't return
	duplicate matches when matching empty strings.  (#515944)
	* tests/regex-test.c: Add tests.

svn path=/trunk/; revision=6527
2008-02-17 14:07:32 +00:00
Matthias Clasen
f5542c90e3 Make the g_test_add macro work with gcc 4.3
2008-02-10  Matthias Clasen <mclasen@redhat.com>

        * glib/gtestutils.h: Make the g_test_add macro work with
        gcc 4.3

        * tests/gobject/paramspec-test.c: Adapt to recent changes in
        GParamGType initialization.


svn path=/trunk/; revision=6500
2008-02-11 18:28:42 +00:00
Matthias Clasen
da0e7e81c1 /bin/ksh can't handle a for-loop with no arguments, so add a "." for when
2008-02-09  Matthias Clasen <mclasen@redhat.com>

        * Makefile.decl: /bin/ksh can't handle a for-loop with no
        arguments, so add a "." for when $(SUBDIRS) is empty.

        * glib/tests/option-context.c:
        * glib/tests/testing.c:
        * gthread/gthread-posix.c:
        * tets/testingbase64.c:
        * glib/gtester.c:
        * glib/gsequence.c: Portability fixes.  (#515154)



svn path=/trunk/; revision=6487
2008-02-10 04:41:25 +00:00
Sebastian Wilhelmi
fa7351324a Grab thread_counter_pools LOCK when increasing leftover_task_counter.
2008-01-29  Sebastian Wilhelmi  <wilhelmi@google.com>

	* tests/threadpool-test.c (test_thread_pools): Grab
	thread_counter_pools LOCK when increasing
	leftover_task_counter. Fixes race in test. (#512624, Simon Murray)

svn path=/trunk/; revision=6406
2008-01-29 10:07:07 +00:00
Dan Winship
cc1404cfc8 fix this; the previous code gave the wrong md5sum when called in certain
* glib/gchecksum.c (md5_sum_update): fix this; the previous code
	gave the wrong md5sum when called in certain ways with buffers
	larger than 64 bytes.
	(g_checksum_update): remove the unnecessary "length > 1"
	restriction

	* tests/checksum-test.c: Rewrite this to be much more exhaustive
	(and in particular to test the md5_sum_update bugfix).

svn path=/trunk/; revision=6314
2008-01-15 06:21:58 +00:00
Tim Janik
9318ab51dd Fixed copyright and credit for Asbjoern Pettersen.
svn path=/trunk/; revision=6297
2008-01-11 16:59:44 +00:00
12:55:19 Tim Janik
b07304fd89 added g_base64_encode()/g_base64_decode() test case by Asbjoern
2008-01-11 12:55:19  Tim Janik  <timj@imendio.com>

        * tests/testingbase64.c: added g_base64_encode()/g_base64_decode()
        test case by Asbjoern <asbgpe@online.no>. fixed up coding style.



svn path=/trunk/; revision=6292
2008-01-11 11:57:15 +00:00
Alexander Larsson
9c95329347 Add gio/gio.h include to check for c++ problems.
2008-01-08  Alexander Larsson  <alexl@redhat.com>

	* tests/cxx-test.C:
	Add gio/gio.h include to check for c++ problems.


svn path=/trunk/; revision=6280
2008-01-08 20:37:43 +00:00
Hans Breuer
1cda3c9e01 adapt to recent api changes variable declaration at the beginning of a
2007-12-09  Hans Breuer  <hans@breuer.org>

	* tests/gio-ls.c : adapt to recent api changes
	* tests/testglib.c : variable declaration at the beginning of a block
	
	(Lieven van der Heide, #503602)
	* win32-fixup.pl : process *.rc.in as well; substitute 
	LT_CURRENT_MINUS_AGE
	* glib/makefile.msc.in : alphabetic sorting of OBJECTS


svn path=/trunk/; revision=6184
2007-12-21 10:11:35 +00:00
Christian Persch
1ea515d019 Add g_checksum_type_get_length, and change g_checksum_get_digest to use a
2007-12-19  Christian Persch  <chpe@gnome.org>

	* glib/gchecksum.c: (g_checksum_type_get_length),
	(g_checksum_get_digest):
	* glib/gchecksum.h:
	* glib/glib.symbols:
	* tests/checksum-test.c: (test_checksum): Add
	g_checksum_type_get_length, and change g_checksum_get_digest to use a
	provided buffer instead of returning allocated memory. Bug #501853.

svn path=/trunk/; revision=6162
2007-12-19 18:53:27 +00:00
Emmanuele Bassi
a979c0d5a2 Fix the date validation check. (#503029)
2007-12-19  Emmanuele Bassi  <ebassi@gnome.org>

	* glib/gtimer.c (g_time_val_from_iso8601): Fix the date validation
	check. (#503029)

	* tests/testglib.c (various_string_tests): Add an invalid date
	for testing the above fix.

svn path=/trunk/; revision=6160
2007-12-19 17:28:38 +00:00
Matthias Clasen
d741d3e7a3 Add hash table iterators. (#500507, Jean-Yves Lefort)
2007-12-14  Matthias Clasen  <mclasen@redhat.com>

        * glib/glib.symbols:
        * glib/ghash.[hc]: Add hash table iterators.  (#500507,
        Jean-Yves Lefort)

        * tests/hash-test.c: Test iterators.



svn path=/trunk/; revision=6130
2007-12-15 03:54:09 +00:00
16:06:11 Tim Janik
0efd85aeac split up tests and reworked code to use the new test framework.
2007-12-12 16:06:11  Tim Janik  <timj@imendio.com>

        * tests/testglib.c: split up tests and reworked code to use
        the new test framework.

        * tests/Makefile.am: added testglib to TEST_PROGS.



svn path=/trunk/; revision=6103
2007-12-12 15:09:08 +00:00
Hans Breuer
29ca2e26b0 a test program emulating some of 'ls' build it (currently on win32)
2007-12-09  Hans Breuer  <hans@breuer.org>

	* tests/gio-ls.c : (new file) a test program emulating some of 'ls'
	* tests/makefile.msc.in : build it (currently on win32)


svn path=/trunk/; revision=6079
2007-12-09 22:02:15 +00:00
Hans Breuer
b877c83cdc removed -GD to compile with msvc9 (vs2008) with less complains
2007-12-09  Hans Breuer  <hans@breuer.org>

	* **/makefile.msc glib/makefile.msc.in : removed -GD to compile
	with msvc9 (vs2008) with less complains
	
	* glibconfig.h.win32.in : #define G_HAVE_ISO_VARARGS 1 for
	msv8 (vs2005) and above
	
	* glib/gfileutils.c : s/stricmp/_stricmp/
	* msvc_recommended_pragmas.h : work around Microsoft's premature 
	attempt to deprecate the C-Library

	* tests/makefile.msc.in : added checksum-test


svn path=/trunk/; revision=6076
2007-12-09 14:38:26 +00:00
09:27:42 Tim Janik
871897db96 added new scanner test from #501654, by Patrick Hulin with various
2007-12-06 09:27:42  Tim Janik  <timj@imendio.com>

        * tests/scannerapi.c: added new scanner test from #501654, by
        Patrick Hulin with various modifications.
        reworked coding style, adapted to new testing framework, fixed
        token parser test and use a forked sub process to test
        g_scanner_error() output messages.



svn path=/trunk/; revision=6055
2007-12-06 08:32:03 +00:00
Emmanuele Bassi
f17db34652 Add GChecksum, a generic wrapper around various hashing algorithms. At the
2007-12-04  Emmanuele Bassi  <ebassi@gnome.org>

	* glib/gchecksum.[ch]: Add GChecksum, a generic wrapper around
	various hashing algorithms. At the moment, the MD5, SHA-1 and
	SHA-256 algorithms are supported. (#443648)

	* glib/glib.h:
	* glib/Makefile.am:
	* glib/glib.symbols: Build glue for GChecksum

	* tests/Makefile.am
	* tests/checksum-test.c: Add test suite for GChecksum.

svn path=/trunk/; revision=6042
2007-12-04 16:31:51 +00:00
Ryan Lortie
7c65cf5915 typos.
svn path=/trunk/; revision=6032
2007-12-04 02:37:55 +00:00
Ryan Lortie
18fc4b8f02 fix memory leak, add a few extra sanity tests.
2006-12-03  Ryan Lortie  <desrt@desrt.ca>

	* tests/hash-test.c (second_hash_test): fix memory leak, add a few
	extra sanity tests.



svn path=/trunk/; revision=6025
2007-12-03 21:17:32 +00:00
Marco Barisione
458f3eca76 Add new error codes for when compilation fails and make compilation error
2007-12-03  Marco Barisione <marco@barisione.org>

	* glib/gregex.c:
	* glib/gregex.h: Add new error codes for when compilation fails and
	make compilation error translatable. (#482313, Morten Welinder)

svn path=/trunk/; revision=6021
2007-12-03 18:36:26 +00:00
Matthias Clasen
b9743a23dd Add some tests for invalid booleans
2007-11-26  Matthias Clasen  <mclasen@redhat.com>

        * tests/markup-collect.c: Add some tests for invalid booleans



svn path=/trunk/; revision=5949
2007-11-27 02:29:31 +00:00
Ryan Lortie
3b4c9c92dd add missing file off last commit
svn path=/trunk/; revision=5948
2007-11-27 01:57:53 +00:00
Ryan Lortie
052bd9da4f Add new function g_markup_collect_attributes (bug #496847).
2007-11-26  Ryan Lortie  <desrt@desrt.ca>
 
        Add new function g_markup_collect_attributes (bug #496847).
 
        * glib/glib.symbols: add g_markup_collect_attributes
 
        * docs/reference/glib/glib-sections.txt:
        * glib/gmarkup.h:
        * glib/gmarkup.c: add g_markup_collect_attributes and new enumerated
        type GMarkupCollectType.  Add new error code
        G_MARKUP_ERROR_MISSING_ATTRIBUTE that is thrown by the attribute
        collector.


svn path=/trunk/; revision=5947
2007-11-27 01:37:33 +00:00
Matthias Clasen
0c01c6f1ad Replace INCLUDES by AM_CPPFLAGS, other cleanups.
2007-11-24  Matthias Clasen  <mclasen@redhat.com>

        * */Makefile.am: Replace INCLUDES by AM_CPPFLAGS, other
        cleanups.



svn path=/trunk/; revision=5932
2007-11-25 04:22:45 +00:00
Matthias Clasen
ed1afd7772 Fix a memory overrun
svn path=/trunk/; revision=5928
2007-11-24 16:24:30 +00:00
Matthias Clasen
78c06eafe1 Don't refuse to encode a single byte. (Milan Crha)
2007-11-23  Matthias Clasen  <mclasen@redhat.com>

        * glib/gbase64.c (g_base64_encode): Don't refuse to encode
        a single byte.  (Milan Crha)

        * tests/base64-test.c: Test encoding short strings.



svn path=/trunk/; revision=5919
2007-11-23 17:58:00 +00:00
21:06:47 Tim Janik
1e55738f31 initialize automake variables EXTRA_DIST and TEST_PROGS for unconditional
2007-11-21 21:06:47  Tim Janik  <timj@imendio.com>

	* Makefile.decl: initialize automake variables EXTRA_DIST and
	TEST_PROGS for unconditional appending via += in other makefiles.
	define recursive test targets: test, test-report, perf-report,
	full-report, as described here:
      http://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00000.html

	* Makefile.am:
	* build/win32/vs8/Makefile.am, build/win32/dirent/Makefile.am:
	* build/win32/Makefile.am, build/Makefile.am:
	* docs/Makefile.am, docs/reference/Makefile.am:
	* docs/reference/glib/Makefile.am, docs/reference/gobject/Makefile.am:
	* gmodule/Makefile.am, tests/Makefile.am:
	* tests/refcount/Makefile.am, tests/gobject/Makefile.am:
	* glib/update-pcre/Makefile.am, glib/libcharset/Makefile.am:
	* glib/tests/Makefile.am, glib/pcre/Makefile.am:
	* glib/gnulib/Makefile.am, gobject/Makefile.am, m4macros/Makefile.am:
	* gthread/Makefile.am, glib/Makefile.am:
	include $(top_srcdir)/Makefile.decl, adapted EXTRA_DIST assignments.

	* glib/tests/Makefile.am: removed example testing rules.

	* glib/tests/testing.c: conditionalized performance and slow tests.

	* glib/gtestutils.h:
	* glib/gtestutils.c: work around g_test_config_vars not changing its
	exported value after value assignments, aparently due to symbol aliases.

	* glib/gtester.c: fixed off-by-one error which produced junk in logs.

	* configure.in: check for python >= 2.4 and provide $PYTHON for scripts.


svn path=/trunk/; revision=5914
2007-11-21 20:09:46 +00:00
Tim Janik
78373b68b9 Fixed up internal 'g_test*' names.
* refcount/signals.c:
* refcount/objects.c:
* refcount/objects2.c:
* refcount/closures.c:
* refcount/properties.c:
* refcount/properties2.c: changed namespace prefix from g_test_* to my_test_*
to not clash with newly introduced g_test* API in glib.

svn path=/trunk/; revision=5875
2007-11-20 15:00:20 +00:00
Tor Lillqvist
7d2ec70a49 Not needed, just use -DPCRE_STATIC.
2007-11-07  Tor Lillqvist  <tml@novell.com>

	* glib/update-pcre/notdll.patch: Not needed, just use -DPCRE_STATIC.

	* glib/update-pcre/Makefile.am: Drop notdll.patch.

	* glib/update-pcre/Makefile.am-1
	* glib/update-pcre/update.sh
	* glib/pcre/Makefile.am
	* glib/Makefile.am: Use -DPCRE_STATIC.

	* tests/gio-test.c
	* tests/mainloop-test.c
	* tests/spawn-test.c: #define pipe(fds) _pipe(fds, 4096,
	_O_BINARY) on Windows.

	* tests/regex-test.c (test_expand): Don't print NULL with %s.


svn path=/trunk/; revision=5805
2007-11-07 09:49:25 +00:00
Behdad Esfahbod
9df1f4fcc7 Fix warnings from sparse. (#487491, Kjartan Maraas)
2007-10-21  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gdate.c (g_date_strftime):
        * glib/gmain.c (g_main_context_check):
        * glib/gregex.c (g_match_info_fetch_all), (g_regex_split_full):
        * glib/gthread.c (g_once_init_enter_impl), (g_once_init_leave):
        * glib/gthread.h:
        * glib/gutf8.c (g_utf16_to_utf8), (g_utf16_to_ucs4):
        * tests/errorcheck-mutex-test.c (lock_locked_mutex),
        (trylock_locked_mutex), (unlock_unlocked_mutex),
        (free_locked_mutex), (wait_on_unlocked_mutex),
        (wait_on_otherwise_locked_mutex), (timed_wait_on_unlocked_mutex),
        (timed_wait_on_otherwise_locked_mutex):
        Fix warnings from sparse. (#487491, Kjartan Maraas)


svn path=/trunk/; revision=5792
2007-10-21 17:01:29 +00:00
15:07:28 Tim Janik
63828ea746 applied fix for bug #476840.
2007-09-14 15:07:28  Tim Janik  <timj@gtk.org>

        * glib/gutf8.c (g_utf8_strreverse): applied fix for bug #476840.

        * tests/utf8-pointer.c (test_misc): added test for g_utf8_strreverse().



svn path=/trunk/; revision=5757
2007-09-14 13:28:07 +00:00
Tim Janik
d5c4370813 prevent race covered by g_once_init_enter(), by checking for previous
Tue Aug 14 02:06:10 2007  Tim Janik  <timj@imendio.com>

        * glib/gthread.c (g_once_init_enter_impl): prevent race covered
        by g_once_init_enter(), by checking for previous initializations
        before entering initialisation branch.

        * tests/onceinit.c: added multi-thread/multi-initializer stress test
        using unoptimized g_once_init_enter_impl().



svn path=/trunk/; revision=5701
2007-08-14 00:05:52 +00:00
Tim Janik
e0dffd03fb fixed array size typo.
Mon Aug 13 14:30:15 2007  Tim Janik  <timj@imendio.com>

        * tests/onceinit.c (main): fixed array size typo.



svn path=/trunk/; revision=5699
2007-08-13 12:30:08 +00:00
Tim Janik
1ce6d47e3a test g_once_init_*() before and after g_thread_init() and test concurrency
Mon Aug 13 14:21:44 2007  Tim Janik  <timj@imendio.com>

        * tests/onceinit.c: test g_once_init_*() before and after
        g_thread_init() and test concurrency resolution.



svn path=/trunk/; revision=5698
2007-08-13 12:25:21 +00:00
Matthias Clasen
28f781501e Handle restricted characters by converting them to numeric character
2007-08-08  Matthias Clasen  <mclasen@redhat.com>

        * glib/gmarkup.c (append_escaped_text): Handle restricted
        characters by converting them to numeric character
        entities.  (#464145, Andreas Monitzer)

        * tests/markup-escape-test.c: Add tests for restricted
        characters and numeric character entities.


svn path=/trunk/; revision=5684
2007-08-09 02:06:04 +00:00
Tim Janik
f2fa3c8593 beautified output somewhat. fixed long sleeps by reducing sleep
Thu Jul 12 17:31:08 2007  Tim Janik  <timj@imendio.com>

        * tests/slice-concurrent.c: beautified output somewhat. fixed long
        sleeps by reducing sleep accumulating and using randomized re-scheduling
        (which works on UP and SMP). increased possible blocksizes.



svn path=/trunk/; revision=5631
2007-07-12 15:35:26 +00:00
Tim Janik
223754f627 added GSLice test from Stefan Westerfeld, bug #433314.
Thu Jul 12 17:26:05 2007  Tim Janik  <timj@imendio.com>

        * tests/slice-concurrent.c: added GSLice test from Stefan Westerfeld,
        bug #433314.



svn path=/trunk/; revision=5630
2007-07-12 15:26:47 +00:00
Tim Janik
964d75ebe3 migrate per-thread magazine caches from single-thread scenario to first
Thu Jul 12 15:46:40 2007  Tim Janik  <timj@imendio.com>

        * glib/gslice.c: migrate per-thread magazine caches from single-thread
        scenario to first thread using GSlice after g_thread_init(); based on
        a patch by Tor Lillqvist, fixes #331853.
        removed warning about g_thread_init() being called after other glib
        functions (in particular g_slice* calls), because GSlice can cope
        with this now and the rest of glib is believed to cope as well.

        * tests/slice-threadinit.c: new test program which tests GSlice working
        across g_thread_init() calls.



svn path=/trunk/; revision=5629
2007-07-12 15:07:52 +00:00
Loïc Minier
e9e1d9d45f Output newlines after thousand iterations of the inner-loop of the
2007-07-09  Loïc Minier  <lool@dooz.org>

       * tests/refcount/closures.c: (main): Output newlines after thousand
       iterations of the inner-loop of the closures test; this helps having
       smaller lines and continuously outputting new lines.  (#447048).

svn path=/trunk/; revision=5609
2007-07-09 07:42:30 +00:00
Mathias Hasselmann
ed4d216d2b Introduce g_string_overwrite(_len)? for overwriting parts of strings (#368686, Samuel Cormier-Iijima)
svn path=/trunk/; revision=5563
2007-06-15 11:54:21 +00:00
Matthias Clasen
d154485bc7 Add support for a number of special directories, as defined by the
2007-06-04  Matthias Clasen  <mclasen@redhat.com>

        Add support for a number of special directories, as
        defined by the xdg-user-dirs specification.  (#432651,
        Bastien Nocera, Emmanuele Bassi, Michael Natterer)

        * glib/glib.symbols:
        * glib/gutils.[hc]: Add the GUserDirectory enum and
        g_get_user_special_dir(), with implementations based
        on the xdg-user-dirs spec and on native interfaces
        for Win32 and Carbon.

        * configure.in: Add Carbon checks.

        * tests/tetsglib.c: Test g_get_user_special_dir().


svn path=/trunk/; revision=5528
2007-06-04 14:54:49 +00:00
Yevgen Muntyan
1db61c07d2 fixed g_regex_fetch_named* for cases when (?J) is used inside a pattern
2007-06-03  Yevgen Muntyan  <muntyan@tamu.edu>

	* glib/gregex.c: fixed g_regex_fetch_named* for cases when (?J)
	is used inside a pattern (#442265, comment #12).
	* tests/regex-test.c: Test it.


svn path=/trunk/; revision=5526
2007-06-03 06:05:23 +00:00
Yevgen Muntyan
904c42896f New functions: g_regex_ref(), g_regex_unref() which replaces
2007-06-03  Yevgen Muntyan  <muntyan@tamu.edu>

	* glib/gregex.c:
	* glib/gregex.h: New functions: g_regex_ref(), g_regex_unref() which
	replaces g_regex_free(); g_match_info_get_regex(), g_match_info_get_string();
	g_regex_check_replacement().
	Made g_match_info_expand_references() accept NULL; changed GRegexEvalCallback
	to take only arguments which are likely to be actualy used.

	* docs/reference/glib/glib-sections.txt:
	* glib/glib.symbols: Added new functions.

	* tests/regex-test.c: Test them.

	* docs/reference/glib/tmpl/gregex.sgml: Updated GRegexEvalCallback docs.


svn path=/trunk/; revision=5524
2007-06-03 05:48:17 +00:00
Marco Barisione
0fc6c7288a Fix g_regex_fetch_named() and g_regex_fetch_named_pos() when
2007-05-29  Marco Barisione <marco@barisione.org>

	* glib/gregex.c: Fix g_regex_fetch_named() and
	g_regex_fetch_named_pos() when G_REGEX_DUPNAMES is used  (#434358,
	Yevgen Muntyan and #419376, Marco Barisione, patch by Yevgen Muntyan)

svn path=/trunk/; revision=5518
2007-05-29 09:32:34 +00:00
Matthias Clasen
8f88ba6ffa Allow G_OPTION_ARG_CALLBACK for G_OPTION_REMAINING. (#437297, Dave Benson)
2007-05-11  Matthias Clasen  <mclasen@redhat.com>

        * glib/goption.c: Allow G_OPTION_ARG_CALLBACK for
        G_OPTION_REMAINING.  (#437297, Dave Benson)

        * tests/option-test.c: Add a test for this.



svn path=/trunk/; revision=5487
2007-05-11 18:53:57 +00:00
Matthias Clasen
9d3c408fbe Stop unused threads before the last test, to make the test terminate
* tests/threadpool-test.c: Stop unused threads before
        the last test, to make the test terminate reliably.



svn path=/trunk/; revision=5477
2007-05-03 04:48:10 +00:00
Matthias Clasen
a793051fda Split GRegex into GRegex and GMatchInfo. (#419368, Marco Barisione)
2007-04-30  Matthias Clasen  <mclasen@redhat.com>

        * glib/glib.symbols:
        * glib/gregex.[hc]: Split GRegex into GRegex and GMatchInfo.
        (#419368, Marco Barisione)

        * tests/regex-test.c: Adapt.


svn path=/trunk/; revision=5468
2007-04-30 16:02:26 +00:00
Michael Natterer
325bd373d4 don't free or modify static strings, dup them when needed and clear the
2007-04-24  Michael Natterer  <mitch@imendio.com>

	* gobject/gparamspecs.c (param_string_validate): don't free or
	modify static strings, dup them when needed and clear the
	G_VALUE_NOCOPY_CONTENTS flag. Fixes bug #432895.

	* tests/gobject/paramspec-test.c: test all GParamSpecString
	validations with static and allocated strings.


svn path=/trunk/; revision=5454
2007-04-24 13:36:58 +00:00
Emmanuele Bassi
db8642a56c Add g_hash_table_get_keys() and g_hash_table_get_values(), API to retrieve
2007-04-11  Emmanuele Bassi  <ebassi@gnome.org>

	* glib/ghash.[ch]: Add g_hash_table_get_keys() and
	g_hash_table_get_values(), API to retrieve the keys
	and values inside an hash table in list form. (#413133)

	* glib/glib.symbols: Update symbols.

	* tests/hash-test.c: Exercise newly added functions.

svn path=/trunk/; revision=5444
2007-04-11 13:09:38 +00:00
Matthias Clasen
ab74710386 Handle missing $RANDOM
svn path=/trunk/; revision=5435
2007-03-23 06:27:58 +00:00
Chris Wilson
033e54e8a4 Track whether the last key=value pair in a group is a blank line and
2007-03-22  Chris Wilson  <chris@chris-wilson.co.uk>

	* glib/gkeyfile.c: Track whether the last key=value pair in a group
	is a blank line and during to_data() only insert a new blank line
	betweens group in its absence. This allows the beautification of the
	GKeyFile and prevents newlines being inserted indefinitely. (#420686)

	* tests/keyfile-test.c (test_reload_idempotency): Test that after a 
	single beautification pass, g_key_file_to_data() does not alter its
	input data.


svn path=/trunk/; revision=5431
2007-03-22 08:58:59 +00:00
Hans Breuer
770b29bad2 define PCRE_STATIC to reflect the inclusion of pcre as LIB, not
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


svn path=/trunk/; revision=5423
2007-03-17 09:49:09 +00:00
Matthias Clasen
45b2988d05 Don't export the consistency check function
svn path=/trunk/; revision=5422
2007-03-17 04:25:40 +00:00
Marco Barisione
0196d63975 Add GRegex for regular expression matching. (#50075)
2007-03-15  Marco Barisione <marco@barisione.org>

	Add GRegex for regular expression matching.  (#50075)

	* configure.in: Handle GRegex compilation.

	* glib/gregex.c:
	* glib/gregex.h: Code for GRegex.

	* glib/Makefile.am:
	* glib/makefile.msc.in: Updated makefiles.

	* glib/pcre/*: Internal copy of PCRE.

	* glib/update-pcre/*: Stuff to automatically update the internal PCRE
	to a newer version.

	* tests/regex-test.c:
	* tests/Makefile.am:
	* tests/makefile.msc.in: Add tests for GRegex.

svn path=/trunk/; revision=5408
2007-03-15 13:01:31 +00:00
Matthias Clasen
2a867b1fca Return negative values. (#416062)
2007-03-08  Matthias Clasen  <mclasen@redhat.com>

        * glib/gstrfuncs.c (g_strtoll): Return negative values.
        (#416062)

        * tests/strtoll-test.c: Add more testcases.



svn path=/trunk/; revision=5390
2007-03-09 03:40:43 +00:00
Matthias Clasen
085042c6d7 Apply a patch by Loïc Minier to fix building with -Wl,-z,defs. (#149144)
2007-03-06  Matthias Clasen  <mclasen@Redhat.com>

        * tests/Makefile.am: Apply a patch by Loïc Minier
        to fix building with -Wl,-z,defs.  (#149144)



svn path=/trunk/; revision=5367
2007-03-06 05:01:45 +00:00
Soren Sandmann
f13d070e20 For move, test moving between two sequences. Add test for swap.
2007-02-16  Soren Sandmann <sandmann@redhat.com>

	* tests/sequence-test.c: For move, test moving between two
	sequences. Add test for swap.

	* glib/gsequence.c: Replace splay tree with a treap.
	(check_node): Add checks for the treap invariants.


svn path=/trunk/; revision=5337
2007-02-16 06:00:08 +00:00
Soren Sandmann
5fa8f600f5 Force an arbitrary order on otherwise identical items.
2007-02-07  Soren Sandmann <sandmann@daimi.au.dk>

	* tests/sequence-test.c (compare_items): Force an arbitrary order
	on otherwise identical items. 

	* glib/gsequence.c: Add comment discussing splay trees vs. other trees. 
	* glib/gsequence.c (is_end): Add fast path for the common case
	when the node is not actually the end node.


svn path=/trunk/; revision=5328
2007-02-08 02:22:52 +00:00
Soren Sandmann
840d9bab26 Don't prohibit access until after the g_sequence_move_range() call. Bug
2007-02-05  Soren Sandmann <sandmann@daimi.au.dk>

	* glib/gsequence.c (g_sequence_sort_iter): Don't prohibit access
	until after the g_sequence_move_range() call.  Bug 404759,
	Christian Persch.

       * tests/sequence-test.c: Formatting fix.


svn path=/trunk/; revision=5325
2007-02-06 04:49:41 +00:00
Soren Sandmann
576a5d4127 Add a new 'real_sequence' field. (g_sequence_new): Initialize
2007-02-03  Soren Sandmann <sandmann@daimi.au.dk>

        * glib/gsequence.c (struct _GSequence): Add a new 'real_sequence'
        field.
        (g_sequence_new): Initialize real_sequence to the sequence
        (g_sequence_sort_iter): Set real_sequence of the temporary
        sequence to the real sequence.
        (g_sequence_sort_changed_iter): Same
        (g_sequence_insert_sorted_iter): Same
        (g_sequence_search_iter): Same
        (g_sequence_iter_get_sequence): Return real_sequence

        * tests/sequence-test.c (compare_iters): Insert assertions that
        the iters point to the sequence being manipulated.


svn path=/trunk/; revision=5323
2007-02-04 03:39:57 +00:00
Soren Sandmann
674c4df418 New files implementing GSequence, a list implemented using a binary tree.
2007-02-03  Soren Sandmann <sandmann@daimi.au.dk>

	* glib/gsequence.[ch]: New files implementing GSequence, a list
	implemented using a binary tree.
	* glib/glib.h, glib/glib.symbols: Update for GSequence.
	* docs/reference: Add documentation for GSequence
	* tests: Add sequence-test.c, a thorough test of all of 
	the GSequence API.


svn path=/trunk/; revision=5322
2007-02-03 23:24:50 +00:00
Matthias Clasen
912027f0df Some file list updates (#398069, Owen Taylor)
2007-01-19  Matthias Clasen  <mclasen@redhat.com>

        Some file list updates (#398069, Owen Taylor)

        * docs/Changes-2.0.txt
        * docs/reference/README.cvs-commits
        * glib.spec.in: Remove obsolete files

        * tests/Makefile.am:
        * glib/libcharset/Makefile.am:
        * gobject/Makefile.am:
        * Makefile.am: Add some missing files to EXTRA_DIST

        * tests/timeloop-basic.c: Make it build
        * HACKING: Small updates


svn path=/trunk/; revision=5302
2007-01-19 15:50:30 +00:00
Matthias Clasen
38b9221961 Rework the handling of invalid keys/groups again. We are back to being
2007-01-12  Matthias Clasen  <mclasen@redhat.com>

        * glib/gkeyfile.c: Rework the handling of invalid
        keys/groups again. We are back to being liberal about
        what we accept, and only reject things that would lead
        to non-rereadable keyfiles.

        * tests/keyfile-test.c: Adapt tests.



svn path=/trunk/; revision=5254
2007-01-12 20:25:57 +00:00
Behdad Esfahbod
46dae95f4a Fix tests on x86_64.
2007-01-04  Behdad Esfahbod  <behdad@gnome.org>

        * tests/bit-test.c (builtin_bit_nth_lsf1), (builtin_bit_nth_lsf2),
        (builtin_bit_nth_msf): Fix tests on x86_64.


svn path=/trunk/; revision=5216
2007-01-05 03:31:54 +00:00
Behdad Esfahbod
048efdfbd5 Fix bug in g_bit_nth_lsf (#371631) and use __builtin_clzl for
2007-01-03  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gutils.h: Fix bug in g_bit_nth_lsf (#371631) and use 
        __builtin_clzl for g_bit_storage if available (#371670).

        * tests/Makefile.am:
        * tests/bit-test.c: New test, to test g_bit_* operations against
        naive and builtin implementations.


svn path=/trunk/; revision=5200
2007-01-03 20:08:53 +00:00
Michael Natterer
feb07512f0 removed all .cvsignore files. SVN doesn't need them.
2007-01-03  Michael Natterer  <mitch@imendio.com>

	* removed all .cvsignore files. SVN doesn't need them.


svn path=/trunk/; revision=5198
2007-01-03 11:22:36 +00:00
Matthias Clasen
d7b7c44e40 Define G_DEFINE_DYNAMIC_TYPE and and _EXTENDED variant. (#334437)
2006-12-29 Matthias Clasen  <mclasen@redhat.com>

        * gtypemodule.h: Define G_DEFINE_DYNAMIC_TYPE and
        and _EXTENDED variant.  (#334437)
2006-12-29 06:12:11 +00:00
Tim Janik
1bd8993451 implemented static debugging hash-tree to validate slice adresses and
Thu Dec 28 12:50:31 2006  Tim Janik  <timj@imendio.com>

        * glib/gslice.h, glib/gslice.c: implemented static debugging
        hash-tree to validate slice adresses and sizes with G_SLICE=debug-blocks.
        use abort() to exit in mem_error() to allow catching of these in gdb.
        abort programs with a descriptive error message if g_thread_init() is
        called after GSlice was in use. previously this just silently corrupted
        the magazines.

        * glib/ghash.c (struct _GHashNode): reordered fields to keep 8-byte
        pointer alignment on 64bit systems and request smaller slice sizes
        on 32bit systems.

        * tests/slice-test.c: support '~' option flag to introduce slice
        allocation/release corruption with a significant probability. this
        allowes testing of G_SLICE=debug-blocks.
2006-12-28 11:50:43 +00:00
Matthias Clasen
98d552e0cd Consistently use gsize rather than size_t. (#333310, Morten Welinder)
2006-12-27  Matthias Clasen  <mclasen@redhat.com>

        * glib/gconvert.[hc]:
        * glib/gfileutils.c:
        * glib/giochannel.c:
        * glib/goption.c:
        * glib/gspawn.c:
        * glib/gunicollate.c:
        * glib/gutils.c:
        * tests/timeloop-basic.c:
        Consistently use gsize rather than size_t.  (#333310,
        Morten Welinder)
2006-12-28 04:48:06 +00:00
Matthias Clasen
ca7dc0e94c Silently skip tests if we can't set LC_COLLATE to en_US. (#336438)
2006-12-24  Matthias Clasen  <mclasen@redhat.com>

        * tests/run-collate-tests.sh:
        * tests/unicode-collate.c: Silently skip tests if
        we can't set LC_COLLATE to en_US.  (#336438)
2006-12-24 21:47:05 +00:00
Matthias Clasen
01f78fa7f5 Accept '/', '+' and '.' in key names, since gnome-vfs uses mime types as
2006-12-19  Matthias Clasen  <mclasen@redhat.com>

        * glib/gkeyfile.c (g_key_file_is_key_name): Accept
        '/', '+' and '.' in key names, since gnome-vfs uses
        mime types as keys in some cache.

2
2006-12-19 21:08:32 +00:00
Matthias Clasen
330e9ffc1b Try a different fix for bug 346373.
2006-12-18  Matthias Clasen  <mclasen@redhat.com>

        * tests/Makefile.am: Try a different fix for bug 346373.
2006-12-18 14:50:36 +00:00
Matthias Clasen
52ef9438ca Accept '@' in locale names.
2006-12-18  Matthias Clasen  <mclasen@redhat.com>

        * glib/gkeyfile.c: Accept '@' in locale names.
2006-12-18 14:13:34 +00:00
Matthias Clasen
6b52690bb5 Tighten up the check for allowed key and group names. (#343191, Tommi
2006-12-18  Matthias Clasen  <mclasen@redhat.com>

        * glib/gkeyfile.c: Tighten up the check for allowed
        key and group names.  (#343191, Tommi Komulainen)

        * tests/keyfile-test.c: Test handling of key and group names.
2006-12-18 07:29:56 +00:00
Matthias Clasen
81aee2e13e Don't use $RANDOM if the shell doesn't have it. (#346373, Thomas Klausner)
* tests/Makefile.am: Don't use $RANDOM if the shell doesn't
        have it.  (#346373, Thomas Klausner)
2006-12-18 05:02:37 +00:00
Matthias Clasen
c01a364fb4 Don't use diff -u (#380801, Marek Rouchal)
2006-12-17  Matthias Clasen  <mclasen@redhat.com>

        * tests/run-markup-tests.sh: Don't use diff -u  (#380801,
        Marek Rouchal)
2006-12-17 18:01:15 +00:00
Matthias Clasen
966872d789 If the group is already there, make it current. (#385910, Joe Halliwell)
2006-12-14  Matthias Clasen  <mclasen@redhat.com>

        * glib/gkeyfile.c (g_key_file_add_group): If the group
        is already there, make it current.  (#385910, Joe Halliwell)

        * tests/keyfile-test.c: Add a test for duplicate groups/keys.
2006-12-14 23:19:28 +00:00
Tor Lillqvist
256ba23b98 makefile.mingw gmodule/makefile.mingw.in glib/makefile.mingw.in
2006-11-05  Tor Lillqvist  <tml@novell.com>

	* makefile.mingw
	* gmodule/makefile.mingw.in
	* glib/makefile.mingw.in
	* gobject/makefile.mingw.in
	* gthread/makefile.mingw.in
	* tests/makefile.mingw.in: Remove from CVS. Haven't been
	maintained or distributed for long.
2006-11-05 15:42:42 +00:00
Sebastian Wilhelmi
38c633aed6 Compile errorcheck-mutex-test with thread libraries explicitly. (#74748,
2006-10-15  Sebastian Wilhelmi  <seppi@seppi.de>

        * tests/Makefile.am: Compile errorcheck-mutex-test with thread
        libraries explicitly. (#74748, Javier Villavicencio)
2006-10-15 12:18:25 +00:00
Matthias Clasen
9c19905b0e portability fix 2006-10-08 19:59:26 +00:00
Tim Janik
aa4c932630 added test program which demonstrates and checks singleton construction.
Wed Aug 16 13:59:07 2006  Tim Janik  <timj@gtk.org>

        * tests/gobject/Makefile.am:
        * tests/gobject/singleton.c: added test program which demonstrates
        and checks singleton construction.
2006-08-16 12:11:03 +00:00
Matthias Clasen
994d642cde If a character can't be converted, don't replace it with a NUL byte, but
2006-08-05  Matthias Clasen  <mclasen@redhat.com>

	* glib/guniprop.c (g_unichar_toupper, g_unichar_tolower)
	(real_toupper, real_tolower): If a character can't be converted,
	don't replace it with a NUL byte, but leave it unchanged.
	(#348491, Nikolai Weibull)

	* tests/unicode-caseconv.c: Adapt to this change.

	* tests/unicode-caseconv.c (main): Add a comment to point out
	a quirk in the test data that we are working around here.
2006-08-05 21:53:49 +00:00
Behdad Esfahbod
290443f86f Update to reflect Unicode PR #29 (#348694, Nikolai Weibull)
2006-07-31  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gunidecomp.c (_g_utf8_normalize_wc): Update to reflect Unicode
        PR #29 (#348694, Nikolai Weibull)

        * tests/unicode-normalize.c (encode), (test_form): Make output more
        useful, reporting the unexpected output of the test.
2006-07-31 04:50:05 +00:00
Tor Lillqvist
94322b96da Use g_get_current_time() insted of gettimeofday().
2006-07-24  Tor Lillqvist  <tml@novell.com>

	* tests/slice-test.c: Use g_get_current_time() insted of
	gettimeofday().
2006-07-24 12:42:18 +00:00
Matthias Clasen
1f536d2f12 Fix an off-by-2 error in the leap year calculation. (#344905, Dan Winship)
2006-06-20  Matthias Clasen  <mclasen@redhat.com>

	* glib/gtimer.c (mktime_utc): Fix an off-by-2 error
	in the leap year calculation.  (#344905, Dan Winship)

	* tests/testglib.c (main): Change the test data for
	the g_time_val_from_iso8601 tests to expose an off-by-2
	error in the leap year calculation.
2006-06-20 16:37:43 +00:00
Matthias Clasen
6cc8a27894 Add tests.
2006-06-16  Matthias Clasen  <mclasen@redhat.com>

	* tests/file-test.c (test_mkstemp): Add tests.

	* glib/gfileutils.c (g_mkstemp): Allow the XXXXXX to occur
	inside the template, not just at the end.
2006-06-16 15:12:32 +00:00
Emmanuele Bassi
cc37f43d1d Return a boolean instead of void.
2006-06-12  Emmanuele Bassi  <ebassi@cvs.gnome.org>

	* glib/gbookmarkfile.h:
	* glib/gbookmarkfile.c (g_bookmark_file_remove_item): Return
	a boolean instead of void.

	* tests/bookmarkfile-test.c (test_modify): Add a test case
	for g_bookmark_file_remove_item().
2006-06-12 17:19:13 +00:00
Matthias Clasen
c3d19b850f Add some tests involving leading whitespace.
2006-06-05  Matthias Clasen  <mclasen@redhat.com>

	* tests/strtod-test.c: Add some tests involving
	leading whitespace.

	* glib/gstrfuncs.c (g_ascii_formatd): Skip leading
	whitespace.  (#343899, Øystein Johansen)
2006-06-05 14:16:47 +00:00
Matthias Clasen
14538bb8d6 Avoid running in an assertion with small writes. (#343566, Chris Wilson)
2006-06-01  Matthias Clasen  <mclasen@redhat.com>

	* glib/giochannel.c (g_io_channel_write_chars): Avoid
	running in an assertion with small writes.  (#343566, Chris
	Wilson)

	* tests/iochannel-test.c: Add a testcase for small writes.
2006-06-01 15:57:38 +00:00
Matthias Clasen
c8922bb143 Output that test-markup is expected to produce when run on the valid
2006-05-28  Matthias Clasen  <mclasen@redhat.com>

	* tests/markups/expected-*: Output that test-markup
	is expected to produce when run on the valid gmarkup
	examples.

	* tests/markup-test.c: Only dump the results of the
	first, unchunked parse, to compare it against the expected
	output.

	* tests/run-markup-tests.sh: For valid examples, compare
	the output of test-markup against the corresponding
	expected-<n> file.
2006-05-28 22:58:41 +00:00
Matthias Clasen
49ab402f5a g_ascii_strtoll 2006-05-16 05:49:46 +00:00
Bastien Nocera
93ec25ad67 add documentation for G_OPTION_ARG_INT64
2006-05-11  Bastien Nocera  <hadess@hadess.net>

	* glib/tmpl/option.sgml: add documentation for G_OPTION_ARG_INT64

2006-05-11  Bastien Nocera  <hadess@hadess.net>

	* glib/goption.c: (parse_int64), (parse_arg), (free_changes_list):
	* glib/goption.h:
	* tests/option-test.c: (arg_test6), (main): add an int64 type for
	GOption (G_OPTION_ARG_INT64) (#341237)
2006-05-11 18:37:15 +00:00
Sebastian Wilhelmi
a194e2e971 Adapt to GLib coding standards.
2006-05-10  Sebastian Wilhelmi  <wilhelmi@google.com>

	* tests/errorcheck-mutex-test.c: Adapt to GLib coding standards.
2006-05-10 23:58:27 +00:00
Sebastian Wilhelmi
e4f8f3b95c Renamed to glib/gthreadprivate.h and moved system thread identifier
2006-05-09  Sebastian Wilhelmi  <wilhelmi@google.com>

	* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
	system thread identifier comparision and assignment macros from
	glib/gthread.c to glib/gthreadprivate.h.

	* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
	glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
	glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
	glib/gthreadprivate.h instead of glib/gthreadinit.h.

	* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
	owner determination. This fixes #311043 and is mostly modeled
	after the patch from jylefort@FreeBSD.org.
2006-05-10 00:44:50 +00:00
Matthias Clasen
eb9ff05320 Use encoding names which may work better on Solaris. (#340434, Alessandro
2006-05-08  Matthias Clasen  <mclasen@redhat.com>

	* tests/convert-test.c (test_one_half): Use encoding names which
	may work better on Solaris.  (#340434, Alessandro Vesely)
2006-05-08 16:58:24 +00:00
Matthias Clasen
eda3af5546 Add some tests for invalid floating point numbers.
2006-05-08  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_number): Add some tests for
	invalid floating point numbers.
2006-05-08 16:48:47 +00:00
Matthias Clasen
92dc9fe794 Add some more tests.
2006-05-03  Matthias Clasen  <mclasen@redhat.com>

	* tests/base64-test.c: Add some more tests.
2006-05-03 15:27:40 +00:00