Commit Graph

673 Commits

Author SHA1 Message Date
Alexander Larsson
3c5e1fd903 Remove additional thread support in performance test
We're always enabling threads now so this is not needed.
2010-01-13 10:24:09 +01:00
Martin Pitt
da66897950 Support storing assertion messages into core dump
Crash interception/debugging systems like Apport or ABRT capture core dumps for
later crash analysis. However, if a program exits with an assertion failure,
the core dump is not useful since the assertion message is only printed to
stderr.

glibc recently got a patch which stores the message of assert() into the
__abort_msg global variable.
(http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=48dcd0ba)
That works fine for programs which actually use the standard C assert() macro.

This patch adds the same functionality for glib's assertion tests. If we are
building against a glibc which already has __abort_msg (2.11 and later, or
backported above git commit), use that, otherwise put it into our own field
__glib_assert_msg.

Usage:

  $ cat test.c
  #include <glib.h>

  int main() {
      g_assert(1 < 0);
      return 0;
  }

  $ ./test
  **ERROR:test.c:5:main: assertion failed: (1 < 0)
  Aborted (Core dumped)

  $ gdb --batch --ex 'print (char*) __abort_msg' ./test core
  [...]
  $1 = 0x93bf028 "ERROR:test.c:5:main: assertion failed: (1 < 0)"

https://bugzilla.gnome.org/show_bug.cgi?id=594872
2009-12-23 15:51:11 +00:00
Matthias Clasen
80bda52b57 Fix dynamictype test to build 2009-11-29 21:19:10 -05:00
Alexander Larsson
b35fa1994d Cast iface_init to GInterfaceInitFunc
This is in line with what all other type define macros do.

https://bugzilla.gnome.org/show_bug.cgi?id=508157
2009-11-26 12:32:36 +01:00
Alexander Larsson
36646f46ab Add test for G_IMPLEMENT_INTERFACE_DYNAMIC 2009-11-26 11:54:44 +01:00
Alexander Larsson
f4d9789fcf Add gobject performance tests for threaded code
This measures how much things like lock contention affects the gobject
code.
2009-10-02 21:02:48 +02:00
Alexander Larsson
b1f94af095 Add performance tests for GObject primitives
These are basic performance test for a couple of basic gobject
primitives:

* construction of simple objects. Simple is a bare gobject derived
  class with no properties, signals or interfaces.

* construction of complex objects. Complex is a gobject subclass
  with construct properties, normal properties, signals, and
  implements an interface.

* run-time type check of complex objects

* signal emissions

Lots of care is taken to try to make the results reproducible. Each
test is run for multible "rounds", where we try to make each round be
"not too short" in order to be significant wrt timer accuracy, but
also "not to long" to make the probability of some other random event
happening on the system (interrupts, other process scheduled, etc)
during the round less likely.
The current target round time is 4 msecs, which was picked without
rigour, but seems small wrt e.g. scheduler time.

For each test we then run the calculated round size for 60 seconds,
and then report the performance based on the minimal time of one
round. The model here is that any random stuff that happens during a
round can only slow it down, there is nothing that can make it go
faster, so the minimal time is the best estimate of how fast one round
goes.

The result is not ideal, even on a "idle" system the results vary
from round to round, but the variation seems to be less than 1%.
So, any performance difference reported by this test over 1% is
probably statistically significant.

Additionally the tests can be run with or without threads being
initialized. The script tests/gobject/run-performance.sh makes
it easy to produce a performance report for the current checkout.

https://bugzilla.gnome.org/show_bug.cgi?id=557100
2009-10-02 21:02:23 +02:00
Dan Winship
8212aadac7 g_time_val_from_iso8601: handle timezoneless dates
per ISO 8601:2004 4.2.5.2

Based on a patch from Andy Shevchenko
http://bugzilla.gnome.org/show_bug.cgi?id=589491
2009-09-01 09:40:03 -04:00
Matthias Clasen
5694ab7642 Revert "Move gio tests from gio/tests/ to tests/gio/"
This reverts commit 2262d76b33.

Move GIO tests back to where they belong.
2009-07-05 22:49:24 -04:00
Dan Winship
29e6525b1e Two "make check" fixes for late changes to the thread-context patch
g_simple_async_result_complete() now checks that it's being run from
the correct main loop, so tests/gio/simple-async-result was failing,
because it called it from outside any main loop. (And gio's pltcheck
was failing because I hadn't added g_main_current_source() to it.)
2009-07-01 13:52:49 -04:00
Benjamin Otte
2262d76b33 Move gio tests from gio/tests/ to tests/gio/
This avoids getting tests built every time when working on libgio and
running make in the gio/ directory.
2009-07-01 19:03:19 +02:00
Hans Breuer
75ef018248 Updated msvc build files 2009-05-30 15:29:23 +02:00
Matthias Clasen
f33a484b4a Fix up tests forgotten in Michaels commit
When Michael cleaned up after my fumbled commit of his gmarkup
optimizations, he fumbled himself and forgot to fix up the tests...
2009-05-03 17:10:16 -04:00
Dan Winship
92ac8d165e Misc warning fixes
glib/pcre/pcre_ucp_search_funcs.c, glib/pcre/pcre_valid_utf8.c: add
back missing config.h includes, and this time add them to the copies
in glib/update-pcre/ too so they don't get lost again on the next PCRE
update.

glib/garray.c, glib/gbase64.c: fix signed/unsigned pointer casts

gio/xdgmime/xdgmimeglob.c: remove unused variable

gio/tests/live-g-file.c: fix printf args on x86_64

tests/Makefile.am, tests/regex-test.c: remove redundant -DENABLE_REGEX
2009-05-01 10:37:45 -04:00
Peter Kjellerstedt
efc2cdbfc9 Fix parsing of timezones
Make g_time_val_from_iso8601 handle timezones with minutes correctly;
also accept comma as a fraction separator.  (#578369)
2009-04-08 10:26:11 -04:00
Matthias Clasen
84fdf0d00e Fix distcheck
svn path=/trunk/; revision=7932
2009-03-01 16:46:45 +00:00
Matthias Clasen
82e1d3e753 Bug 523742 – Use noinst for non-installable libraries
* tests/Makefile.am: use noninst_LTLIBRARIES for noninstalled
        libraries.Patch by Björn Lindqvist


svn path=/trunk/; revision=7860
2009-02-12 03:55:38 +00:00
Dan Winship
b9cf1ed275 update
* glib/tests/.gitignore: update

	* tests/.gitignore: update, sort

	* tests/gobject/.gitignore: add

svn path=/trunk/; revision=7772
2009-01-05 14:56:55 +00:00
Matthias Clasen
c6404e8329 Accept short data
svn path=/trunk/; revision=7625
2008-10-24 04:10:50 +00:00
Dan Winship
5c53925ed0 Bug 553447 $(Q#|(B g_assert_no_error()
* glib/gtestutils.h (g_assert_no_error, g_assert_error): Macros to
	assert that a GError is not set, or else is set to a particular
	error.

	* glib/gtestutils.c (g_assertion_message_error): utility for
	those macros

	* glib/tests/keyfile.c:
	* tests/asyncqueue-test.c:
	* tests/bookmarkfile-test.c:
	* tests/convert-test.c:
	* tests/file-test.c: Use g_assert_error/g_assert_no_error

svn path=/trunk/; revision=7555
2008-09-27 01:43:29 +00:00
Ryan Lortie
920f3bffb3 Bug 549771 – improved .gitignore for glib
2007-09-02  Ryan Lortie  <desrt@desrt.ca>

        Bug 549771 – improved .gitignore for glib

        * docs/reference/.gitignore:
        * docs/reference/gio/.gitignore:
        * docs/reference/gobject/tmpl/.gitignore:
        * gio/.gitignore:
        * gio/tests/.gitignore:
        * glib/.gitignore:
        * glib/libcharset/.gitignore:
        * glib/tests/.gitignore:
        * gmodule/.gitignore:
        * gobject/.gitignore:
        * gobject/tests/.gitignore:
        * po/.gitignore:
        * tests/.gitignore: new files
        * .gitignore: remove 'build' (since it's part of glib now), add more
        useful things.


svn path=/trunk/; revision=7432
2008-09-02 18:40:39 +00:00
Paolo Borelli
e6eb809599 Bug 550040 - Move GString, rand and printf tests to the unit test
2008-09-01  Paolo Borelli  <pborelli@katamail.com>

	Bug 550040 - Move GString, rand and printf tests to the unit test
	framework

	* tests/printf-test.c:
	* tests/rand-test.c:
	* tests/string-test.c:
	Removed

	* glib/tests/printf.c:
	* glib/tests/rand.c:
	* glib/tests/string.c:
	Added

	* tests/Makefile.am:
	* glib/tests/Makefile.am:
	Updated for the above


svn path=/trunk/; revision=7419
2008-09-01 09:31:40 +00:00
Bastien Nocera
f84518e35b Bug 548612 – g_strstr_len() should use memmem when available
2008-08-28  Bastien Nocera  <hadess@hadess.net>

	Bug 548612 – g_strstr_len() should use memmem when available

	* glib/tests/strfuncs.c (test_strstr):
	* tests/string-test.c (main): Patch by Paolo Borelli
	<pborelli@katamail.com> to move the tests to the right place,
	and add more tests

	* glib/gstrfuncs.c (g_strstr_len): Fix problem with memmem ignoring
	nul-terminators in strings, and using the haystack_len instead


svn path=/trunk/; revision=7409
2008-08-28 12:53:59 +00:00
Bastien Nocera
5e2a6047ea Bug 548612 – g_strstr_len() should use memmem when available
2008-08-28  Bastien Nocera  <hadess@hadess.net>

	Bug 548612 – g_strstr_len() should use memmem when available

	* configure.in: detect whether memmem is available in the C library
	* glib/gstrfuncs.c (g_strstr_len): use memmem for g_strstr_len() if
	available in it's available, as it could be optimised by the C library
	* tests/string-test.c (main): Add a few tests for g_strstr_len()


svn path=/trunk/; revision=7407
2008-08-27 23:23:23 +00:00
Matthias Clasen
88c7129340 Bug 547337 – G_DISABLE_DEPRECATED breaks tests build
2008-08-13  Matthias Clasen  <mclasen@redhat.com>

        Bug 547337 – G_DISABLE_DEPRECATED breaks tests build

        * tests/testglib.c: Protect deprecated API by ifdefs.
        Patch by Kalle Vahlman


svn path=/trunk/; revision=7353
2008-08-14 03:05:17 +00:00
Ryan Lortie
ce42e7ad4a Fix 'fail' markup test cases to -not- be valid XML 1.1.
2008-08-08  Ryan Lortie  <desrt@desrt.ca>

        * tests/markups/fail-32.gmarkup: change &#x10; to &#x0; since the
        former is no longer a failure.


svn path=/trunk/; revision=7328
2008-08-08 18:35:19 +00:00
Tor Lillqvist
b5b363019a Avoid warning on Win64 by using gintptr cast instead if long cast.
2008-08-04  Tor Lillqvist  <tml@novell.com>

	* tests/testglib.c: Avoid warning on Win64 by using gintptr cast
	instead if long cast.


svn path=/trunk/; revision=7304
2008-08-04 18:12:11 +00:00
Matthias Clasen
6e55e05284 Remove leftovers
svn path=/trunk/; revision=7243
2008-07-23 16:22:32 +00:00
Emmanuele Bassi
bcdc09e641 Do not set the timestamp value using time(), as it will be overwritten
2008-07-21  Emmanuele Bassi  <ebassi@gnome.org>

	* glib/gbookmarkfile.c:
	(bookmark_app_info_new): Do not set the timestamp value
	using time(), as it will be overwritten anyway. (#535223,
	Michael Meeks)

	(parse_application_element),
	(bookmark_app_info_dump): Support the "modified" attribute,
	which takes an ISO-formatted string instead of a Unix time
	stamp, to keep the number of g_strdup_printf() calls to a
	minimum.

	* glib/gtimer.c:
	(g_time_val_to_iso8601): Do not use strftime(): we know
	the format and contents of the ISO 8601 date format we
	use.

	* tests/bookmarks/valid-03.xbel: Add a test file for the
	modified attribute.

svn path=/trunk/; revision=7231
2008-07-21 13:05:24 +00:00
Matthias Clasen
d0008f0070 Move another test
svn path=/trunk/; revision=7209
2008-07-20 02:09:05 +00:00
Matthias Clasen
d0bd89a301 Move another test
svn path=/trunk/; revision=7198
2008-07-18 07:07:39 +00:00
Matthias Clasen
063c43c0d8 Move tests around
svn path=/trunk/; revision=7197
2008-07-18 06:25:23 +00:00
Matthias Clasen
3ec443b188 Ignore the error if iconv doesn't support EUC-JP.
* tests/iochannel-test.c: Ignore the error if iconv doesn't
        support EUC-JP.


svn path=/trunk/; revision=7182
2008-07-14 19:31:33 +00:00
Matthias Clasen
7560b45764 Print error messages when something fails
svn path=/trunk/; revision=7181
2008-07-14 19:15:18 +00:00
Matthias Clasen
052f3e6bd9 Skip a test if iconv doesn't support the encoding
svn path=/trunk/; revision=7180
2008-07-14 18:17:20 +00:00
Michael Natterer
4cd8caa6c7 Bug 541208 – Functions to easily install and use signals without class
2008-07-04  Michael Natterer  <mitch@imendio.com>

	Bug 541208 – Functions to easily install and use signals without
	class struct slot

	* tests/gobject/override.c: added tests for the new gsignal
	overriding and chaining APIs.


svn path=/trunk/; revision=7158
2008-07-04 11:10:48 +00:00
Paolo Borelli
96f99d334d Bug 539770 - migrate gstrfunc unit tests to gtest
2008-06-24  Paolo Borelli  <pborelli@katamail.com>

	Bug 539770 - migrate gstrfunc unit tests to gtest

	* tests/strfunc-test.c:
	* tests/testglib.c:
	* tests/strtoll-test.c:
	* tests/strtod-test.c:
	* tests/string-test.c:
	* tests/Makefile.am:
	Removed old tests.

	* glib/tests/fileutils.c:
	* glib/tests/strfuncs.c:
	* glib/tests/Makefile.am:
	Added all the old tests migrated to the new unit test framework
	and add new unit tests for some of the functions.


svn path=/trunk/; revision=7097
2008-06-24 13:55:22 +00:00
Johan Dahlin
761424465a Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch


svn path=/trunk/; revision=7092
2008-06-22 15:10:51 +00:00
Matthias Clasen
d780a41c37 set tv_usec to 0 rather than 1 when a fraction of a second is not
* glib/gtimer.c (g_time_val_from_iso8601): set tv_usec to 0 rather
        than 1 when a fraction of a second is not specified
        (g_time_val_from_iso8601): calculate a fraction of a second
        correctly even in case it does not happen to consist of exactly
        six digits; do not allow random data after the ISO 8601 string,
        only whitespace
        (make g_time_val_to_iso8601): support fractions of a second
        Patch by Peter Kjellerstedt

        * tests/testglib.c: Update to match


svn path=/trunk/; revision=7057
2008-06-19 04:14:25 +00:00
Michael Natterer
a8a3606966 Bug 535628 - test/patterntest.c still includes gpattern.h directly.
2008-05-30  Michael Natterer  <mitch@imendio.com>

	Bug 535628 - test/patterntest.c still includes gpattern.h
	directly.

	* tests/patterntest.c: don't include "glib/gpattern.h" directly.
	Patch from Hiroyuki Ikezoe.


svn path=/trunk/; revision=6964
2008-05-30 09:05:08 +00:00
Michael Natterer
82bc28361e add G_DISABLE_SINGLE_INCLUDES to CPPFLAGS globally.
2008-05-28  Michael Natterer  <mitch@imendio.com>

	* configure.in: add G_DISABLE_SINGLE_INCLUDES to CPPFLAGS
	globally.

	* glib/tests/option-context.c
	* glib/tests/testing.c
	* tests/testingbase64.c: don't include <glib/gtestutils.h>


svn path=/trunk/; revision=6955
2008-05-28 16:18:27 +00:00
Matthias Clasen
2356ba3471 Update to Unicode 5.1
svn path=/trunk/; revision=6944
2008-05-27 16:20:27 +00:00
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