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
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
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
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-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-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-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
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