Commit Graph

464 Commits

Author SHA1 Message Date
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