Back in the far-off twentieth century, it was normal on unix
workstations for U+0060 GRAVE ACCENT to be drawn as "‛" and for U+0027
APOSTROPHE to be drawn as "’". This led to the convention of using
them as poor-man's ‛smart quotes’ in ASCII-only text.
However, "'" is now universally drawn as a vertical line, and "`" at a
45-degree angle, making them an `odd couple' when used together.
Unfortunately, there are lots of very old strings in glib, and also
lots of new strings in which people have kept up the old tradition,
perhaps entirely unaware that it used to not look stupid.
Fix this by just using 'dumb quotes' everywhere.
https://bugzilla.gnome.org/show_bug.cgi?id=700746
We have some testcases that assert that type modules are unloaded after
the last reference on them is dropped. Comment out those asserts now
that we turned the last unref into a no-op.
https://bugzilla.gnome.org/show_bug.cgi?id=693351
We only want to control the default visibility for our five main
installable libraries: libglib, libgthread, libgmodule, libgobject,
libgio. We should therefore only set -fvisibility=hidden when building
those.
Use a separate substitution variable for this purpose.
Using CFLAGS directly leads to some modules built in testcases not
exporting their symbols (and then the tests fail). It also affects the
fam file monitoring module.
Colin had originally done it this way in his visibility patch series but
I failed to understand why so I didn't copy it. Now I do.
Also: revert changes made to two testcases in an attempt to work around
this issue.
https://bugzilla.gnome.org/show_bug.cgi?id=691756
Add a check to prevent adding an interface to a class that has already
had its class_init done.
This is an incompatible change but it is suspected that there are not
many users of this functionality. Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).
Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.
https://bugzilla.gnome.org/show_bug.cgi?id=687659
1) use "../libtool" rather than "libtool" to avoid problems
with wacky OS X not-actually-libtool
2) Use libtool on the libtool script, not the binary, so that it
actually does anything
3) Don't use "gdb --ex" since it's apparently new-ish/non-portable.
https://bugzilla.gnome.org/show_bug.cgi?id=684723
Add a check to prevent adding an interface to a class that has already
had its class_init done.
This is an incompatible change but it is suspected that there are not
many users of this functionality. Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).
Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.
https://bugzilla.gnome.org/show_bug.cgi?id=687659
Add a check to prevent adding an interface to a class that has already
had its class_init done.
This is an incompatible change but it is suspected that there are not
many users of this functionality. Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).
Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.
https://bugzilla.gnome.org/show_bug.cgi?id=687659
I'm normally a big fan of small atomic commits, but I also want to get
things done this afternoon...
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441
Reviewed-by: Colin Walters <walters@verbum.org>
Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().
Remove those uses, as they are no longer required.
https://bugzilla.gnome.org/show_bug.cgi?id=686161
"make check" was failing on sys/resource.h not being available on
win32. Seeing that this test just spews some numbers on stdout
whithout really testing anything we can safely replace them with
similar enough numbers by relying on g_get_monotonic_time ().
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=682386
gdb by default will only print strings up to 200 characters. After that
it abbreviates them. This affects the run-assert-msg-test.sh script if
the path to the glib installation is too long (in our case it was 133
characters, 132 would still have worked...)
By having gdb execute "set print elements 0" before printing the assert
string, the limit on maximum number of characters to print is set to
unlimited.
Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
https://bugzilla.gnome.org/show_bug.cgi?id=670218
These don't really matter, since it's test code, but they do obscure
real leaks in the library.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Acked-by: Matthias Clasen <mclasen@redhat.com>
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.
https://bugzilla.gnome.org/show_bug.cgi?id=600161
Any flags specified as well as "all" are subtracted from the result,
allowing the user to specify FOO_DEBUG="all,bar,baz" to mean "give me
debugging information for everything except bar and baz".
https://bugzilla.gnome.org/show_bug.cgi?id=642452
These were the last users of the dynamic allocation API.
Keep the uses in glib/tests/mutex.c since this is actually meant to test
the API (which has to continue working, even if it is deprecated).
https://bugzilla.gnome.org/show_bug.cgi?id=660739
All locks are now zero-initialised, so we can drop the G_*_INIT macros
for them.
Adjust various users around GLib accordingly and change the docs.
https://bugzilla.gnome.org/show_bug.cgi?id=659866
The documentation for G_TYPE_CHAR says:
"The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed
integer."
However the return value for g_value_get_char() was just "char" which
in C has an unspecified signedness; on e.g. x86 it's signed (which
matches the GType), but on e.g. PowerPC or ARM, it's not.
We can't break the old API, so we need to suck it up and add new API.
Port most internal users, but keep some tests of the old API too.
https://bugzilla.gnome.org/show_bug.cgi?id=659870
Replace it with g_thread_create_with_stack_size() and a real function
implementation of g_thread_create().
Modify a testcase that was calling g_thread_create_full()
inappropriately (it was using the default values anyway).
G_THREADS_ENABLED still exists, but is always defined. It is still
possible to use libglib without threads, but gobject (and everything
above it) is now guaranteed to be using threads (as, in fact, it was
before, since it was accidentally impossible to compile with
--disable-threads).
https://bugzilla.gnome.org/show_bug.cgi?id=616754
At the same time, also add g_mkdtemp_full and g_dir_make_tmp
variants. The patch also unifies the unique-name-generating
code for all variants of mkstemp and mkdtemp and adds tests
for the new functions.
Based on patches by Paolo Bonzini,
http://bugzilla.gnome.org/show_bug.cgi?id=118563
If we are going to fail an assert, wait for a bit longer before doing so
(up to 5 seconds, if needed).
This is a long-standing Debian patch to fix build failures on really
slow machines.
g_thread_init() causes a hash table to be allocated (in read_aliases).
Since hash tables are now a bit larger, we need to bump one of the
probe sizes to avoid our probe slice being used for the aliases
hash table.
Of course, a proper implementation of close() will just ignore an
invalid parameter silently, and set errno. But apparently the "debug"
version of the Microsoft C library generates some noise in this
case. So avoid that. Thanks to John Emmas for reporting.
These allow applications to give meaningful names to their sources.
Source names can then be used for debugging and profiling, for
example with systemtap or gdb.
https://bugzilla.gnome.org/show_bug.cgi?id=606044
For some reason, even though the tests are linked against libgobject.la
and libgobject.la mentions libglib.la as a dependency, the tests are
running against the system glib instead of the in-tree one.
Adding the libglib.la file as an explicit LDFLAG fixes it.
Re-using glibc's __abort_msg symbol causes linking problems, since the symbol
is declared private. Always use our own__glib_abort_msg symbol to store
assertion messages, to avoid compatibility and linking problems.
Also fix the test case to work with out of tree builds (such as "make
distcheck"), and re-enable it.
https://bugzilla.gnome.org/show_bug.cgi?id=594872
It makes the IBM XL C Compiler (the 'native' non-free compiler
on the AIX 5.3 and 6.1 platform) stop compiling with syntax error.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=581300
Signed-off-by: Javier Jardón <jjardon@gnome.org>
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
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
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.)
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
* 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-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 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-08 Ryan Lortie <desrt@desrt.ca>
* tests/markups/fail-32.gmarkup: change  to � since the
former is no longer a failure.
svn path=/trunk/; revision=7328
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-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-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-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
* 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-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-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-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-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
* 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-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
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-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-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-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 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-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-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
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 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-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-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-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
* 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
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
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-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
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
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-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-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-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 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-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-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-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-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-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-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-06 Matthias Clasen <mclasen@Redhat.com>
* tests/Makefile.am: Apply a patch by Loïc Minier
to fix building with -Wl,-z,defs. (#149144)
svn path=/trunk/; revision=5367
2007-02-16 Soren Sandmann <sandmann@redhat.com>
* tests/sequence-test.c: For move, test moving between two
sequences. Add test for swap.
* glib/gsequence.c: Replace splay tree with a treap.
(check_node): Add checks for the treap invariants.
svn path=/trunk/; revision=5337
2007-02-07 Soren Sandmann <sandmann@daimi.au.dk>
* tests/sequence-test.c (compare_items): Force an arbitrary order
on otherwise identical items.
* glib/gsequence.c: Add comment discussing splay trees vs. other trees.
* glib/gsequence.c (is_end): Add fast path for the common case
when the node is not actually the end node.
svn path=/trunk/; revision=5328
2007-02-03 Soren Sandmann <sandmann@daimi.au.dk>
* glib/gsequence.c (struct _GSequence): Add a new 'real_sequence'
field.
(g_sequence_new): Initialize real_sequence to the sequence
(g_sequence_sort_iter): Set real_sequence of the temporary
sequence to the real sequence.
(g_sequence_sort_changed_iter): Same
(g_sequence_insert_sorted_iter): Same
(g_sequence_search_iter): Same
(g_sequence_iter_get_sequence): Return real_sequence
* tests/sequence-test.c (compare_iters): Insert assertions that
the iters point to the sequence being manipulated.
svn path=/trunk/; revision=5323
2007-02-03 Soren Sandmann <sandmann@daimi.au.dk>
* glib/gsequence.[ch]: New files implementing GSequence, a list
implemented using a binary tree.
* glib/glib.h, glib/glib.symbols: Update for GSequence.
* docs/reference: Add documentation for GSequence
* tests: Add sequence-test.c, a thorough test of all of
the GSequence API.
svn path=/trunk/; revision=5322
2007-01-12 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c: Rework the handling of invalid
keys/groups again. We are back to being liberal about
what we accept, and only reject things that would lead
to non-rereadable keyfiles.
* tests/keyfile-test.c: Adapt tests.
svn path=/trunk/; revision=5254
2007-01-03 Behdad Esfahbod <behdad@gnome.org>
* glib/gutils.h: Fix bug in g_bit_nth_lsf (#371631) and use
__builtin_clzl for g_bit_storage if available (#371670).
* tests/Makefile.am:
* tests/bit-test.c: New test, to test g_bit_* operations against
naive and builtin implementations.
svn path=/trunk/; revision=5200
Thu Dec 28 12:50:31 2006 Tim Janik <timj@imendio.com>
* glib/gslice.h, glib/gslice.c: implemented static debugging
hash-tree to validate slice adresses and sizes with G_SLICE=debug-blocks.
use abort() to exit in mem_error() to allow catching of these in gdb.
abort programs with a descriptive error message if g_thread_init() is
called after GSlice was in use. previously this just silently corrupted
the magazines.
* glib/ghash.c (struct _GHashNode): reordered fields to keep 8-byte
pointer alignment on 64bit systems and request smaller slice sizes
on 32bit systems.
* tests/slice-test.c: support '~' option flag to introduce slice
allocation/release corruption with a significant probability. this
allowes testing of G_SLICE=debug-blocks.
2006-12-24 Matthias Clasen <mclasen@redhat.com>
* tests/run-collate-tests.sh:
* tests/unicode-collate.c: Silently skip tests if
we can't set LC_COLLATE to en_US. (#336438)
2006-12-19 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c (g_key_file_is_key_name): Accept
'/', '+' and '.' in key names, since gnome-vfs uses
mime types as keys in some cache.
2
2006-12-18 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c: Tighten up the check for allowed
key and group names. (#343191, Tommi Komulainen)
* tests/keyfile-test.c: Test handling of key and group names.
2006-12-14 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c (g_key_file_add_group): If the group
is already there, make it current. (#385910, Joe Halliwell)
* tests/keyfile-test.c: Add a test for duplicate groups/keys.
2006-10-15 Sebastian Wilhelmi <seppi@seppi.de>
* tests/Makefile.am: Compile errorcheck-mutex-test with thread
libraries explicitly. (#74748, Javier Villavicencio)
Wed Aug 16 13:59:07 2006 Tim Janik <timj@gtk.org>
* tests/gobject/Makefile.am:
* tests/gobject/singleton.c: added test program which demonstrates
and checks singleton construction.
2006-08-05 Matthias Clasen <mclasen@redhat.com>
* glib/guniprop.c (g_unichar_toupper, g_unichar_tolower)
(real_toupper, real_tolower): If a character can't be converted,
don't replace it with a NUL byte, but leave it unchanged.
(#348491, Nikolai Weibull)
* tests/unicode-caseconv.c: Adapt to this change.
* tests/unicode-caseconv.c (main): Add a comment to point out
a quirk in the test data that we are working around here.
2006-07-31 Behdad Esfahbod <behdad@gnome.org>
* glib/gunidecomp.c (_g_utf8_normalize_wc): Update to reflect Unicode
PR #29 (#348694, Nikolai Weibull)
* tests/unicode-normalize.c (encode), (test_form): Make output more
useful, reporting the unexpected output of the test.
2006-06-20 Matthias Clasen <mclasen@redhat.com>
* glib/gtimer.c (mktime_utc): Fix an off-by-2 error
in the leap year calculation. (#344905, Dan Winship)
* tests/testglib.c (main): Change the test data for
the g_time_val_from_iso8601 tests to expose an off-by-2
error in the leap year calculation.
2006-06-16 Matthias Clasen <mclasen@redhat.com>
* tests/file-test.c (test_mkstemp): Add tests.
* glib/gfileutils.c (g_mkstemp): Allow the XXXXXX to occur
inside the template, not just at the end.
2006-06-12 Emmanuele Bassi <ebassi@cvs.gnome.org>
* glib/gbookmarkfile.h:
* glib/gbookmarkfile.c (g_bookmark_file_remove_item): Return
a boolean instead of void.
* tests/bookmarkfile-test.c (test_modify): Add a test case
for g_bookmark_file_remove_item().
2006-06-01 Matthias Clasen <mclasen@redhat.com>
* glib/giochannel.c (g_io_channel_write_chars): Avoid
running in an assertion with small writes. (#343566, Chris
Wilson)
* tests/iochannel-test.c: Add a testcase for small writes.
2006-05-28 Matthias Clasen <mclasen@redhat.com>
* tests/markups/expected-*: Output that test-markup
is expected to produce when run on the valid gmarkup
examples.
* tests/markup-test.c: Only dump the results of the
first, unchunked parse, to compare it against the expected
output.
* tests/run-markup-tests.sh: For valid examples, compare
the output of test-markup against the corresponding
expected-<n> file.
2006-05-09 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
system thread identifier comparision and assignment macros from
glib/gthread.c to glib/gthreadprivate.h.
* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
glib/gthreadprivate.h instead of glib/gthreadinit.h.
* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
owner determination. This fixes#311043 and is mostly modeled
after the patch from jylefort@FreeBSD.org.
2006-05-08 Matthias Clasen <mclasen@redhat.com>
* tests/convert-test.c (test_one_half): Use encoding names which
may work better on Solaris. (#340434, Alessandro Vesely)
2006-05-03 Matthias Clasen <mclasen@redhat.com>
* tests/base64-test.c (test_incremental): Use malloced memory
instead of stack-allocated, so that MALLOC_CHECK_=2 catches
the OOB write...
2006-04-18 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.h:
* glib/glib.symbols:
* glib/gkeyfile.c: Add api to get and set doubles and
lists of doubles. (#164719, Maurizio Monge, Dom Lachowicz)
* tests/keyfile-test.c: Add tests for new api.
2006-04-17 Matthias Clasen <mclasen@redhat.com>
* glib/gcompletion.c (g_completion_complete_utf8): Make passing
NULL for new_prefix work as documented. (#338845, Yevgen Muntyan)
* tests/completion-test.c: Test that passing NULL for
new_prefix in g_completion_complete_utf8 works.
* glib/gthreadpool.c: Make sure
g_thread_pool_stop_unused_threads() actually stops unused threads
and global limits (like max idle time and max unused threads) can
be set without creating a thread pool first. Fixed#335215 (patch
from Chris Wilson).
* tests/threadpool-test.c: Added two new tests, tests setting
global limits before creating a thread pool. The second test
makes sure unused threads are actually stopped when using the
g_thread_pool_stop_unused_threads().
2006-04-05 Behdad Esfahbod <behdad@gnome.org>
* tests/option-test.c: Check the return value of g_get_prgname for
NULL before passing to strcmp.
* tests/slice-test.c: Report the correct name in Usage summary.
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.
* 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-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-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)
* 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.
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-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-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.
* 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.
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.
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.
* 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-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)
* 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 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)
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
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-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-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-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-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.
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.
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-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-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.