Commit Graph

2840 Commits

Author SHA1 Message Date
Matthias Clasen
953962d783 Move tree tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
5123bc69e7 Move slist tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
b61fd45ac3 Move list tests to the test framework 2010-07-05 23:13:18 -04:00
Matthias Clasen
af299df44e Remove cases of ;; 2010-07-05 23:13:17 -04:00
Matthias Clasen
26e29cb360 Move charset conversion tests to the test framework 2010-07-04 20:51:06 -04:00
Milan Bouchet-Valat
ab6b6c68c5 Bug 622294 - More annotations for GVariant
This adds annotations to all functions in gvariant.c. A few docs
were also fixed (wrong parameter names, missing mention that NULL
is allowed).
2010-06-29 19:35:39 +02:00
Matthias Clasen
eb454a1cb4 Fix a alloc/free mismatch
Pointed out in http://bugzilla.redhat.com/show_bug.cgi?id=608453
by David Tardon.
2010-06-27 19:27:04 -04:00
Kristian Rietveld
87fd38bc4d Add PCRE_EXP_DECL to pcre_callout declaration
Fixes build on Mac OS X.
2010-06-26 22:55:47 +02:00
Dan Winship
1ad08a6a9f Hack up glib/tests/array-test to not actually malloc 2G
Fixes the test on machines where that allocation takes very long.

https://bugzilla.gnome.org/show_bug.cgi?id=610784
2010-06-24 16:02:39 -04:00
Ryan Lortie
b638a675a8 Ignore more glib test cases 2010-06-24 00:41:18 -04:00
Ryan Lortie
fb94e65a64 GChecksum: accept NULL pointer with length 0
Several GChecksum functions were incorrectly aborting when passed a NULL
data pointer, even if the length parameter was equal to zero.
2010-06-24 00:39:38 -04:00
Matthias Clasen
17bc9bf94f Deprecate some rarely-used APIS
GRelation and GCompletion are almost never used, and not very actively
maintained. Mark them as deprecated to make this clear. Bug #551271.
2010-06-23 22:32:35 -04:00
Ryan Lortie
d3af9c0ec5 neutralise pltcheck.sh 2010-06-23 10:12:14 -04:00
Matthias Clasen
8eb755e78e Add some more unicode property tests 2010-06-23 09:25:29 -04:00
Matthias Clasen
e26b92b947 Move node tests to the test framework 2010-06-23 09:25:29 -04:00
Matthias Clasen
464b5ff357 Some more hash, utils and checksum tests 2010-06-23 09:25:29 -04:00
Matthias Clasen
01abbc4bd3 Move node test to the test framework 2010-06-23 09:25:29 -04:00
Matthias Clasen
5c1b3a0263 Move date tests to the test framework 2010-06-23 09:25:29 -04:00
Milan Bouchet-Valat
b116838da3 Improve documentation for g_strcmp0()
Be more explicit about the handling of two NULL pointers.

https://bugzilla.gnome.org/show_bug.cgi?id=622480
2010-06-23 14:35:42 +02:00
Ryan Lortie
16c2f08049 Add single include guards to gvariant[type].h 2010-06-22 08:10:05 -04:00
Tor Lillqvist
05354cefc5 Make the protocol.c test program compile on Windows
Note that it does not actually work, though. Maybe because
g_io_channel_set_flags() is not implemented for file descriptor based
GIOChannels on Windows.
2010-06-22 12:41:01 +03:00
Matthias Clasen
045c96b71a Add a test for g_strip_prefix 2010-06-21 23:08:01 -04:00
Matthias Clasen
2f438f18ae Move hash tests to the test framework 2010-06-21 23:08:01 -04:00
Matthias Clasen
7d14b5fbf1 Some more tests 2010-06-21 23:08:01 -04:00
Matthias Clasen
5629366c3d Move checksum tests to the test framework 2010-06-21 23:08:01 -04:00
Matthias Clasen
839078ea63 Add some more Unicode tests 2010-06-21 23:08:01 -04:00
Ryan Lortie
a4b42d3a75 .gitignore the moved tests 2010-06-21 13:57:54 -04:00
Ryan Lortie
c9553af68f Use -Bsymbolic-functions, drop g*alias PLT hackery
This is a minimal patch-out of the galias functionality.  We will do a
release like this so that we can easily back it out if there are
reported problems.

A more substantial cleanup (mostly removing #includes from every file)
will follow if there are no issues.
2010-06-21 13:55:28 -04:00
Sven Herzberg
6c02c99df0 don't treat debug/info/message as fatal messages by default
* glib/gtestutils.c: don't treat non-fatal messages as errors
* glib/tests/.gitignore: silence
* glib/tests/Makefile.am: updated
* glib/tests/protocol.c: add a test for the message treatment
2010-06-21 12:34:44 +02:00
Matthias Clasen
60a5b19799 Add a test for g_unichar_validate 2010-06-21 00:00:51 -04:00
Matthias Clasen
f13618623b Test inplace decoding 2010-06-20 23:46:01 -04:00
Matthias Clasen
db5bd7b90b Some more utf8 tests 2010-06-20 23:35:31 -04:00
Matthias Clasen
a2f4564fd9 Test glib_check_version 2010-06-20 23:07:39 -04:00
Matthias Clasen
bad7f1e54f Some fixes 2010-06-20 22:18:30 -04:00
Matthias Clasen
7bea2a7a4f Move utf8 validation tests to the test framework 2010-06-20 21:16:24 -04:00
Matthias Clasen
5b08ef84e4 Move utf8 pointer tests to test framework 2010-06-20 21:04:47 -04:00
Matthias Clasen
0ed575213b Consolide base64 tests in a single file 2010-06-20 16:53:39 -04:00
Matthias Clasen
08d6e535be Move scanner tests to glib/tests 2010-06-20 16:53:38 -04:00
Ryan Lortie
87df095de3 GVariant: fix doc copy/paste error 2010-06-20 12:32:00 -04:00
Ryan Lortie
ede159ec45 Add enum type for GVariantParseError 2010-06-20 12:31:37 -04:00
Matthias Clasen
09aa2e79ab Move sequence tests to the test framework 2010-06-20 12:23:13 -04:00
Matthias Clasen
bf8ce25216 Move base64 tests of to test framework 2010-06-20 11:34:31 -04:00
Matthias Clasen
f849dbac05 Move regex tests to the g_test framework 2010-06-20 11:20:54 -04:00
Matthias Clasen
85621f1a0f Update the include pcre to 8.02 2010-06-20 01:46:35 -04:00
Matthias Clasen
b0b7aeffc0 Add Unicode 5.2 scripts 2010-06-20 01:14:55 -04:00
Matthias Clasen
5fffa39b6a Fix a memory leak in g_ptr_array_remove_index_fast
We need to call the element_free_func even if we remove the
last element. Bug #618866.
2010-06-20 00:15:31 -04:00
Christian Persch
052ef2614a Add g_variant_is_floating 2010-06-19 19:07:36 +02:00
Ryan Lortie
f2ae621777 Revert "GVariant: add g_variant_default_value()"
This reverts commit b205dc77cb.

We decided to go the other route with the GParamSpec.
2010-06-17 14:58:46 -04:00
Ryan Lortie
4275c68c30 GVariant serialiser: fix small type error 2010-06-16 18:22:48 -04:00
Ryan Lortie
b205dc77cb GVariant: add g_variant_default_value()
Returns various kinds of false, zero, empty arrays, etc.
2010-06-16 15:58:53 -04:00
Christian Persch
1b8ee5196e Sprinkle some $(AM_V_GEN) around to make the build more silent. 2010-06-15 22:01:02 -04:00
Emmanuele Bassi
6d1d9cf1b5 gobject: Add GBinding
GBinding is a simple, opaque object that represents a binding between a
property on a GObject instance (source) and property on another GObject
instance (target).

https://bugzilla.gnome.org/show_bug.cgi?id=348080
2010-06-15 16:06:18 +01:00
Matthias Clasen
08f473ffef Prevent division by zero if no tests 2010-06-15 02:01:16 -04:00
Matthias Clasen
53f70ac43b Forgotten file 2010-06-15 01:50:15 -04:00
Robert Collins
f9e8b5d9d4 Add subunit support to gtester-report
This patch adds subunit support to gtester-report via a -s switch. Subunit
(https://launchpad.net/subunit) is a language neutral test activity protocol.
This can be used to integrate gtester tests with the Hudson CI tool amongst
other things.

Bug #611869.
2010-06-15 01:49:44 -04:00
Robert Collins
8de6d03c44 Use optparse to parse gtester-report commandline options
See bug #611778.
2010-06-15 01:37:27 -04:00
Emmanuele Bassi
ddb9a2f264 Add package and version to the test report XML 2010-06-15 01:31:18 -04:00
Matthias Clasen
9971686b7e Reword a doc comment
To take out some awkward wording.
2010-06-15 00:50:36 -04:00
Ryan Lortie
8d3fea9cff Mention GVariant format string docs from iter docs
It's not entirely clear what @format_string in iter_next() and
iter_loop() should be.  Include a link to the GVariant format string
docs as a hint.
2010-06-10 08:07:34 -04:00
Tor Lillqvist
507c266c3b Plug memory leak on Windows
Intern the string returned from g_win32_getlocale() and then free it.
Fixes bug #621168.
2010-06-10 11:54:35 +03:00
Ryan Lortie
653921e17a g_variant_builder_add_parsed: fix type error
Problem caught by Juan A. Suarez Romero
2010-06-09 12:43:45 -04:00
Matthias Clasen
a0c044b5c6 Make g_assertion_message_error take a const GError*
This was requested in bug 620265.
2010-06-06 16:42:06 -04:00
Javier Jardón
a131beda54 [docs] Improve the g_get_system_config_dirs() docs.
The retrieved list of directories is XDG_CONFIG_DIRS,
Also mention the retrieved directory on Windows: CSIDL_COMMON_APPDATA
2010-06-06 05:26:38 +02:00
Javier Jardón
e08c7b86c4 [docs] Improve the g_get_system_data_dirs() docs.
The retrieved list of directories is XDG_DATA_DIRS
2010-06-06 05:15:22 +02:00
Javier Jardón
07777db60d [docs] Improve the g_get_user_cache_dir() docs
The retrieved directory is XDG_CACHE_HOME on UNIX platforms.
Also mention the retrieved directory on Windows: CSIDL_INTERNET_CACHE.
2010-06-06 05:05:15 +02:00
Javier Jardón
e40b5ae3ef [docs] Improve the g_get_user_data_dir() docs
The retrieved directory is XDG_DATA_HOME on UNIX platforms.
Also mention the retrieved directory on Windows: CSIDL_PERSONAL.
2010-06-06 04:57:46 +02:00
Javier Jardón
b2718ee71a [docs] Improve the g_get_user_config_dir() docs a bit
The retrieved directory is XDG_CONFIG_HOME on UNIX platforms.
Also mention the retrieved directory on Windows: CSIDL_APPDATA.
2010-06-05 18:40:07 +02:00
Ryan Lortie
9562726f35 Bug 620350 - add g_variant_builder_add_parsed()
A delicious blend of g_variant_new_parsed() and
g_variant_builder_add_value().  Now available in a GLib near you.
2010-06-03 11:24:31 +02:00
Ryan Lortie
44db2b6b74 Bug 620349 – utf8ify GVariant printer
Take advantage of our knowledge that GVariant strings are always valid
utf8 when printing and parsing:

  - allow valid printing unicode characters to pass through unescaped

  - escape non-printing characters using \uxxxx or \Uxxxxxxxx format

  - do the same in the parser

  - update existing test cases to use utf8, add a new test case
2010-06-03 09:41:33 +02:00
Milan Bouchet-Valat
3682666140 Annotate GVariant and GSettings _strv() functions
Add GObject introspection annotations so that the length parameter is
correctly detected for g_variant_new_strv(), g_variant_get_strv() and
g_variant_dup_strv(). Also specify that it can be a NULL pointer in
g_variant_get_strv() and g_variant_dup_strv().

For g_settings_set_strv(), detect that a NULL value is allowed, meaning
empty array.

Closes bug #620384.

Signed-off-by: Ryan Lortie <desrt@desrt.ca>
2010-06-02 19:37:30 +02:00
Alexander Larsson
bef9efd0a9 Initial support for dtrace and systemtap
This adds static markers for dtrace, which are also usable
by systemtap. Additionally it adds a tapset for systemtap
that makes it easier to use the static markers.

These are enabled by default.

This initial set of probes is rather limited:

* allocation and free using g_malloc & co
* allocation and free using g_slice
* gquark name tracking (useful for converting quarks to strings in probes)

Notes on naming:

Its traditional with dtrace to use probe names with dashes as
delimiter (slice-alloc). Since dashes are not usable in identifiers
the C code uses double underscores (slice__alloc) which is converted
to dashes in the UI. We follow this for the shared lowlevel probe
names.

Additionally dtrace supports putting a "provider" part in the probe
names which is essentially a namespacing thing. On systemtap this
field is currently ignored (but may be implemented in the future), but
this is not really a problem since in systemtap the probes are
specified by combining the solib file and the marker name, so there
can't really be name conflicts.

For the systemtap tapset highlevel probes we instead use names that
are systemtapish with single dashes as separators.

https://bugzilla.gnome.org/show_bug.cgi?id=606044
2010-05-27 14:51:41 -04:00
Mikhail Zabaluev
c3bc0f4f8f Optimized the overlong sequence check in g_utf8_get_char_extended()
Rather make it branch to get the due sequence length for the resulting
character code, we can as well get the minimum code value in the initial
branching.
2010-05-27 14:00:12 -04:00
Ryan Lortie
e7927faf17 GVariant: One more FreeBSD fix
FreeBSD's malloc() sometimes returns unaligned memory if you are
requesting small sizes.  This can get GVariant into trouble.  For
example, consider the type "mmi" containing the value "just nothing".
According to the type signature, the memory containing this should be
aligned to a boundary of 4 since it might contain an int.  The
serialised size of this value is 1 byte, however, and when you ask
FreeBSD to allocate memory of that size, it knows you can't put an int
into it so it doesn't bother aligning it.

This patch modifies the GVariant serialiser to not assert the alignment
constraint in the case that the size of the serialised data is smaller
than its own alignment requirement.
2010-05-27 11:32:34 -04:00
Ryan Lortie
271997deb5 More alignment-related fixes.
Partial-backout 8a21d8d233.  The
assertions should have remained relaxed since these functions are used
with non-posix_memalign()ed data.
2010-05-27 11:07:19 -04:00
Ryan Lortie
91ec834456 include "config.h" for HAVE_POSIX_MEMALIGN 2010-05-26 17:35:18 -04:00
Ryan Lortie
8a21d8d233 Use aligned memory in GVariant test cases.
The GVariant serialiser works well with non-8-aligned memory, but the
comparison serialiser in the test case depends on memory being
8-aligned.  Use posix_memalign() to get the memory used by this
serialiser.
2010-05-26 17:31:52 -04:00
Colin Walters
ba1163a33c [tests/gvariant] Handle flavored_free(NULL), since flavored_malloc can return NULL 2010-05-26 15:59:36 -04:00
Havoc Pennington
6b53e4826f GSource: add g_source_set_name, g_source_get_name, g_source_set_name_by_id
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
2010-05-25 16:59:22 -04:00
Havoc Pennington
e5696c282e GSource: add g_source_set_name, g_source_get_name, g_source_set_name_by_id
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
2010-05-25 13:45:28 -04:00
Ryan Lortie
a81c2f2c7a GVariant: deal with non-8-aligned malloc()
Closes bug #619585.
2010-05-25 11:26:18 -04:00
Richard Hughes
100df5287d Fix up a typo in the g_variant_builder_add() docs 2010-05-24 17:22:38 +01:00
Christian Persch
41b3f6885d Add g_dc[p]gettext, and use it in gsettings
Avoid using LC_MESSAGES, and just call g_d[c]gettext directly.

Bug #617004.
2010-05-20 21:16:29 +02:00
Ryan Lortie
4967b6d2ab gitignore additions for gdbus, new test cases 2010-05-17 07:16:37 -04:00
Ryan Lortie
c57c61c930 fix glaring inaccuracy in GVariant docs 2010-05-14 17:08:01 +02:00
Sebastian Dröge
936ff022f2 Don't include __bss_start, _edata and _end symbols in the abichecks
They are added by the binutils gold linker.
2010-05-11 06:17:25 +02:00
Robert Bragg
03b5db4477 gtester-report: cope with binaries with no test cases
It's possible that a given binary may conditionally decided not to run
any test cases (e.g. since they are all slow but -m=quick is currently
in use) In this case the xml may contain <testbinary> nodes with no
<testcase> children. This was resulting in a divide by zero when
calculating the green → red color interpolation.

https://bugzilla.gnome.org/show_bug.cgi?id=617914
2010-05-09 16:28:32 +01:00
Simon McVittie
6bea235c8b Support 64bit integers in GKeyFile 2010-05-08 21:30:27 -04:00
Matthias Clasen
c13c36e3b9 Add test for g_get_language_names 2010-05-08 20:58:10 -04:00
Javier Jardón
81e98c399e Clean Glib header #include issues: gthread 2010-05-06 17:42:09 +02:00
Javier Jardón
c7940d8180 Clean Glib header #include issues: gmem 2010-05-06 17:42:09 +02:00
Javier Jardón
21302a741c Clean Glib header #include issues: gtestutils 2010-05-06 17:42:09 +02:00
Javier Jardón
d1642386c9 Clean Glib header #include issues: gasyncqueue 2010-05-06 17:42:09 +02:00
Christian Persch
4c10cad661 Add API to get the compile and match flags from a GRegex
Bug #616967.
2010-05-01 13:57:11 +02:00
Alexander Larsson
270a954b54 Allocate quarks in chunks to avoid overhead and fragmentation
See bug 616720 for some measurements.
2010-04-27 10:12:25 +02:00
Ryan Lortie
cd062e841f docs and glib.symbols update 2010-04-25 20:08:59 -05:00
Ryan Lortie
a52b6f7df2 Add g_variant_{new,get}_byte_array()
Now that strings are strictly utf8 this provides a convenient API for
storing non-utf8 string data.
2010-04-25 19:12:14 -05:00
Ryan Lortie
9eeab5868f GVariant: strings are now utf8
- modify serialiser validation function to enforce utf8 encoding
 - add documentation to g_variant_new_string(), g_variant_get_string(),
   g_variant_dup_string()
 - add 2 new test cases to check that it works
2010-04-25 13:39:20 -05:00
Emmanuele Bassi
38e2273207 Add G_GNUC_DEPRECATED_FOR macro
It would be good, error reporting-wise, to be able to signal which
function should be used instead of a deprecated one. GCC 4.5 added an
optional "message" payload to the deprecated attribute, so that:

  void f1 (void) __attribute__((deprecated("Use f2 instead")));

Will expand to:

  warning: f1 is deprecated: Use f2 instead

Instead of just printing:

  warning: f1 is deprecated

Since we already have a G_GNUC_DEPRECATED macro we should provide a
G_GNUC_DEPRECATED_FOR macro defined as:

  G_GNUC_DEPRECATED_FOR(bar)

Which would expand the deprecation message to "Use bar instead"
automatically. The deprecation message should probably be similar
to what we use in gtk-doc to match up with the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=614965
2010-04-23 15:26:49 +01:00
Matthias Clasen
b2ee97d00d Fix up g_variant_compare addition 2010-04-22 20:49:20 -04:00
Behdad Esfahbod
00a7c2e635 Bug 615379 - g_new macros crash if sizeof(struct_type) == 0 2010-04-22 19:48:45 -04:00
Ryan Lortie
5445ae78c2 Add g_variant_compare() for like basic types 2010-04-20 10:37:58 -04:00
Matthias Clasen
48cd4cbba5 Silence a warning
g_string_insert_len (s, pos, NULL, 0) is a harmless nop, don't
spew warnings in this case.
2010-04-18 23:53:31 -04:00
Lars Ellenberg
bf2719c815 Cast to volatile to avoid warnings from -Wcast-qual
https://bugzilla.gnome.org/show_bug.cgi?id=457641
2010-04-15 19:03:05 +02:00
Ryan Lortie
056326c1e9 g_string_append_len() accept NULL with length == 0 2010-04-15 10:11:30 -04:00
Ryan Lortie
d17f4bee17 GVariant: fix for g_variant_iter_loop() 2010-04-14 23:36:23 -04:00
Ryan Lortie
3349bab022 Add g_return_if_fail()s to g_variant_new_from_data()
also, document that @type must be definite
2010-04-10 22:01:02 -04:00
Behdad Esfahbod
93ea4ab610 Improve docs 2010-03-31 10:55:00 -04:00
Tor Lillqvist
f8470ed55a Fix build breakage on Unix 2010-03-30 20:46:46 +03:00
Tor Lillqvist
1229281d95 Define a public documented type for the struct stat used by g_stat()
Define GStatBuf as the type used by g_stat() and g_lstat(). Replaces
the non-public struct tag _g_stat_struct. Mostly relevant for Windows
where there are several variants of stat-style structs. On POSIX, is
just another name for struct stat.

Actually, also on many POSIX systems there are in fact several
variants of struct stat and corresponding stat() and lstat()
functions, but as g_stat and g_lstat are normally on POSIX just macros
that expand to stat and lstat, this should not cause a problem. It's
only when it's the actual g_stat() or g_lstat() implementation inside
GLib that gets called that one needs to be sure the passed struct is
the same as what GLib expects.)
2010-03-30 19:22:39 +03:00
Ryan Lortie
409a3a61ec GVariant: Stop lexing format strings at :
Lets us parse this successfully: {%s: %s}.
2010-03-26 08:02:17 -05:00
Ryan Lortie
a6c57591c0 Support &s as key of dict entry in format string
Partial fix for bug 613618.
2010-03-23 09:18:28 -05:00
Tor Lillqvist
440713e393 Filter out gatomic-gcc.c from the VS project sources
Instead, explicitly include gatomic.c.
2010-03-22 15:55:11 +02:00
Ryan Lortie
db83dd27c5 Drop { } for favour of { 0, }. 2010-03-21 20:12:18 -05:00
Ryan Lortie
5620f96305 silence some false-alarm uninitialised warnings 2010-03-21 14:17:21 -05:00
Ryan Lortie
6f33038397 gtk-doc fixups 2010-03-21 14:12:48 -05:00
Ryan Lortie
c5a1c95b1f GVariant docs fixes 2010-03-21 13:46:09 -05:00
Ryan Lortie
bf4dbdbf0e merge GVariant parser 2010-03-21 12:55:30 -05:00
Tor Lillqvist
226cc663e4 Avoid much of duplication in lists of source files
Don't keep the lists of source files for libglib, libgobject and
libgio in the VS project files in addition to the canonical location,
the corresponding Makefile.am files.

Instead, generate the corresponding .vcproj files at make dist time
using the C preprocessor, from template files called .vcprojin. We
still list explicitly in the .vcprojin files some of the
Windows-specific source files, and the sources files of gnulib and
pcre.
2010-03-21 16:15:02 +02:00
Tor Lillqvist
2ab76c5b36 Make the GVariant code compile with a non-gcc compiler
In particular, tested with Microsoft Visual C 2008.
2010-03-21 11:22:06 +02:00
Benjamin Otte
2295ba857f The fallback parameter to g_convert_with_fallback() should be const
This patch makes it so.
2010-03-16 16:40:04 +01:00
Ryan Lortie
751feb916a Bug 612502 - build fails on glib/tests/gvariant.c
Fix two problems caught by Tim Rice.

  - non-constant expression used as array size
  - arithmetic on void *
2010-03-15 17:45:02 -04:00
Christian Persch
1953b4087f Use static assert over runtime assert if possible
We can test the these at compile time. Bug #609231.
2010-03-15 15:49:03 -04:00
Ryan Lortie
7e4d88b290 gvariant test: Remove unused variable 2010-03-14 22:27:39 -04:00
Ryan Lortie
9dea0253a3 GVariant: add loading, byteswapping, normalisation 2010-03-14 15:56:18 -04:00
Ryan Lortie
1ac590b7f7 GBuffer: very small cosmetic fix to header file 2010-03-14 15:56:18 -04:00
Ryan Lortie
056feef60b GVariantIter: expand the size of the dummy struct
Will allow for some nice tricks in the future.
2010-03-14 15:56:17 -04:00
Ryan Lortie
5b19345246 Bug 610858 - gvariant test fails sometimes
NaN floating point values get mangled when passing across the function
call ABI on x86 so avoid using them to get rid of spurious failures.

Reported by Christian Persch and reliably reproduced by Emilio Pozuelo
Monfort.
2010-03-12 15:42:22 -05:00
Javier Jardón
1caaa4f591 [docs] Don't reference deprecated functions
Use g_io_add_watch(), g_io_add_watch_full() and
g_source_remove() instead the deprecated gtk_input_add_full(),
gtk_input_remove(), gdk_input_add(), gdk_input_add_full() and
gdk_input_remove()
2010-03-10 05:06:50 +01:00
Ryan Lortie
a85b9c4bad 'default: g_assert_not_reached();' to silence GCC
Closes bug #612327 reported by Claudio Saavedra.
2010-03-09 13:34:00 -05:00
Dagobert Michelsen
89fa967ba1 Use G_STRFUNC instead of explicit gcc-only __PRETTY_FUNC__ 2010-03-09 10:30:06 -05:00
Behdad Esfahbod
c69e6fd837 Cosmetic 2010-03-08 14:33:38 -05:00
Ryan Lortie
6393ca443a distcheck: add gvariant-internal.h to SOURCES 2010-03-08 10:54:23 -05:00
Ryan Lortie
75f761bcaa GVariant variable arguments, tests, cleanups
Merge GVariant variable arguments support and put it under tests.

Also, remove the hack of the test case directly '#include'ing .c files
from glib/.  Instead, create a non-installed gvariant-internal.h that
the tests can include and make the symbols in it visible on the symbol
table of the shared library.  These symbols (as they are present in no
installed header files) are not part of the API of GLib.

Increase test coverage in a few other areas.
2010-03-08 10:31:19 -05:00
Matthias Clasen
42f042d5fb Minor doc clarification
Spell out that g_utf8_strlen() behaves like strlen() wrt. to
termination. Bug 612040.
2010-03-08 00:05:07 -05:00
Ryan Lortie
a9d57e990b .gitignore mem-overflow test 2010-03-07 03:02:08 -05:00
Ryan Lortie
a1b9743e18 Bug 608196 - Overflow-safe g_new family
Remove the macros for the g_malloc_n family -- calls directly to those
functions now always go directly to those functions.

Reimplement the macros for g_new and friends.

Remove the branch that checked for calling g_new() with a constant
n_structs == 1.  With the struct size always known this case will now be
caught under the case that does the inline multiplication and the
multiplication by 1 will be optimised away.
2010-03-06 23:21:27 -05:00
Ryan Lortie
0edd7cb8a1 undef the proper macros to avoid warning message 2010-03-05 15:53:42 -05:00
Behdad Esfahbod
a3420d8713 Add makegalias.pl dep on galias.h and co 2010-03-05 15:48:48 -05:00
Ryan Lortie
7026365db2 g_variant_get_strv: support objects and signatures 2010-03-05 06:14:36 -05:00
Ryan Lortie
118d59ba15 GVariant: fix some refcounting issues 2010-03-05 06:14:26 -05:00
Behdad Esfahbod
f3425cc38d Fix galias build breakage with g_malloc_n macros 2010-03-04 10:39:15 -05:00
Behdad Esfahbod
343cbf25c7 Bug 608196 - Overflow-safe g_new family
New public API:

g_malloc_n
g_malloc0_n
g_realloc_n
g_try_malloc_n
g_try_malloc0_n
g_try_realloc_n
2010-03-03 17:54:49 -05:00
Ryan Lortie
560f518743 GVariantBuilder: loosen assertion check
Don't check that a GVariantBuilder is fully-valid for use when
performing refcounting operations, as these operations may be occuring
after the builder has already been cleared.
2010-03-03 11:38:14 -05:00
Ryan Lortie
fe6e278a87 GVariantBuilder: allow for stack allocation 2010-03-03 03:38:02 -05:00
Ryan Lortie
a3c7406cce GVariantTypeInfo: fix thread safety bug
Issue caught by Michael Meeks.  This patch based on his.

GVariantTypeInfo was dropping the reference count on the TypeInfo
structure before removing it from the hash table.  This means that
another thread could come along and grab the value from the hash table
in the meantime.

Solve this by holding the lock on the table before dropping the
reference.

Also: move the hash table initialisation inside of the lock to remove
the standard double-initialisation race plus a more insidious issue
caused by the fact that we free the hash table once it becomes empty.
2010-02-25 18:13:59 -05:00
Ryan Lortie
1f66523ad3 Fix backward logic in g_return_if_fail(). 2010-02-23 02:00:11 -05:00
Ryan Lortie
360b9b540e GVariant: Improve test coverage. 2010-02-23 01:59:57 -05:00
Ryan Lortie
515434bdcb GVariantIter, GVariantBuilder 2010-02-22 00:39:01 -05:00
Ryan Lortie
b9d728474e Remove redudant check for direct #include gslice.h
This was added before we had a standardised header check and not removed
when the standard check was added.
2010-02-22 00:35:45 -05:00
Matthias Clasen
9a08cd5b04 More distcheck fixes 2010-02-21 20:28:34 -05:00