Commit Graph

616 Commits

Author SHA1 Message Date
Behdad Esfahbod
f3ed45cbfb . 2006-04-05 04:50:48 +00:00
Alexander Larsson
5cf8f1d4a8 Add base64 encode/decode functions
2006-04-04  Alexander Larsson  <alexl@redhat.com>

	* glib/Makefile.am:
	* glib/gbase64.[ch]:
	* glib/glib.symbols:
	Add base64 encode/decode functions

	* glib/glib.h:
	Include gbase64.h

	* tests/Makefile.am:
	* tests/base64-test.c:
	Tests for base64 functions
2006-04-04 13:03:23 +00:00
Emmanuele Bassi
75eb6fb661 Add bookmarkfile-test to the ignored files.
2006-03-27  Emmanuele Bassi  <ebassi@cvs.gnome.org>

	* tests/.cvsignore: Add bookmarkfile-test to the ignored files.
2006-03-27 18:30:11 +00:00
Emmanuele Bassi
9bf3a0fa5f Add test suite for GBookmarkFile.
2006-03-27  Emmanuele Bassi  <ebassi@cvs.gnome.org>

	* tests/Makefile.am:
	* tests/bookmarkfile-test.c:
	* tests/run-bookmark-test.sh:
	* tests/bookmarks/*.xbel: Add test suite for GBookmarkFile.
2006-03-27 18:28:07 +00:00
Dom Lachowicz
a903995bcc Change a gboolean to an int. Fixes bug #329789.
2006-03-27  Dom Lachowicz  <cinamod@hotmail.com>
	Change a gboolean to an int. Fixes bug #329789.
2006-03-27 13:37:02 +00:00
Dom Lachowicz
a9f52a13b0 Copy-and-paste error slipped into test5. Enable test5, as per Matthias'
2006-03-27  Dom Lachowicz  <cinamod@hotmail.com>

	* tests/option-test.c: Copy-and-paste error slipped into test5. Enable
	test5, as per Matthias' comments in bug 329548#c11.
2006-03-27 13:34:16 +00:00
Matthias Clasen
9749aa87e5 Support floating point arguments in goption 2006-03-27 06:57:28 +00:00
Martyn James Russell
f0ee594a80 Updated the documentation to explain that when the maximum threads is > 1
* glib/gthreadpool.c: Updated the documentation to explain that
when the maximum threads is > 1 the sort functionality is not 100%
accurate due to the ramdom nature of the scheduler choosing which
threads to execute. Fixes bug #334943.

* tests/threadpool-test.c: Disabled the debugging by default and
fixed the sort test to set the maximum threads to 1 to guarantee
the thread entry function is called in order.
2006-03-24 15:21:28 +00:00
Emmanuele Bassi
6db9ec4070 Check for timegm.
2006-03-23  Emmanuele Bassi  <ebassi@cvs.gnome.org>

	* configure.in: Check for timegm.

	* glib/gtimer.h:
	* glib/gtimer.c:
	* glib/glib.symbols:
	* docs/reference/glib/glib-sections.txt: Added g_time_val_to_iso8601
	and g_time_val_from_iso8601, to convert a GTimeVal to and from an
	ISO 8601 encoded date.

	* tests/testglib.c: Added test cases for g_time_val_to_iso8601()
	and g_time_val_from_iso8601() functions.
2006-03-23 02:54:29 +00:00
Matthias Clasen
9e58246669 Don't read past the end of the string. (#334471, Morten Welinder)
2006-03-14  Matthias Clasen  <mclasen@redhat.com>

	* glib/gutils.c (g_parse_debug_string): Don't read past the
	end of the string.  (#334471, Morten Welinder)
2006-03-14 17:56:27 +00:00
Matthias Clasen
8b3b3adb6d Add tests for g_utf8_strlen().
2006-02-24  Matthias Clasen  <mclasen@redhat.com>

        * tests/utf8-pointer.c: Add tests for g_utf8_strlen().

        * glib/gutf8.c: Fix boundary cases in g_utf8_strlen().
        (#332435)
2006-02-24 13:56:58 +00:00
Kjartan Maraas
a629b3f02d Plug leaks reported by valgrind. Same. Same Same. Same. Same.
2006-02-23  Kjartan Maraas  <kmaraas@gnome.org>

	* tests/completion-test.c: (main): Plug leaks reported by
	valgrind.
	* tests/convert-test.c: (test_iconv_state), (test_one_half):
	Same.
	* tests/patterntest.c: (test_compilation): Same
	* tests/shell-test.c: (do_argv_test): Same.
	* tests/unicode-caseconv.c: (main): Same.
	* tests/uri-test.c: (run_to_uri_tests): Same.
2006-02-23 09:09:55 +00:00
Martyn James Russell
dde67f284d Updated to test _sort, _sort_with_data, _insert_sorted and
* tests/asyncqueue-test.c:
* tests/list-test.c:
* tests/slist-test.c: Updated to test _sort, _sort_with_data,
_insert_sorted and _insert_sorted_with_data API.
2006-02-19 17:17:32 +00:00
Matthias Clasen
c773a618e3 Add paramspec-test
2006-02-18  Matthias Clasen  <mclasen@redhat.com>

	* tests/gobject/Makefile.am: Add paramspec-test

	* tests/gobject/paramspec-test.c: Some GParamSpec tests.
2006-02-18 21:07:18 +00:00
Matthias Clasen
fb7ae4674a Add more tests.
2006-02-18  Matthias Clasen  <mclasen@redhat.com>

	* tests/gobject/gvalue-test.c: Add more tests.
2006-02-18 20:37:14 +00:00
Matthias Clasen
8ff5b7f920 Remove C++ comment 2006-01-30 04:19:07 +00:00
Tim Janik
eda944bca5 honour g_mem_gc_friendly settings when freeing slices, make sure
Wed Jan 25 16:39:18 2006  Tim Janik  <timj@imendio.com>

        * glib/gslice.c: honour g_mem_gc_friendly settings when freeing
        slices, make sure g_mem_gc_friendly is properly initialized.

        * gmem.[hc]: ensure g_mem_gc_friendly is initialized from G_DEBUG upon
        the first allocation. applied some branching optimizations.

        * docs/macros.txt: reflected --enable-gc-friendly change and
        described ENABLE_GC_FRIENDLY_DEFAULT as well as G_DEBUG=gc-friendly.

        * configure.in: changed --enable-gc-friendly=yes to define
        ENABLE_GC_FRIENDLY_DEFAULT.

        * glib/garray.c: changed ENABLE_GC_FRIENDLY macro #ifdef-s to
        if (G_UNLIKELY (g_mem_gc_friendly)).

        * glib/gtree.c:
        * glib/ghash.c: removed ENABLE_GC_FRIENDLY code which is now taken
        care of by g_slice_free1().

        * tests/slice-test.c: fixed leaks, reported by Kjartan Maraas.
2006-01-25 15:51:43 +00:00
Matthias Clasen
3c62ff454a Use UTF-16LE as target encoding on all little-endian systems. (#143380,
2006-01-24  Matthias Clasen  <mclasen@redhat.com>

	* tests/unicode-encoding.c: Use UTF-16LE as target encoding
	on all little-endian systems.  (#143380, Marc Moorcroft)
2006-01-24 15:25:11 +00:00
Sebastian Wilhelmi
f4484f51bf To avoid deadlocks get rid of the settings G_LOCK. Use the
2006-01-17  Sebastian Wilhelmi  <seppi@seppi.de>

	* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
	G_LOCK. Use the unused_thread_queue lock instead. Change
	g_thread_pool_thread_proxy such that threads only wait on
	non-exlusive pools for at most a 1/2 second. Do not reorder tasks
	due to superfluous tasks. Global tasks wait at most for
	max-idle-time milliseconds. Make sure, that no task is woken up
	twice for the same event via a wakeup_serial. This fixes #324228.

	* tests/threadpool-test.c: Adapt test accordingly. Do not pass
	invalid NULL into the thread pools. This as well fixes #327290.
2006-01-17 20:06:27 +00:00
Matthias Clasen
42e7c208b7 Fix the assert to not always trigger. (#326558, Daichi Kawahata)
2006-01-12  Matthias Clasen  <mclasen@redhat.com>

	* tests/asyncqueue-test.c (main): Fix the
	assert to not always trigger.  (#326558,
	Daichi Kawahata)
2006-01-12 20:27:16 +00:00
Matthias Clasen
c93ebd50af Don't test items_read and items_written in error cases where it is not
2006-01-11  Matthias Clasen  <mclasen@redhat.com>

	* tests/convert-test.c: Don't test items_read and
	items_written in error cases where it is not set.
2006-01-11 16:49:22 +00:00
Matthias Clasen
e31bd40d43 Set error to NULL.
2006-01-11  Matthias Clasen  <mclasen@redhat.com>

	* tests/asyncqueue-test.c: Set error to NULL.
2006-01-11 16:30:21 +00:00
Matthias Clasen
a3a469192c Break some long lines.
2006-01-08  Matthias Clasen  <mclasen@redhat.com>

	* glib/gtree.c: Break some long lines.

	* tests/tree-test.c: Add more tests.
2006-01-09 04:11:12 +00:00
Martyn James Russell
941faa1ca9 - Added new API g_thread_pool_get_idle_time() and
* docs/reference/glib/glib-sections.txt:
* glib/glib.symbols:
* glib/gthreadpool.[ch]:
- Added new API g_thread_pool_get_idle_time() and
g_thread_pool_set_idle_time(). (#324228).

* tests/threadpool-test.c:
- Updated test case to do thread pool sorting, thread pool with
no sorting and a thread pool with idle thread timeouts.
2006-01-03 15:09:52 +00:00
Manish Singh
87a57aa6b2 Shut up CVS 2005-12-27 23:37:28 +00:00
Manish Singh
a05f171524 use LC_ALL instead of LC_COLLATE, to make sure we really override things.
2005-12-27  Manish Singh  <yosh@gimp.org>

        * tests/run-collate-tests.sh: use LC_ALL instead of LC_COLLATE, to
        make sure we really override things.
2005-12-27 23:35:52 +00:00
Manish Singh
4a94f2d332 export LC_COLLATE so it takes. (#324950, Dan Yefimov)
2005-12-27  Manish Singh  <yosh@gimp.org>

        * tests/run-collate-tests.sh: export LC_COLLATE so it takes.
        (#324950, Dan Yefimov)
2005-12-27 08:23:08 +00:00
Matthias Clasen
47d2ef18ea Fix C99isms. (#324950, Dan Yefimov)
2005-12-25  Matthias Clasen  <mclasen@redhat.com>

        * tests/slice-test.c: Fix C99isms.  (#324950, Dan Yefimov)
2005-12-26 04:59:34 +00:00
Matthias Clasen
700a71f010 New function to sort tasks pushed into a threadpool. (#324479, Martyn
2005-12-20  Matthias Clasen  <mclasen@redhat.com>

	* glib/glib.symbols:
	* glib/gthreadpool.h:
	* glib/gthreadpool.c (g_thread_pool_set_sort_function): New function
	to sort tasks pushed into a threadpool.  (#324479, Martyn Russell)

	* tests/threadpool-test.c: Test this.
2005-12-21 04:45:56 +00:00
Tim Janik
3f9d65375e added mem_error() and mem_assert() to test and handle errors without
Tue Dec 20 18:14:14 2005  Tim Janik  <timj@imendio.com>

        * glib/gslice.[hc]: added mem_error() and mem_assert() to test and
        handle  errors without depending on gmessage.c which might not be
        setup when the error occours.
        removed G_SLICE_CONFIG_ALWAYS_FREE config option, fixed the code so
        always freeing can be achieved by adjusting the working set time to
        0 with G_SLICE_CONFIG_WORKING_SET_MSECS.
        added G_SLICE_CONFIG_COLOR_INCREMENT to test different color increments
        (mainly 0 and 1). reduced the minimum block size to 128 bytes, to
        minimize wastage if small amounts of differently sized structrues are
        allocated, this does come at a performance cost of roughly 5% though.
        fixed up block alignment calculation, so it works for varying
        block sizes. only use strerror() not g_strerror() since the latter
        depends on working GQuark and GSlice.
        mem_error(): implemented in terms of fprintf and vfprintf.

        * tests/slice-color.c: new program to test cache colorization effects.

        * tests/slice-test.c: trade G_SLICE_CONFIG_ALWAYS_FREE for 0 duration
        G_SLICE_CONFIG_WORKING_SET_MSECS.
2005-12-20 17:35:02 +00:00
Martyn James Russell
c6ad7b7ac8 - Call g_queue_insert_sorted() instead of duplicating the code. - Call
* glib/gasyncqueue.c:
- Call g_queue_insert_sorted() instead of duplicating the code.
- Call g_queue_sort() instead of duplicating the code.
- Invert sort function results to make sure the same sort function
gives the same results across glist, gslist, gqueue and
gasyncqueue.

* tests/asyncqueue-test.c:
- Updated the sort function to reflect the example in the
documentation for gasyncqueue.c.
2005-12-07 12:09:44 +00:00
Manish Singh
b995c03ea2 set LC_COLLATE, not LANG, to be sure to override any user settings.
2005-12-05  Manish Singh  <yosh@gimp.org>

        * tests/run-collate-test.sh: set LC_COLLATE, not LANG, to be sure
        to override any user settings.
2005-12-05 21:45:06 +00:00
Matthias Clasen
9948add142 broken commit 2005-12-05 16:39:34 +00:00
Matthias Clasen
81f0bb11a9 Set MALLOC_CHECK_ and MALLOC_PERTURB_
2005-12-05  Matthias Clasen  <mclasen@redhat.com>

	* tests/Makefile.am (TESTS_ENVIRONMENT):
	* tests/gobject/Makefile.am (TESTS_ENVIRONMENT): Set
	MALLOC_CHECK_ and MALLOC_PERTURB_

	* tests/run-collate-tests.sh: Run the collation tests explicitly
	in en_US locale. (#320463)
2005-12-05 16:35:38 +00:00
Martyn James Russell
a127920458 - Added support for sorting async queues by with _push_sorted(),
* docs/reference/glib/glib-sections.txt:
* glib/gasyncqueue.[ch]:
- Added support for sorting async queues by with _push_sorted(),
_push_sorted_unlocked(), _sort() and _sort_unlocked() (#323047).

* tests/Makefile.am:
* tests/asyncqueue-test.c:
- Added test case for gasyncqueue.c
2005-12-05 15:08:45 +00:00
Matthias Clasen
5c32d5236f Fix compiler warnings.
2005-12-05  Matthias Clasen  <mclasen@redhat.com>

	* tests/libmoduletestplugin_a.c: Fix compiler warnings.

	* glib/gatomic.c: In the ia64 implementation, use
	__sync builtin without _si or _di suffix.  (#321229,
	Stanislav Brabec, patch by Andreas Schwab)
2005-12-05 13:37:55 +00:00
Tim Janik
2731276269 extended to perform the benchmarking on the old memchunk code if 'O' is
Fri Dec  2 10:55:07 2005  Tim Janik  <timj@imendio.com>

        * tests/slice-test.c: extended to perform the benchmarking on the old
        memchunk code if 'O' is selected.

        * tests/memchunks.c: new file which contains the old GLib mem chunks
        implementation with prefix old_mem_chunk_.

        * tests/Makefile.am: added memchunks.c
2005-12-02 09:57:06 +00:00
Matthias Clasen
a2f85d23ef Make tests work with slice allocator 2005-12-01 18:06:17 +00:00
Matthias Clasen
470abcc950 Remove a duplicate _LDADD 2005-12-01 16:43:56 +00:00
Tim Janik
733b1789c1 new slice allocator implementation.
Thu Dec  1 17:32:46 2005  Tim Janik  <timj@imendio.com>

        * glib/gslice.[hc]: new slice allocator implementation.

        * tests/slice-test.c: added random slice allocation test.

        * glib/gthread.[hc]: removed newly added private thread mem API.

        * glib/gthreadinit.h:
        * glib/gmessages.c:
        * glib/gthread.c:
        * glib/gmem.c: divided glib threading initialisation into three phases,
        initialisation where private keys and messaging are not available (only
        needed by gmem.c), initialisation without messaging but private keys
        available (gslice.c, gmessage.c), and full fledged initialisers that
        server the rest of glib. initialisation functions got renamed to reflect
        the limitations of their corresponding phases.

        * glib/gmem.c: removed memchunk code, defer allocations to
        g_slice_* instead.

        * glib/gmem.[hc]: removed g_slice_* skeletons.

        * glib/glib.symbols: added g_slice_* symbols.

        * configure.in: check for availability of posix_memalign(3), memalign(3)
        and valloc(3).

        * glib/Makefile.am: added gslice.[hc].
2005-12-01 16:34:33 +00:00
Behdad Esfahbod
22b91f10fc New entries added. 2005-11-21 00:49:00 +00:00
Matthias Clasen
d7deadb1e2 2.9.0 2005-11-18 13:58:48 +00:00
Matthias Clasen
1ee0917984 Unit tests for g_utf8_pointer_to_offset and g_utf8_offset_to_pointer.
2005-11-17  Matthias Clasen  <mclasen@redhat.com>

	* tests/Makefile.am:
	* tests/utf8-pointer.c: Unit tests for g_utf8_pointer_to_offset
	and g_utf8_offset_to_pointer.

	* glib/gutf8.c (g_utf8_pointer_to_offset)
	(g_utf8_offset_to_pointer): Handle negative offsets, and use
	"stutter stepping" for going backwards. (#320638, Larry
	Ewing)
2005-11-17 15:50:31 +00:00
Billy Biggs
e8e3891c0f Add a missing reference to libglib in the LDADD for this test.
2005-11-07  Billy Biggs <vektor@dumbterm.net>

	* tests/refcount/Makefile.am: Add a missing reference to libglib
	in the LDADD for this test.
2005-11-07 16:29:19 +00:00
Matthias Clasen
3a042a8959 Add some tests for conversions between UTF-8, UCS-4 and UTF-16.
2005-10-29  Matthias Clasen  <mclasen@redhat.com>

	* tests/convert-test.c: Add some tests for conversions between
	UTF-8, UCS-4 and UTF-16.

	* glib/gutf8.c (g_utf8_to_ucs4, g_utf8_to_utf16): Fix handling
	of len == -1, noticed by Morten Welinder.
2005-10-30 03:05:21 +00:00
Matthias Clasen
d433419b14 Add Collation tests.
2005-10-05  Matthias Clasen  <mclasen@redhat.com>

	* Makefile.am: Add Collation tests.

	* tests/collate/*: Inputs and expected outputs for collation tests.

	* tests/run-collate-tests.sh: Script to run collation tests.

	* tests/unicode-collate.c (main): Rework slightly to make
	it usable in unit tests. Also test g_utf8_collate_key_for_filename().
2005-10-05 17:37:46 +00:00
Behdad Esfahbod
c83e2b3349 Updated to Unicode 4.1. There are five new GUnicodeBreakType types. That
2005-10-01  Behdad Esfahbod  <behdad@gnome.org>

        * docs/reference/glib/tmpl/unicode.sgml:
        * glib/gen-unicode-tables.pl:
        * glib/gunibreak.h:
        * glib/gunichartables.h:
        * glib/gunicode.h:
        * tests/casefold.txt:
        * tests/casemap.txt: Updated to Unicode 4.1.  There are five new
        GUnicodeBreakType types.  That may break some applications, like
        Pango <= 1.10.
2005-10-01 12:34:21 +00:00
Tim Janik
744a4397ff applied significant recursion complexity optimization, based on a patch
Tue Sep 20 13:16:04 2005  Tim Janik  <timj@imendio.com>

        * glib/gpattern.c (g_pattern_ph_match): applied significant recursion
        complexity optimization, based on a patch from Matthias Clasen.

        * tests/patterntest.c: more tests, mostly from matthias.
2005-09-20 11:20:23 +00:00
Tim Janik
a2ff6e7982 applied a patch from matthias which checks on the upper bound of
Mon Sep 19 17:23:23 2005  Tim Janik  <timj@imendio.com>

        * glib/gpattern.c: applied a patch from matthias which checks on the
        upper bound of GPatternSpec length to optimize matches.
        cosmetic fixups.

        * tests/patterntest.c: added more match cases.
2005-09-19 15:27:17 +00:00
Matthias Clasen
283d4a73f9 Add bug ref 2005-09-14 18:12:52 +00:00
Matthias Clasen
81719cc164 Add a test for grup names of length 1.
2005-09-14  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c: Add a test for grup names of length 1.

	* glib/gkeyfile.c (g_key_file_line_is_group): Accept group names
	of length 1.  (#316309)
2005-09-14 18:04:53 +00:00
Sebastian Wilhelmi
d8d12ca541 Link the the refcount tests to the system thread library $(G_THREAD_LIBS).
2005-09-11  Sebastian Wilhelmi  <seppi@seppi.de>

	* tests/refcount/Makefile.am (INCLUDES): Link the the refcount
	tests to the system thread library $(G_THREAD_LIBS). Fixes #313744
	and #314217.
2005-09-11 16:48:38 +00:00
Ross Burton
efa05f88ef Optimise single-character insertions 2005-08-18 09:30:24 +00:00
Manish Singh
12058f15e8 Shut up CVS 2005-08-12 00:07:17 +00:00
Matthias Clasen
320711e224 Add it here.
2005-08-09  Matthias Clasen  <mclasen@redhat.com>

	* tests/gobject/Makefile.am (test_programs): Add it here.

	* tests/gobject/gvalue-test.c: Beginning of a test suite
	for GValue.
2005-08-09 19:20:33 +00:00
Matthias Clasen
717f3d4abb Enable the endianness test.
2005-08-08  Matthias Clasen  <mclasen@redhat.com>

	* tests/convert-test.c: Enable the endianness test.

	* glib/gconvert.c: Make the caching of iconv descriptors
	optional.

	* configure.in: Add an --enable-iconv-cache option, and
	default to disabling iconv caching on new enough glibc.
	Somebody with access to Solaris systems will need to test
	if opening/closing of iconv descriptors is enough of
	a performance problem to warrant the caching on that
	platform. Note that the caching is causing correctness
	problems in some corner cases, thus turning it off
	is desirable unless it has severe performance implications.
2005-08-08 19:50:38 +00:00
Matthias Clasen
81b6a73938 Fix up the testcase 2005-08-08 17:02:33 +00:00
Matthias Clasen
eb37812fbe Add a test for endianness handling.
2005-08-08  Matthias Clasen  <mclasen@redhat.com>

	* tests/convert-test.c: Add a test for
	endianness handling.
2005-08-08 16:48:23 +00:00
Matthias Clasen
308678a613 Add convert-test here.
2005-08-08  Matthias Clasen  <mclasen@redhat.com>

	* tests/Makefile.am: Add convert-test here.

	* tests/convert-test.c: Add the beginning of a testsuite
	for g_convert() and friends.
2005-08-08 05:30:20 +00:00
Manish Singh
f1e1727ce7 remove unused n_threads variable.
2005-08-05  Manish Singh  <yosh@gimp.org>

        * tests/refcount/closures.c: remove unused n_threads variable.
2005-08-06 00:33:49 +00:00
Manish Singh
47f88c486b Shut up CVS 2005-08-06 00:32:33 +00:00
Tor Lillqvist
352a0e6c0b tests/refcount/objects.c tests/refcount/properties.c Use g_usleep()
2005-08-02  Tor Lillqvist  <tml@novell.com>

	* tests/refcount/objects.c
	* tests/refcount/properties.c
	* tests/refcount/signals.c: Use g_usleep() instead of sleep() for
	portability.
2005-08-02 06:55:38 +00:00
Tim Janik
10a3867a6e test high contention on closure reference counts to trigger and catch
Mon Aug  1 23:33:47 2005  Tim Janik  <timj@imendio.com>

        * tests/refcount/closures.c: test high contention on closure
        reference counts to trigger and catch non-atomic updates.

        * tests/refcount/objects.c:
        * tests/refcount/objects2.c:
        * tests/refcount/properties.c:
        * tests/refcount/properties2.c:
        * tests/refcount/signals.c:
        fixed up test and threading fundamentals. variables accessed from all
        threads need to be volatile. context switches are enforced by using
        g_thread_yield(), not g_usleep(1) which may result in busy waits on
        some platforms. for testcode, always consider all warnings and
        critical messages fatal. issue the currently running program on
        stdout. improved progress indicators.

        * tests/refcount/properties.c:
        * tests/refcount/objects.c:
        don't overdo the number of testing threads to keep the testing machine
        usable, 2 threads can produce as much contention as 20 if executing the
        same code.

        * tests/refcount/signals.c: only start 1 thread per object. GObject
        doesn't provide mutually exclusive object access, but only mutually
        exclusive reference count modification.

        * tests/Makefile.am: added closures test.
2005-08-01 21:47:15 +00:00
Tor Lillqvist
7787e71d8b Minor simplification in safe_strcmp_filename(). 2005-08-01 19:25:37 +00:00
Tor Lillqvist
7aa2e37f5e Ugh, fix braino. 2005-08-01 19:23:10 +00:00
Tor Lillqvist
d5a989875b Make it pass on Win32. (from_uri_tests[]): Take into consideration that on
2005-08-01  Tor Lillqvist  <tml@novell.com>

	* tests/uri-test.c: Make it pass on Win32.
	(from_uri_tests[]): Take into consideration that on Win32 we don't
	return "localhost" hostnames.
	(safe_strcmp_filename): New function that considers slash and
	backslash equal on Win32.
	(run_roundtrip_tests): Use safe_strcmp_filename().
2005-08-01 19:17:35 +00:00
Manish Singh
6394b31435 use G_CALLBACK for signal connections.
2005-07-20  Manish Singh  <yosh@gimp.org>

        * tests/refcount/signals.c: use G_CALLBACK for signal connections.
2005-07-20 20:46:58 +00:00
Manish Singh
f4bc0cb520 Shut up CVS 2005-07-20 20:44:28 +00:00
Matthias Clasen
8ac11176ab Don't get stuck in here if immediate is TRUE. (#310954, Hong Jen Yee)
2005-07-20  Matthias Clasen  <mclasen@redhat.com>

	* glib/gthreadpool.c (g_thread_pool_free): Don't get
	stuck in here if immediate is TRUE.  (#310954,
	Hong Jen Yee)

	* tests/threadpool-test.c (main): Test immediate == TRUE.
2005-07-20 17:06:02 +00:00
Matthias Clasen
39ea11ce6b Make refcounting threadsafe by using atomic operations. (#166020, Wim
2005-07-15  Matthias Clasen  <mclasen@redhat.com>

	Make refcounting threadsafe by using atomic
	operations.  (#166020, Wim Taymans)

	* gobject.c: Use a recursive lock to protect the
	notify queue.
	(g_object_unref): Get rid of g_object_last_unref and
	do the last unref handling in g_object_unref.
	(g_object_ref, g_object_unref): Use atomic operations.

	* gsignal.c (struct _HandlerMatch): Use a full integer
	for the ref_count field.
	(handler_ref, handler_unref_R): Use atomic operations.

	* gparam.c (g_param_spec_ref, g_param_spec_unref):
	Use atomic operations instead of a lock to make the
	refcounting threadsafe.

	* gclosure.c (g_closure_ref, g_closure_unref): Use atomic
	operations. This is more complicated here, since the
	refcount is stored in a bitfield, so we also have
	to access all other bitfield members atomically.

	* gsignal.c (handlers_find): Read the meta_marshal flag
	of the closure atomically.

	* tests/Makefile.am (SUBDIRS): Add tests/refcount

	* configure.in: Add tests/refcount

	* tests/refcount/properties.c: Test property changes
	from multiple threads.

	* tests/refcount/signals.c: Test signal emission from
	multiple threads.

	* tests/refcount/objects.c: Test refcounting from
	multiple threads.

	* tests/refcount/objects2.c:
	* tests/refcount/properties2.c: Tests to measure the
	overhead of threadsafe refcounting.

	* glib/giochannel.c (g_io_channel_ref, g_io_channel_unref):
	Use atomic operations to make refcounting
	threadsafe.  (#166020, Wim Taymans)
2005-07-15 16:51:10 +00:00
Matthias Clasen
7221f500f5 Make the tests silent on success.
2005-07-14  Matthias Clasen  <mclasen@redhat.com>

	* tests/spawn-test.c:
	* tests/uri-test.c:
	* tests/thread-test.c:
	* tests/queue-test.c:
	* tests/mainloop-test.c:
	* tests/iochannel-test.c:
	* tests/gio-test.c:
	* tests/child-test.c: Make the tests silent on success.
2005-07-14 05:20:14 +00:00
Matthias Clasen
58dd4814b2 Add and implement a new flag to turn off the automatic <groupname>-
2005-07-12  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.h (G_OPTION_FLAG_NOALIAS):
	* glib/goption.c: Add and implement a new flag
	to turn off the automatic <groupname>- prefixing
	for conflict resolution of long option names. (#171840,
	Adam McLaurin)

	All optional callback arguments  (#308886, Pawel
	Sliwowski)

	* glib/goption.h (G_OPTION_FLAG_OPTIONAL_ARG):
	* glib/goption.c: Add and implement a new flag
	to indicate that a callback *optionally* takes another
	argument.

	* tests/option-test.c: Add tests for optional arguments.
2005-07-12 18:56:25 +00:00
Matthias Clasen
9d6e10125b Don't reverse the order of multiline comments.
2005-07-01  Matthias Clasen  <mclasen@redhat.com>

	* glib/gkeyfile.c (g_key_file_get_key_comment):
	(g_key_file_get_top_comment): Don't reverse the order of multiline
	comments.
	(g_key_file_get_group_comment): Actually get the group comment.

	* tests/keyfile-test.c (test_comments): Test that comments are
	handled properly.  (#309263, Mikael Magnusson)
2005-07-01 18:54:25 +00:00
Matthias Clasen
61b7337092 Test that comments are handled properly. (#309263, Mikael Magnusson)
2005-07-01  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_comments): Test that comments are
	handled properly.  (#309263, Mikael Magnusson)
2005-07-01 15:56:03 +00:00
Matthias Clasen
399b0456ce 2.7.1 2005-06-30 21:01:58 +00:00
Manish Singh
31ce06c550 Shut up CVS 2005-06-27 21:18:38 +00:00
Tor Lillqvist
ef48ce636b libtool installs/uninstalls the import library, no need to do it
2005-06-26  Tor Lillqvist  <tml@novell.com>

	* glib/Makefile.am: libtool installs/uninstalls the import
	library, no need to do it ourselves. Do still install/uninstall
	the .def file, though.

	* glib/gmappedfile.c: Add Win32 implementation.
	(g_mapped_file_free): Don't mention writable shared mappings in
	the doc comment. Free the GMappedFile struct.

	* tests/mapping-test.c (main): No kill() or SIGUSR1 on Win32, use
	a flag file instead to stop the child. Use g_usleep() instead of
	sleep().
2005-06-26 18:04:08 +00:00
Matthias Clasen
748c230205 Add an mmap() wrapper called GMappedFile. (#148218, David Schleef, Behdad
2005-06-24  Matthias Clasen  <mclasen@redhat.com>

	Add an mmap() wrapper called GMappedFile. (#148218,
	David Schleef, Behdad Esfahbod)

	* glib/gmappedfile.[hc]: New files.

	* configure.in: Check for mmap.

	* glib/Makefile.am: Add new files.

	* glib/glib.symbols: Add new functions.

	* glib/glib.h: Include gmappedfile.h

	* tests/mapping-test.c: Tests for GMappedFile.

	* tests/Makefile.am: Add new file.
2005-06-25 03:38:32 +00:00
Matthias Clasen
58f83683e9 Don't leak memory here.
2005-06-23  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_group_remove): Don't leak
	memory here.

	* glib/gkeyfile.c (g_key_file_load_from_data_dirs): Don't
	leak output_path.  (#308546, Kjartan Maraas)
2005-06-23 16:28:55 +00:00
Matthias Clasen
a6312099c7 Add some language-binding friendly variants 2005-06-23 05:50:53 +00:00
Tor Lillqvist
b8c119f901 glib/gfileutils.c glib/gfileutils.h glib/glib.symbols Rename g_makepath()
2005-06-22  Tor Lillqvist  <tml@novell.com>

	* glib/gfileutils.c
	* glib/gfileutils.h
	* glib/glib.symbols
	* tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
2005-06-22 18:55:33 +00:00
Tor Lillqvist
1833a93ddd New function. Creates a directory including intermediate parent
2005-06-22  Tor Lillqvist  <tml@novell.com>

	* glib/gfileutils.c (g_makepath): New function. Creates a
	directory including intermediate parent directories as
	needed. (#60509)

	* glib/gfileutils.h: Declare it.

	* glib/glib.symbols: Add it.

	* tests/testglib.c: Test it.
2005-06-22 09:43:37 +00:00
Tor Lillqvist
477989f555 New function. Returns the machine's name, or one of its names. Document
2005-06-22  Tor Lillqvist  <tml@novell.com>

	* glib/gutils.c (g_get_host_name): New function. Returns the
	machine's name, or one of its names. Document that it is
	best-effort only, and not guaranteed to be unique or anything.
	(g_get_any_init): Get the host name here. On Unix use
	gethostname(), on Windows use GetComputerName(). (#5200)

	* glib/gutils.h
	* glib/glib.symbols: Add here, too.

	* tests/testglib.c: Test it.
2005-06-22 08:54:28 +00:00
Matthias Clasen
3a7a096682 Add G_OPTION_FLAG_NO_ARG and G_OPTION_FLAG_FILENAME to allow greater
2005-06-18  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.h:
	* glib/goption.c: Add G_OPTION_FLAG_NO_ARG and
	G_OPTION_FLAG_FILENAME to allow greater control of
	G_OPTION_ARG_CALLBACK options. (#302632, Dan Winship)

	* tests/option-test.c: test callback args
2005-06-18 04:55:26 +00:00
Matthias Clasen
604ad5fa3d 2.7.0 2005-06-10 15:48:25 +00:00
Matthias Clasen
4c4f106344 Return an error if an option is missing its argument. (#305576, Björn
2005-05-27  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.c (parse_short_option, parse_long_option):
	Return an error if an option is missing its argument.  (#305576,
	Björn Lindqvist)

	* tests/option-test.c (missing_arg_test): Add a testcase.
2005-05-27 18:30:34 +00:00
Matthias Clasen
0c04a92b2b Check the return values of g_tree_remove().
2005-05-17  Matthias Clasen  <mclasen@redhat.com>

	* tests/tree-test.c (main): Check the return values of
	g_tree_remove().

	* glib/gtree.c (g_tree_remove, g_tree_steal): Return
	a boolean indicating wether the key was found.  (#302545,
	Matthew F. Barnes)
2005-05-17 15:33:36 +00:00
Manish Singh
645cd59cb8 Shut up CVS 2005-05-09 18:21:02 +00:00
Matthias Clasen
6e60dd8489 Add a testcase.
2005-05-06  Matthias Clasen  <mclasen@redhat.com>

	* tests/option-test.c: Add a testcase.

	* glib/goption.c (g_option_context_parse): Treat '-'
	on its own as a non-option argument.  (#168008, Tim Musson,
	Thomas Leonard and others)
2005-05-06 20:10:52 +00:00
Owen Taylor
2ae1a46b4c Add g_object_add/remove_toggle_ref() functions to get notification when a
2005-05-05  Owen Taylor  <otaylor@redhat.com>

        * gobject.[ch] gobject.symbols: Add
        g_object_add/remove_toggle_ref() functions to get notification
        when a reference count is the last remaining reference; this
        enables better memory management for language bindings.
        (http://mail.gnome.org/archives/gtk-devel-list/2005-April/msg00095.html)

2005-05-05  Owen Taylor  <otaylor@redhat.com>

        * glib/gdataset.[ch] glib/gdatasetprivate.h: Add
        g_datalist_set/unset_flags(), g_datalist_get_flags() functions
        to squeeze some bits into a GDataSet... this is needed for
        efficient implementation of toggle references in GObject.

        * tests/gobject/references.c tests/gobject/Makefile.am:
        Add a test case for weak and toggle references.

        * glib/gfileutils.[ch]: Rename g_file_replace() back
        to g_file_set_contents().

        * glib/glib.symbols: Update.

2005-05-05  Owen Taylor  <otaylor@redhat.com>

        * glib/Makefile.am glib/glib-sections.txt gobject/gobject-sections.txt:
        Update

        * gobject/tmpl/objects.sgml: Document toggle-references.
2005-05-05 14:57:29 +00:00
Matthias Clasen
8e9a4d50df Add tests for g_date_get_iso8601_week_of_year().
2005-03-28  Matthias Clasen  <mclasen@redhat.com>

	* tests/date-test.c:
	* tests/testgdate.c: Add tests for
	g_date_get_iso8601_week_of_year().

	* glib/gdate.c (g_date_get_iso8601_week_of_year):
	Fix the calculation.  (#169858, Jon-Kare Hellan)
2005-03-28 05:22:56 +00:00
Tor Lillqvist
446c1f1aa8 Minor printout change, now identical as in glib-2-6 branch. 2005-03-20 20:08:23 +00:00
Tor Lillqvist
20378332ae Print more detailled output from the timer tests. Don't print home
2005-03-20  Tor Lillqvist  <tml@novell.com>

	* tests/testglib.c (main): Print more detailled output from the
	timer tests. Don't print home directory twice. Test
	g_win32_error_message().

	* tests/spawn-test.c (run_tests): On Win32, run netstat instead of
	ipconfig. On Windows XP collecting output from ipconfig doesn't
	seem to work for some reason.
2005-03-20 10:43:38 +00:00
Manish Singh
a145c9ed09 delete a bunch of dead code.
Sun Mar 13 22:01:17 2005  Manish Singh  <yosh@gimp.org>

        * tests/array-test.c: delete a bunch of dead code.
2005-03-14 06:01:51 +00:00
Sven Neumann
420410f035 include <gstdio.h>.
2005-03-10  Sven Neumann  <sven@gimp.org>

	* tests/file-test.c: include <gstdio.h>.
2005-03-10 17:12:35 +00:00
Sven Neumann
aec8923fa6 delay memory allocation until after the first read. Saves a bunch of
2005-03-10  Sven Neumann  <sven@gimp.org>

	* glib/gfileutils.c (get_contents_stdio): delay memory allocation
	until after the first read. Saves a bunch of reallocs. Also
	increased the buffer size to 4096 bytes. (bug #165954)

	* tests/file-test.c (test_get_contents): added a (very basic) test
	for g_file_get_contents().
2005-03-10 12:56:01 +00:00
Matthias Clasen
db0d5b6b61 Set LANGUAGE instead of LC_ALL to shield against LANGUAGE being set in the
2005-02-23  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_locale_string): Set LANGUAGE
	instead of LC_ALL to shield against LANGUAGE being set in
	the environment.  (#168311, Suren A. Chilingaryan)
2005-02-24 03:54:42 +00:00
Matthias Clasen
348da88e27 Don't write out of bounds.
2005-02-08  Matthias Clasen  <mclasen@redhat.com>

	* glib/gkeyfile.c (g_key_file_parse_value_as_string): Don't
	write out of bounds.

	* glib/goption.c (g_option_context_parse): Fix a
	one-too-short memory allocation.  (#166609, Nicolas Laurent)

	* tests/Makefile.am (TESTS_ENVIRONMENT): Add tests with
	MALLOC_CHECK_.

	* tests/option-test.c: Add a test for unkown short options.
2005-02-08 15:14:31 +00:00
Matthias Clasen
4a2773ee7b Add test case for key removal.
2005-02-01  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_key_remove): Add test case for
	key removal.

	* glib/gkeyfile.c (g_key_file_remove_key): Actually remove
	the key from the list of pairs.  (#165980, David Hoover)
2005-02-02 03:25:00 +00:00
Matthias Clasen
df59e8e19b Add test case for group removal.
2005-02-01  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_group_remove): Add test case for
	group removal.

	* glib/gkeyfile.c (g_key_file_remove_group): Don't segfault
	if the group doesn't exist.  (#165887, Mathias Hasselmann)
2005-02-01 14:10:46 +00:00
Matthias Clasen
396253b84d Some more unit tests.
2005-01-30  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c: Some more unit tests.
2005-01-30 06:33:10 +00:00
Matthias Clasen
5d549e5bdb Let $srcdir default to .
2005-01-24  Matthias Clasen  <mclasen@redhat.com>

	* tests/run-markup-tests.sh: Let $srcdir default to .
2005-01-24 17:35:44 +00:00
Matthias Clasen
39a681995c Add a test with a long entity name.
2005-01-24  Matthias Clasen  <mclasen@redhat.com>

	* tests/markups/fail-40.gmarkup: Add a test with a long entity
	name.

	* glib/gmarkup.c (unescape_text_state_inside_entity_name): Don't
	copy the entity name into a short buffer of fixed length. Instead,
	compare it in place with strncmp(), and do a full strdup() in the
	error path.  (#165100, Simon Budig)
2005-01-24 17:25:37 +00:00
Manish Singh
c9d1c167f4 Shut up cvs 2005-01-21 23:28:48 +00:00
Matthias Clasen
3db329a613 Don't interpret leading zeros as octal. The specification requires %f
2005-01-20  Matthias Clasen  <mclasen@redhat.com>

	* glib/gkeyfile.c (g_key_file_parse_value_as_integer): Don't
	interpret leading zeros as octal. The specification requires
	%f parsing, and %f doesn't allow octal.

	* tests/keyfile-test.c: Add some more tests.
2005-01-20 17:16:47 +00:00
Matthias Clasen
9775edea89 Add some more tests.
2005-01-20  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c: Add some more tests.

	* glib/gkeyfile.c (g_key_file_get_keys): Return keys in
	the order found in the file, rather than the opposite.
	(g_key_file_parse_value_as_string): Fix error reporting.
2005-01-20 15:31:55 +00:00
Matthias Clasen
92a710ba28 Accept \r\n as line end. (#163030, Bastian Nocera)
2005-01-19  Matthias Clasen  <mclasen@redhat.com>

	* glib/gkeyfile.c (g_key_file_parse_data): Accept \r\n as
	line end.  (#163030, Bastian Nocera)
	(g_key_file_load_from_data): Make -1 work as a size.

	* tests/keyfile-test.c: Some unit tests for the keyfile
	parser.

	* tests/Makefile.am (test_programs): Add keyfile-test.
2005-01-19 14:14:27 +00:00
Matthias Clasen
9d8c5bc757 Add some tests for '--' stripping.
2004-12-20  Matthias Clasen  <mclasen@redhat.com>

	* tests/option-test.c: Add some tests for '--'
	stripping.

	* glib/goption.c (g_option_context_parse): Don't
	strip '--' if it would be needed by a second option
	parser.  (#161701)
2004-12-20 21:09:16 +00:00
Manish Singh
131f4c67fb filter G_GNUC before PRIVATE so $ is still true.
Sun Nov 28 13:13:56 2004  Manish Singh  <yosh@gimp.org>

        * glib/abicheck.sh: filter G_GNUC before PRIVATE so $ is still true.

        * tests/utf8-validate.c: cast pointer math to gint for error print
        message.
2004-11-28 21:21:14 +00:00
Manish Singh
adde534014 minor comment fix.
Sun Nov 28 12:07:29 2004  Manish Singh  <yosh@gimp.org>

        * tests/utf8-validate.c: minor comment fix.
2004-11-28 20:08:14 +00:00
Manish Singh
b90a0582ed Shut up cvs 2004-11-27 23:14:18 +00:00
Matthias Clasen
6b69bf8866 Add a testcase for the previous fix.
2004-11-25  Matthias Clasen  <mclasen@redhat.com>

	* tests/strtod-test.c (main): Add a testcase for the previous fix.

	* glib/gstrfuncs.c (g_ascii_strtod): Make it work again for floats
	starting with a decimal point, like .75  (#156421, Hans Breuer)
2004-11-26 04:40:41 +00:00
Matthias Clasen
b8d9e050a4 Add utf8-validate.
2004-11-24  Matthias Clasen  <mclasen@redhat.com>

	* tests/Makefile.am (test_programs): Add utf8-validate.

	* tests/utf8-validate.c: Unit tests for g_utf8_validate().
2004-11-24 15:54:20 +00:00
Matthias Clasen
8bad5bfa3b Portability fixes and extra sanity checks. (#157453, Morten Welinder)
2004-11-05  Matthias Clasen  <mclasen@redhat.com>

	* tests/strtod-test.c: Portability fixes and extra sanity
	checks.  (#157453, Morten Welinder)
2004-11-05 16:09:02 +00:00
Matthias Clasen
c92fb33b42 Handle numbers like 1e1, nan, -infinity. Also try harder to preserve
2004-11-04  Matthias Clasen  <mclasen@redhat.com>

	* glib/gstrfuncs.c (g_ascii_strtod): Handle numbers like
	1e1, nan, -infinity. Also try harder to preserve errno.
	(#156421, Morten Welinder)

	* tests/strtod-test.c: Add testcases.
2004-11-05 03:21:24 +00:00
Matthias Clasen
286d84fcb0 glib/gdebug.h glib/gutils.c gobject/gtype.c gthread/gthread-posix.c
2004-11-01  Matthias Clasen  <mclasen@redhat.com>

	* glib/gconvert.c:
	* glib/gdebug.h
	* glib/gutils.c
	* gobject/gtype.c
	* gthread/gthread-posix.c
	* tests/timeloop-closure.c
	* tests/timeloop.c: Fix sparse warnings.  (#157014, Kjartan Maraas)
2004-11-01 18:47:12 +00:00
Matthias Clasen
a9fa61a13e Add tests for the handling of non-option arguments, "--" and
2004-10-29  Matthias Clasen  <mclasen@redhat.com>

	* tests/option-test.c: Add tests for the handling of
	non-option arguments, "--" and G_OPTION_REMAINING.

	* glib/goption.[hc]: #define G_OPTION_REMAINING, which is
	a special long option name, which can be used for an option
	in the main group which collects the non-option arguments.
	It must be of type G_OPTION_ARG_STRING_ARRAY or
	G_OPTION_ARG_FILENAME_ARRAY. If the main group doesn't contain
	an option whose name is G_OPTION_REMAINING, the non-option
	arguments are left behind in argv as before.
2004-10-29 20:19:06 +00:00
Matthias Clasen
491732c99d Improve error reporting.
2004-10-26  Matthias Clasen  <mclasen@redhat.com>

	* tests/strtod-test.c (test_string): Improve error reporting.
2004-10-26 04:16:02 +00:00
Manish Singh
5c38cfa58d rm autom4te.cache, since it might interfere with differing autoconf
Mon Oct 25 15:05:18 2004  Manish Singh  <yosh@gimp.org>

        * autogen.sh: rm autom4te.cache, since it might interfere with
        differing autoconf versions.

        * tests/child-test.c: use GINT_TO_POINTER for g_child_watch_add
        user data.

        * glib/gfileutils.c: G_IS_DIR_SEPARATOR is defined in gutils.h now,
        don't redefine it here.
2004-10-25 22:08:37 +00:00
Matthias Clasen
8df27c8dd5 Add some uri list tests.c.
2004-10-22  Matthias Clasen  <mclasen@redhat.com>

	* tests/uri-test.c (run_uri_list_tests): Add some
	uri list tests.c.

	* glib/gconvert.h:
	* glib/gconvert.c (g_uri_list_extract_uris): New function to
	split a text/uri-list data into individual uris and strip comments.
2004-10-22 19:51:29 +00:00
Anders Carlsson
9af2838a91 Add check for if argc is 0.
2004-10-05  Anders Carlsson  <andersca@gnome.org>

	* glib/goption.c: (g_option_context_parse):
	Add check for if argc is 0.

	* tests/option-test.c: (empty_test3), (main):
	Add test case.
2004-10-05 20:04:18 +00:00
Anders Carlsson
a515025dee Set arg_data on filenames. (Discovered by Mats-Ola Persson).
2004-10-03  Anders Carlsson  <andersca@gnome.org>

	* glib/goption.c: (parse_arg):
	Set arg_data on filenames. (Discovered by Mats-Ola Persson).

	* tests/option-test.c: (arg_test3), (ignore_test3), (main):
	Add test for filename args.
2004-10-03 19:34:19 +00:00
Matthias Clasen
6aad158c67 Don't call g_set_error () with a NULL format. (#153103, Robert Ögren)
Mon Sep 20 00:17:37 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/option-test.c (error_test3_post_parse):
	* tests/option-test.c (error_test2_post_parse):
	* tests/option-test.c (error_test1_post_parse): Don't call
	g_set_error () with a NULL format.  (#153103, Robert Ögren)
2004-09-20 04:18:40 +00:00
Matthias Clasen
08fe920a50 Make GOption remove long options completely. (#153113, Robert Ögren)
Mon Sep 20 00:13:48 2004  Matthias Clasen  <maclas@gmx.de>

	Make GOption remove long options completely. (#153113, Robert Ögren)

	* glib/goption.c (parse_long_option): Fix a wrong index.

	* tests/option-test.c (ignore_test3): Test handling of unknown
	options some more.
2004-09-20 04:15:38 +00:00
Matthias Clasen
6ec4724399 Add a function to calculate the length of a NULL-terminated string array.
Thu Sep  9 00:10:40 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gstrfuncs.h:
	* glib/gstrfuncs.c (g_strv_length): Add a function to
	calculate the length of a NULL-terminated string
	array.  (#150455, Tim-Philipp Müller)

	* tests/strfunc-test.c (main): Add a test for g_strv_length().
2004-09-09 04:12:19 +00:00
Matthias Clasen
d209e108b1 Add a function to return a list of applicable locale names. (#95587,
2004-09-07  Matthias Clasen  <mclasen@redhat.com>

	* glib/gutils.h:
	* glib/gutils.c (g_get_language_names): Add a function to
	return a list of applicable locale names.  (#95587,
	Hidetoshi Tajima)
	(guess_category_value, compute_locale_variants):
	(explode_locale, unalias_lang, read_aliases): Helper
	functions for g_get_language_names()

	* tests/testglib.c (main): Show the results of
	g_get_language_names()
2004-09-07 18:37:10 +00:00
Anders Carlsson
338d949559 Handle option contexts without a main group.
2004-09-01  Anders Carlsson  <andersca@gnome.org>

	* glib/goption.c: (g_option_context_free), (print_help),
	(g_option_context_parse):
	Handle option contexts without a main group.

	* tests/option-test.c: (empty_test2), (main):
	Add test case for that.
2004-09-01 17:31:43 +00:00
Anders Carlsson
11957cabec Set prgname to <unknown> if argc and argv are NULL.
2004-08-30  Anders Carlsson  <andersca@gnome.org>

	* glib/goption.c: (g_option_context_parse):
	Set prgname to <unknown> if argc and argv are NULL.

	* tests/option-test.c: (empty_test1), (main):
	Add test case for that.
2004-08-30 20:40:52 +00:00
Tor Lillqvist
b359dbbf5e Test the new XDG basedir functions.
2004-08-26  Tor Lillqvist  <tml@iki.fi>

	* tests/testglib.c (main): Test the new XDG basedir functions.
2004-08-26 00:08:46 +00:00
Anders Carlsson
deee47edfd Add GOption.
2004-08-02  Anders Carlsson  <andersca@gnome.org>

	* glib/Makefile.am:
	* glib/glib.h:
	* glib/goption.c:
	* glib/goption.h:
	* tests/.cvsignore:
	* tests/Makefile.am:
	* tests/option-test.c:
	Add GOption.
2004-08-02 21:40:40 +00:00
Manish Singh
b54cccf6a8 move newline printing from run_from_uri_tests() to run_roundtrip_tests().
Sun Aug  1 13:19:18 2004  Manish Singh  <yosh@gimp.org>

        * tests/uri-test.c: move newline printing from run_from_uri_tests()
        to run_roundtrip_tests().
2004-08-01 20:21:02 +00:00
Matthias Clasen
d2c7108828 Include a test involving consecutive backslashes followed by a non-escaped
Sat Jul 31 20:33:07 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/shell-test.c: Include a test involving consecutive
	backslashes followed by a non-escaped doublequote.

	* glib/gshell.c (tokenize_command_line): Count consecutive
	backslashes mod 2 to detect escaped doubleqotes.  (#127306)
2004-08-01 00:39:45 +00:00
Matthias Clasen
0611985dd9 Don't validate for UTF-8 here. (#148420, Robert Ögren)
2004-07-30  Matthias Clasen  <mclasen@redhat.com>

	* glib/gconvert.c (g_unescape_uri_string): Don't validate
	for UTF-8 here.  (#148420, Robert Ögren)

	* tests/uri-test.c (run_roundtrip_tests): Add tests for
	roundtrip compatibility. Going from filename to uri and
	back should always give you the same filename back.
2004-07-30 19:00:01 +00:00
Matthias Clasen
889096b1ea Tests for handling of whitespace inside tags.
2004-07-28  Matthias Clasen  <mclasen@redhat.com>

	* tests/markups/valid-{9,10,11}.gmarkup:
	* tests/markups/fail-{37,38,39}.gmarkup: Tests for handling
	of whitespace inside tags.

	* glib/gmarkup.c (enum GMarkupParseState): Add
	STATE_AFTER_ATTRIBUTE_NAME and STATE_AFTER_CLOSE_TAG_NAME.
	(g_markup_parse_context_parse): Accept whitespace between
	attribute names, '=' and attribute values and between
	close tag name and '>'. (#148646, Hiroyuki Ikezoe)
2004-07-28 15:00:59 +00:00
Matthias Clasen
f5a8ae228a Fix docs for G_MAXSIZE. (#148262, Christophe Fergeau)
Fri Jul 23 10:38:24 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/tmpl/limits.sgml: Fix docs for G_MAXSIZE.  (#148262,
	Christophe Fergeau)
2004-07-23 14:39:25 +00:00
Matthias Clasen
9bee4171bc Actually set any_failed on failure. (#143552, Philippe Blain)
Thu Jun 10 23:38:02 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/printf-test.c (TEST): Actually set any_failed on
	failure.  (#143552, Philippe Blain)
2004-06-11 03:45:54 +00:00
Federico Mena Quintero
ff8ade82ff Fix expected results (ha ha) for URIs that *should* have been invalid, or
2004-06-09  Federico Mena Quintero  <federico@ximian.com>

	* tests/uri-test.c (to_uri_tests): Fix expected results (ha ha)
	for URIs that *should* have been invalid, or viceversa.
	(from_uri_tests): Likewise.
2004-06-10 00:17:57 +00:00
Matthias Clasen
6c195ce130 Make "make check" less noisy. 2004-06-08 02:29:16 +00:00
Tor Lillqvist
267009b913 Handle empty digit string for precision correctly. (#142400)
2004-05-14  Tor Lillqvist  <tml@iki.fi>

	* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string
	for precision correctly. (#142400)

	For backward compatibility with the Trio implementation, make "ll"
	format modifer work on Win32, too. Change into "I64" before
	passing to the system printf. (#142433)

	* tests/printf-test.c (main): Add tests for the above.
2004-05-14 04:58:19 +00:00
Matthias Clasen
48deca6379 Trivial warning fix.
2004-04-22  Matthias Clasen  <mclasen@redhat.com>

	* tests/testglib.c (main): Trivial warning fix.
2004-04-22 20:58:37 +00:00
Matthias Clasen
2efb5e1cd8 Add some tests for off-by-one errors.
2004-04-22  Matthias Clasen  <mclasen@redhat.com>

	* tests/queue-test.c (main): Add some tests for off-by-one errors.

	* glib/gqueue.c (g_queue_pop_nth_link): Fix an off-by-one
	error.  (#139703, Philippe Blain)
2004-04-22 20:51:07 +00:00
Matthias Clasen
05501852ec Add testcases for g_message() involving non-printable and unsafe
2004-04-22  Matthias Clasen  <mclasen@redhat.com>

	* tests/testglib.c (main): Add testcases for g_message() involving
	non-printable and unsafe characters.

	* glib/gmessages.c (escape_string): Don't assume that
	string->str remains unchanged over g_string_insert()
	calls.  (#139030, Christophe Saout)
2004-04-22 20:17:54 +00:00
Matthias Clasen
d7af9f1a48 Fix problems when a locale-specific decimal separator directly follows a
2004-04-22  Matthias Clasen  <mclasen@redhat.com>

	* glib/gstrfuncs.c (g_ascii_strtod): Fix problems when a
	locale-specific decimal separator directly follows a
	number.  (#138424, Nickolay V. Shmyrev)

	* tests/strtod-test.c (main): Add some more testcases.
2004-04-22 15:51:16 +00:00
Matthias Clasen
b65c56ffd6 Comment out a nonessential testcase which fails on HP-UX. (#136283, Jonas
2004-04-21  Matthias Clasen  <mclasen@redhat.com>

	* tests/printf-test.c (main): Comment out a nonessential testcase
	which fails on HP-UX.  (#136283, Jonas Jonsson)
2004-04-21 18:56:48 +00:00
Matthias Clasen
f4d9fcd8d4 Add tests for the empty pattern.
2004-04-15  Matthias Clasen  <mclasen@redhat.com>

	* tests/patterntest.c (main): Add tests for the empty pattern.

	* glib/gpattern.c (g_pattern_spec_new): Don't read and write out
	of bounds when the pattern is empty.  (#140032, Stanislav Brabec,
	Stefan Fent)
2004-04-15 13:58:29 +00:00
Tor Lillqvist
9b4080611a glib/giowin32.c glib/gmain.c glib/gstrfuncs.c Decorating variable
2004-04-10  Tor Lillqvist  <tml@iki.fi>

	* glib/giowin32.c
	* glib/gmain.c
	* glib/gstrfuncs.c
	* glib/gthread.c: Decorating variable definitions with
	__declspec(dllexport) causes problems on Cygwin build, and isn't
	really needed for a native Win32 build with mingw or MSVC, so
	remove. (#138402, Roger Leigh)

	* glib/libcharset/localcharset.c: Use Win32-specific code also on
	Cygwin.
	* tests/uri-test.c: Don't assume that local filenames are in UTF-8
	on Cygwin, either. (#138412, Roger Leigh)
2004-04-10 01:55:57 +00:00
Tor Lillqvist
1edf67c272 Use UTF-16LE explicitly also on Cygwin. (#138423, Roger Leigh)
2004-03-31  Tor Lillqvist  <tml@iki.fi>

	* tests/unicode-encoding.c (process): Use UTF-16LE explicitly also
	on Cygwin. (#138423, Roger Leigh)
2004-03-31 02:19:10 +00:00
Tor Lillqvist
7f38edf367 Minor Cygwin fix. (#138405, Roger Leigh)
2004-03-31  Tor Lillqvist  <tml@iki.fi>

	* tests/spawn-test-win32-gui.c: Minor Cygwin fix. (#138405, Roger
	Leigh)
2004-03-31 02:13:52 +00:00
Tor Lillqvist
421e7fdfad Fix Win32 behaviour in some cases where a drive letter is present. For
2004-03-21  Tor Lillqvist  <tml@iki.fi>

	* glib/gutils.c (g_path_get_dirname): Fix Win32 behaviour in some
	cases where a drive letter is present. For 'a:' or 'a:foo', return
	'a:.'. This is mostly just for consistency with the behaviour
	without a drive letter. But very important is to for 'a:\foo' or
	'a:\', return 'a:\', and not 'a:'. (Ditto for forward slashes
	instead of backslashes.) (#137316)

	* tests/dirname-test.c (main): More complete testing on
	Win32. If a test fails, include expected and actual result in
	error message.
2004-03-21 21:43:13 +00:00
Owen Taylor
974dbaef86 Make computation of "biggest_pointer" vaguely more portable. (#137498,
Fri Mar 19 11:07:06 2004  Owen Taylor  <otaylor@redhat.com>

        * tests/atomic-test.c (main): Make computation
        of "biggest_pointer" vaguely more portable.
        (#137498, Jonas Jonsson)
2004-03-19 16:13:37 +00:00
Owen Taylor
db17e65ba3 Remove critical log handler; we can't trigger g_return_if_fails() in our
Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>

        * tests/env-test.c (main): Remove critical log handler;
        we can't trigger g_return_if_fails() in our test suite
        even silently, because the user could have compiled
        with --disable-debug. #if 0 the tests for
        g_setenv/g_unsetenv with a "foo=bar" variable name.
        (#136709, reported by Frédéric L. W. Meunier)
2004-03-14 04:27:26 +00:00
Tor Lillqvist
f4cb22c78d glib/gspawn-win32.c Implement G_SPAWN_FILE_AND_ARGV_ZERO. (#136792, Bruce
2004-03-10  Tor Lillqvist  <tml@iki.fi>

	* glib/gspawn-win32.c
	* glib/gspawn-win32-helper.c: Implement
	G_SPAWN_FILE_AND_ARGV_ZERO. (#136792, Bruce Hochstetler)

	* tests/spawn-test.c
	* tests/spawn-test-win32-gui.c: Test it.
2004-03-10 22:59:14 +00:00
Sebastian Wilhelmi
5f487e3647 Do not run the g_child_watch_* test multi-threaded, as that doesn't work
2004-03-09  Sebastian Wilhelmi  <seppi@seppi.de>

	* tests/child-test.c: Do not run the g_child_watch_* test
	multi-threaded, as that doesn't work on linux prior 2.6. Fixes
	#136539.
2004-03-09 00:12:36 +00:00
Tor Lillqvist
fd64571b80 Update.
2004-03-06  Tor Lillqvist  <tml@iki.fi>

	* README.win32: Update.

	* configure.in
	* Makefile.am
	* */Makefile.am: Drop the hand-written makefile.mingw(.in)
	files. They haven't been maintained in a long time. As several
	people have managed to build GLib for Win32 using the
	autoconfiscation mechanism, there is no real reason to even try to
	maintain the hand-written mingw makefiles.
2004-03-06 07:37:46 +00:00
Tor Lillqvist
aa5764107d Use a macro GPID_FORMAT for the format to print GPid in (%p on Win32, %d
2004-03-03  Tor Lillqvist  <tml@iki.fi>

	* tests/child-test.c: Use a macro GPID_FORMAT for the format to
	print GPid in (%p on Win32, %d on Unix). Maybe configure.in should
	place that in glibconfig.h?

	Print verbose error message if CreateProcess() fails.

	Don't close the child handle until in the child watch callback.

	Don't try to run /bin/true on Win32. Run ipconfig instead (just to
	pick a program that should exist on all Window boxes).
2004-03-03 09:49:39 +00:00
Owen Taylor
109ebb109a === Released 2.3.5 ===
Mon Mar  1 16:49:51 2004  Owen Taylor  <otaylor@redhat.com>

        * === Released 2.3.5 ===

        * configure.in: Version 2.3.5, interface ago 0.

        * NEWS: Some further updates.
2004-03-02 00:05:36 +00:00
Owen Taylor
38cbfaeb7a Patch from J. Ali Harlow
Mon Mar  1 15:39:57 2004  Owen Taylor  <otaylor@redhat.com>

       Patch from J. Ali Harlow

        * configure.in: Use void * not HANDLE for GPid on win32.

        * glib/gspawn.[ch] glib/gspawn-win32.[ch] glib/glib.def:
        Add g_spawn_close_pid().

        * glib/gspawn.[ch]: Make g_spawn functions take
        GPid * instead if int * (GPid == int on unix, will
        produce compile warnings until fixed on Win32.)

        * tests/child-test.c: Make the test a little more
        inappropriately verbose.

        * glib/gmain.c: Add some documentation warnings about
        not closing @pid while the source is active.
2004-03-01 20:47:49 +00:00
Sebastian Wilhelmi
769f36db47 Moved the assembler functions from gatomic.h to gatomic.c, which makes for
2004-02-29  Sebastian Wilhelmi  <seppi@seppi.de>

	* configure.in, glib/gatomic.c, glib/gatomic.h: Moved the
	assembler functions from gatomic.h to gatomic.c, which makes for
	better maintainability. Also use gint instead of gint32 to be able
	to use reference counting for ABI-fixed structures with
	gint/guint.

	* glib/gthread.h: Adapted accordingly.

	* tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT.
2004-02-29 16:48:37 +00:00
Hans Breuer
3922b356a9 applied patch from J. Ali Harlow <ali@juiblex.co.uk> to fix g_child_watch
2003-02-28  Hans Breuer  <hans@breuer.org>

	* tests/child-test.c  glib/gmain.c :
	applied patch from J. Ali Harlow <ali@juiblex.co.uk> to fix
	g_child_watch implementation on win32, bug #50296
2004-02-28 13:04:24 +00:00
Sebastian Wilhelmi
73e3e63dc3 .cvsignore updates
.cvsignore updates
2004-02-26 17:20:29 +00:00
Sebastian Wilhelmi
c36865b1ec Only run, if threads are enabled.
2004-02-26  Sebastian Wilhelmi  <seppi@seppi.de>

	* tests/child-test.c (main): Only run, if threads are enabled.
2004-02-26 17:20:01 +00:00
Sebastian Wilhelmi
dbbb29f608 New files to implement atomic operations for different platforms. Fixes
2004-02-26  Sebastian Wilhelmi  <seppi@seppi.de>

	* glib/gatomic.c, glib/gatomic.h: New files to implement atomic
	operations for different platforms. Fixes bug #63621.

	* glib/glib.h: Include gatomic.h.

	* configure.in: Add test for assembler routines for atomic operations.

	* glib/Makefile.am: Add gatomic.c, gatomic.h.

	* tests/Makefile.am, tests/atomic-test.c: Unit test for atomic
	operations.

	* glib/glib-overrides.txt, glib/glib-sections.txt,
	glib/glib-docs.sgml, glib/tmpl/atomic_operations.sgml: Add docs
	for atomic operations.
2004-02-26 14:30:35 +00:00
Hans Breuer
fc9afe0d21 added g_hash_table_find and a bunch of g_queue_*
2003-02-26 Hans Breuer  <hans@breuer.org>

	* glib/glib.def : added g_hash_table_find and a
	bunch of g_queue_*

	* glib/gmain.c : make it compile on win32,
	child_wake_up_pipe replaced by semaphore like it is done
	for the other wake_up_pipe

	* config.h.win32.in : added HAVE_INT64_AND_I64
	* glibconfig.h.win32.in : G_MAXSIZE .. G_M??INT64,
	and typedef for GPid

	* test/env-test.c : don't let the local log function
	collide in namespace with standard C
2004-02-25 23:48:22 +00:00
Soeren Sandmann
a9bbf0f35d Extend GQueue API to match the GList API. (#118439).
Sat Feb 21 13:45:08 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* glib/gqueue.[ch]: Extend GQueue API to match the GList
	API. (#118439).

	* tests/queue-test.c: Update test suite to cover the new API.
2004-02-21 12:48:08 +00:00
Tim Janik
ee4e622d37 applied patch from #131937 with slight renames. provides
Fri Feb 20 03:02:05 2004  Tim Janik  <timj@gtk.org>

        * glib/ghash.[hc]: applied patch from #131937 with slight
        renames. provides g_hash_table_find().
2004-02-20 02:05:36 +00:00
Manish Singh
d249f73329 shut up cvs 2004-02-14 19:05:21 +00:00
Matthias Clasen
540d02ba8b Wrap waitpid() as a GSource. This is a partial implementation of the "Unix
Sat Feb 14 01:21:34 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gmain.h:
	* glib/gmain.c (g_child_watch_source_new):
	* glib/gmain.c (g_child_watch_add):
	* glib/gmain.c (g_child_watch_add_full): Wrap waitpid() as a
	GSource. This is a partial implementation of the "Unix signal
	source".  (#50296, Jonathan R. Blandford)

	* configure.in: Add the necessary configury to typedef GPid
	appropriately.

	* tests/Makefile.am:
	* tests/child-test.c: Test child_watch sources.
2004-02-14 00:23:36 +00:00
Manish Singh
705ba7c15a Fix broken test for gsize formats.
Sat Feb  7 15:02:01 2004  Manish Singh  <yosh@gimp.org>

        * tests/type-test.c: Fix broken test for gsize formats.
2004-02-07 23:03:35 +00:00
Manish Singh
dab652fff6 Shut up CVS 2004-02-05 01:59:24 +00:00
Manish Singh
bbf110839c Add prototype for g_completion_complete_utf8().
Wed Feb  4 17:58:51 2004  Manish Singh  <yosh@gimp.org>

        * glib/gcompletion.h: Add prototype for g_completion_complete_utf8().

        * tests/completion-test.c: #include <string.h>
2004-02-05 01:58:47 +00:00
Matthias Clasen
01fd2551d7 Weaken an g_assert() to a g_warning(), since apparently nothing in Posix
Thu Feb  5 01:19:12 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/file-test.c (test_mkstemp): Weaken an g_assert() to a
	g_warning(), since apparently nothing in Posix forces mkstemp()
	to reject templates without any X's.  (#133397)
2004-02-05 00:17:28 +00:00
Matthias Clasen
dd394749f9 New function which works like g_completion_complete(), but strips a
Thu Feb  5 00:56:28 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gcompletion.c (g_completion_complete_utf8): New function which
	works like g_completion_complete(), but strips a trailing incomplete
	UTF-8 character from the prefix.  (#133313, Theppitak Karoonboonyanan)

	* tests/completion-test.c (main): Some GCompletion tests.

	* tests/Makefile.am: Add completion-test.
2004-02-04 23:54:17 +00:00
Matthias Clasen
326c025205 New function, a cross between g_strsplit() and strtok(). (#88329, Soeren
Wed Jan 28 01:39:21 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gstrfuncs.h:
	* glib/gstrfuncs.c (g_strsplit_set): New function, a cross
	between g_strsplit() and strtok().  (#88329, Soeren Sandmann)

	* tests/strfunc-test.c (main): Add g_strsplit_set() tests.
2004-01-28 00:37:46 +00:00
Owen Taylor
7ace455394 Add g_timer_continue(). (#98536, Tim-Philipp Müller)
Thu Jan 22 13:55:44 2004  Owen Taylor  <otaylor@redhat.com>

        * glib/gtimer.c: Add g_timer_continue().
        (#98536, Tim-Philipp Müller)

        * configure.in: Version 2.3.2, interface age 0.

        * NEWS: tweak, finish.
2004-01-22 19:56:28 +00:00
Manish Singh
31a1fedf68 Add G_MAXSIZE, define in terms of G_MAXUfoo.
Sun Jan 11 16:13:20 2004  Manish Singh  <yosh@gimp.org>

        * configure.in: Add G_MAXSIZE, define in terms of G_MAXUfoo.

        * tests/type-test.c: Add test for G_MAXSIZE.

        * glibconfig.h.win32.in: Cleanup, add some missing bits.
2004-01-12 00:16:18 +00:00
George Lebl
80591652ff Add the init_by_array functionality from the reference implementation of
Fri Dec 19 11:49:21 2003  George Lebl <jirka@5z.com>

        * glib/grand.c
          glib/grand.h (g_rand_new) (g_rand_new_with_seed)
          (g_rand_new_with_seed_array) (g_rand_set_seed_array):  Add
          the init_by_array functionality from the reference implementation
          of the mersenne twister (mt19937ar.c) and change the naming
          to fit with the rest of the grand API.  New functions are
          g_rand_new_with_seed_array, g_rand_set_seed_array.  This is only
          reliable/tested for the 2.2 version of the seeding as that's what
          the reference implementation uses.  Also modify g_rand_new to
          get 4 longs from /dev/urandom since that will always be available
          anyway and we get more entropy and if /dev/urandom is unavailable
          use also 4 longs for seeding using secs, usecs, getpid and getppid.
          For version 2.0 use only a simple seed again but be more careful
          about seeding with secs/usecs in this case.

        * glib/grand.c
          glib/grand.h (g_rand_copy):  Add g_rand_copy function to copy the
          current state of the random number generator.

        * glib/grand.c (g_rand_new):  Add testing for EINTR when reading
          from /dev/urandom

        * tests/rand-test.c: add testing of the array seeding stuff against
          the reference implementation, plus add statistical sanity check
          to see that the values outputted are truly kind of random.  And
          check that g_rand_copy truly copies the state by checking a few
          terms.
2004-01-10 01:38:55 +00:00
Tim Janik
ba482c66c3 added convenience macros G_IMPLEMENT_INTERFACE() and G_DEFINE_TYPE() plus
Fri Jan  9 15:34:15 2004  Tim Janik  <timj@gtk.org>

        * gtype.h: added convenience macros G_IMPLEMENT_INTERFACE() and
        G_DEFINE_TYPE() plus variants.
2004-01-09 14:40:31 +00:00
Matthias Clasen
e09de99eb5 New function to call a function for each element of a GPtrArray. (#114790)
Fri Dec 26 02:03:58 2003  Matthias Clasen  <maclas@gmx.de>

	* glib/garray.[hc] (g_ptr_array_foreach): New function to
	call a function for each element of a GPtrArray.  (#114790)

	* tests/array-test.c (main): Add a test for g_ptr_array_foreach().
2003-12-26 01:04:12 +00:00
Noah Levitt
45b1590923 Add hangul composition and decomposition to unicode normalization.
2003-12-04  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.c: Add hangul composition and decomposition to
	unicode normalization. (#100456)

	* tests/unicode-normalize.c: Test hangul.
2003-12-04 19:47:52 +00:00
Roozbeh Pournader
6e3b71aec3 Fixed a bad pointer comparison in g_ascii_strtod that came up in fa_IR
Wed Nov 26 16:45:16 2003  Roozbeh Pournader  <roozbeh@sharif.edu>

        * glib/gstrfuncs.c: Fixed a bad pointer comparison in
        g_ascii_strtod that came up in fa_IR locale (#126640, Behdad
        Esfahbod).

        * tests/strtod-test.c: Fixed the tests to catch the above.
2003-11-26 13:22:42 +00:00
Manish Singh
b5ae75aa4a Added G_GSIZE_FORMAT and friends.
Thu Nov 20 15:09:40 2003  Manish Singh  <yosh@gimp.org>

        * configure.in: Added G_GSIZE_FORMAT and friends.

        * tests/printf-test.c
        * tests/testglib.c
        * tests/type-test.c: Add tests for the above.
2003-11-20 23:12:05 +00:00
Manish Singh
2b78955298 Use GUINT_TO_POINTER for g_thread_create data.
Mon Nov 17 17:28:10 2003  Manish Singh  <yosh@gimp.org>

        * tests/thread-test.c (test_g_thread_once): Use GUINT_TO_POINTER
        for g_thread_create data.
2003-11-18 01:29:36 +00:00
Tor Lillqvist
d1a3a46ae8 Fix for MSVC build: Skip strtod-test, use correct glib libraries, with 2.0
2003-11-15  Tor Lillqvist  <tml@iki.fi>

	* tests/makefile.msc.in: Fix for MSVC build: Skip strtod-test, use
	correct glib libraries, with 2.0 in the names. (#126906, John
	Ehresman)
2003-11-15 03:08:57 +00:00
Morten Welinder
3b2f74d188 Handle the case where the to-be-inserted string is a substring of the
2003-11-05  Morten Welinder  <terra@gnome.org>

	* glib/gstring.c (g_string_insert_len): Handle the case where the
	to-be-inserted string is a substring of the target string.
	(g_string_assign): Handle "s = s;".
	(#114260, self.)
2003-11-05 16:24:44 +00:00
Matthias Clasen
c582b7ad60 Change the %e tests to not check for actual string equality, but rather
Tue Oct 28 23:38:30 2003  Matthias Clasen  <maclas@gmx.de>

	* tests/printf-test.c: Change the %e tests to not check for
	actual string equality, but rather equality under g_ascii_strtod(),
	since the number of leading digits in the exponent seems to
	be not exactly prescribed by SUS.
2003-10-28 22:40:51 +00:00
Manish Singh
da2474dd97 shut up cvs 2003-10-27 23:38:05 +00:00
Tor Lillqvist
5d097b8591 Force shared library (DLL) only on Windows. (I don't think that is
2003-10-24  Tor Lillqvist  <tml@iki.fi>

	* configure.in: Force shared library (DLL) only on Windows.
	(I don't think that is controversial?) Remove unnecessary
	AC_LIBTOOL_WIN32_DLL. Don't use -D_REENTRANT on
	Win32, it is not used by mingw or MSVC headers.

	* config.h.win32.in
	* glibconfig.h.win32.in: Match what configure produces.

	* glib/gconvert.c
	* glib/gutils.c: Mark a couple of functions and variables that
	aren't public as static.

	* glib/gnulib/g-gnulib.h: Undef HAVE_SNPRINTF before (re)defining
	it potentially differently, to silence compiler.

	* glib/glib.def: Add some missing entries.

	* tests/gobject/Makefile.am (LDADD): Reorder, put libgobject after
	libtestgobject.

	* tests/gobject/ifaceproperties.c (main): NULL-terminate arg list
	to g_object_set() and _get().
2003-10-24 03:41:22 +00:00
Owen Taylor
dfa8c540a1 === Released 2.3.0 ===
Thu Oct 23 12:38:24 2003  Owen Taylor  <otaylor@redhat.com>

        * === Released 2.3.0 ===

        * tests/gobject/Makefile.am (dist-hook): Remove
        and extra backslash.

        * tests/gobject/Makefile.am (EXTRA_DIST): Add
        testmarshal.list.

        * glib/Makefile.am (libglib_2_0_la_SOURCES): Add
        missing gunicode-private.h.

        * tests/testglib.c (main): Fix a warning.

        * tests/gobject/ifaceinherit.c: Remove check that
        wasn't supposed to work (adding an interface already
        added to the derived class to the base class),
        fix a bug.
2003-10-23 22:42:31 +00:00
Owen Taylor
7f2591cb0b Test for interface properties and GParamSpecOverride.
Tue Oct 14 17:44:38 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/gobject/ifaceproperties.c: Test for interface
        properties and GParamSpecOverride.
2003-10-21 19:15:07 +00:00
Owen Taylor
3e61c90b59 Test case for g_type_add_interface_check().
Thu Oct  2 01:15:46 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/gobject/ifacecheck.c: Test case for
        g_type_add_interface_check().

        * tests/gobject/ifaceinit.c: Add #undef G_DISABLE_ASSERT.
2003-10-02 05:28:00 +00:00
Owen Taylor
27d3ebfde3 Remove some tests that were testing things that weren't supposed to work;
Thu Oct  2 01:11:39 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/gobject/ifaceinherit.c: Remove some tests that
        were testing things that weren't supposed to work; add
        a test for adding an interface first to the child class,
        then to the parent class.
2003-10-02 05:13:21 +00:00
Owen Taylor
49d18d8d41 Tests of interface inheritance and overriding.
Thu Oct  2 00:02:55 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/gobject/Makefile.am test/gobject/ifaceinherit.c:
        Tests of interface inheritance and overriding.
2003-10-02 04:03:57 +00:00
Tor Lillqvist
b514888d16 Use hardcoded name for DLL, as there is no reliable way to determine it at
2003-09-29  Tor Lillqvist  <tml@iki.fi>

	* tests/testglib.c (main): Use hardcoded name for DLL, as there is
	no reliable way to determine it at compile or run time anyway.
2003-09-29 22:40:40 +00:00
Owen Taylor
a2ed74b5e3 .cvsignore update 2003-09-29 14:54:58 +00:00
Owen Taylor
2567305354 Dummy dynamic type module for testing type plugin code and dynamic types.
Thu Sep 25 15:43:08 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/gobject/testmodule.[ch] test/gobject/Makefile.am:
        Dummy dynamic type module for testing type plugin code
        and dynamic types.

        * test/gobject/defaultiface.c: Test of g_default_interface_ref,
        etc.
2003-09-29 14:54:39 +00:00
Owen Taylor
c577a8f05d Add gobject/.
Thu Sep 25 15:01:37 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/Makefile.am (SUBDIRS): Add gobject/.
2003-09-25 19:01:57 +00:00
Owen Taylor
4ec041d593 New directory, framework for automated GObject tests.
Fri Sep 12 16:26:21 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/gobject/ configure.in: New directory, framework
        for automated GObject tests.

        * tests/gobject/override.c: Move testoverride.c
        here, automate.

        * tests/gobject/ifaceinit.c: Move testifaceinit.c here.

        * tests/gobject/accumulator.c: Test signal accumulators,
        including g_signal_accumulator_true_handled.
2003-09-12 20:37:09 +00:00
Owen Taylor
2f4c3d8a6d Add g_markup_printf_escaped(), g_markup_vprintf_escaped().
Thu Sep 11 20:11:05 2003  Owen Taylor  <otaylor@redhat.com>

        * glib/gmarkup.c: Add g_markup_printf_escaped(),
        g_markup_vprintf_escaped().

        * tests/markup-escape-test.c (main): Test for
        g_markup_escape_text(), g_markup_printf_escaped().
2003-09-12 00:17:02 +00:00
Noah Levitt
8d91ba8c58 Unicode 4.0 special casing. (#114681)
2003-09-10  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunicodeprivate.h:
	* glib/gunicollate.c:
	* glib/gunidecomp.c:
	* glib/guniprop.c:
	* tests/casemap.txt:
	* tests/gen-casemap-txt.pl: Unicode 4.0 special casing. (#114681)

	* glib/gunicodeprivate.h: Use a private header instead of extern
	function declarations (_g_utf8_normalize_wc,
	_g_unichar_combining_class).
2003-09-10 16:55:36 +00:00
Tim Janik
558507bc5a added support for a "default vtable" per interface, that interface vtables
Tue Sep  2 19:37:21 2003  Tim Janik  <timj@gtk.org>

        * gtype.[hc]: added support for a "default vtable" per interface,
        that interface vtables are initialized from.
        the default vtable is initialized and finalized through class_init,
        class_finalize and class_data from the interfaces GTypeInfo struct.
        (type_data_last_unref_Wm): unload child plugin before unreffing
        parent type.

        testifaceinit.c: minor fixups. fixed up base_init() assertions, since
        with a default vtable, base_init() may be called multiple times.
        added default initializer to iface1.
2003-09-02 17:57:22 +00:00