Commit Graph

14024 Commits

Author SHA1 Message Date
Matthias Clasen
1ea3405297 Update the documentation for assertion macros
The assertion macros that are part of gtestutils (but not
g_assert) can now be made non-fatal. Update the documentation
to reflect that.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:58 -04:00
Matthias Clasen
a6a8750687 Add a way to make assertions non-fatal
When using test harnesses other than gtester (e.g. using TAP),
it can be suboptimal to have the very first failed assertion
abort the test suite.

This commit adds a g_test_set_nonfatal_assertions() that can
be called in a test binary to change the behaviour of most
assert macros to just call g_test_fail() and continue. We
don't change the behavior of g_assert() and g_assert_not_reached(),
since these to assertion macros are older than GTest, are
widely used outside of testsuites, and will cause compiler
warnings if they loose their noreturn annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:57 -04:00
Matthias Clasen
b63739e60e Add g_assert_true, g_assert_false and g_assert_null
These are just like g_assert(), but using a different entry
point for the message, so we can repurpose them together
with the other assertion macros.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:57 -04:00
Matthias Clasen
a32c9c7e9c Make g_assert and g_assert_not_reached use the same entry point
These two assertion macros are commonly used outside tests,
so we can't repurpose them, as we are going to do with the
other assertion macros in the following commits. This
change is in preparation for that.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:57 -04:00
Matthias Clasen
19aafc4ca4 Support TAP as an output format
Initial support for the Test Anything Protocol for
GTest output. Use the --tap option to get TAP output.
More information about TAP can be found e.g. here:
http://en.wikipedia.org/wiki/Test_Anything_Protocol

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:57 -04:00
Matthias Clasen
69582bf635 Add a function to check test status from the inside
The new g_test_failed() function can be used to find
out if a currently running testcase is already marked
as failed.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:57 -04:00
Matthias Clasen
88eaefb9d5 Add functions to mark tests as skipped or incomplete
We also expand the GTestResult enumeration to include
values for skipped and incomplete tests, and pass that
on when logging a test result.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:56 -04:00
Matthias Clasen
4e6d25f005 Add a GTestResult enumeration
This enumeration will be expanded to introduce more results
in the following commits.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:56 -04:00
Matthias Clasen
8253f98a18 Add start/stop suite log messages
These will be used in the following commits, when
implementing support for TAP as an alternative
test driver protocol.

https://bugzilla.gnome.org/show_bug.cgi?id=692125
2013-08-17 17:25:56 -04:00
Matthias Clasen
de9cf58f65 GApplication: Stop using deprecated api 2013-08-17 17:25:56 -04:00
Matthias Clasen
18accd43f7 Quell a few compiler warnings 2013-08-17 17:25:56 -04:00
Matthias Clasen
5cd169810e Take out an unused line from gdatetime tests
This line was apparently causing build problems on Win64,
and since the only test involving the t_str variable was
already commented out, lets just take this out altogether.

https://bugzilla.gnome.org/show_bug.cgi?id=696970
2013-08-17 13:45:34 -04:00
Stef Walter
409a6db349 Mark up warnings/critical functions for clang analyzer
The clang code analyzer needs to know that functions like g_error
g_critical an g_return_if_fail should be seen by the analyzer in the
same way as g_assert(). That is the analyzer should think they are
fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=700268
2013-08-17 13:40:06 -04:00
Dan Winship
547df5937c GSocket: fix g_socket_bind() allow_reuse semantics
With UDP sockets, g_socket_bind() with allow_reuse=TRUE on Linux
behaved in a way that the documentation didn't suggest, and that
didn't match other OSes. (Specifically, it allowed binding multiple
multicast sockets to the same address.)

Since this behavior is useful, and since allow_reuse didn't have any
other meaning with UDP sockets, update the docs to reflect the Linux
behavior, and make it do the same thing on non-Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=689245
2013-08-17 13:26:42 -04:00
Dan Winship
2ea4af6f01 GSocket: fix broadcast documentation
The :broadcast property only affects sending broadcast packets, not
receiving them.
2013-08-17 13:26:42 -04:00
Robert Ancell
3784927764 Add G_SPAWN_DEFAULT to GSpawnFlags
This is convenient for language bindings, and also makes
invocations of g_spawn functions in C more readable.

https://bugzilla.gnome.org/show_bug.cgi?id=701318
2013-08-17 13:02:25 -04:00
Matthias Clasen
8b3d779d1e Make g_date_time_new check its arguments
The documentation for this function explicitly gives valid
ranges for the arguments and states that out-of-range arguments
will cause NULL to be returned. Only, the code didn't check
the ranges, and crashed instead. Fix that and add a testcase
for invalid arguments. It turns out that the test_z testcase
was providing invalid arguments and relied on g_date_time_new
to return a non-NULL value anyway, so this commit fixes that
testcase as well.

https://bugzilla.gnome.org/show_bug.cgi?id=702674
2013-08-17 12:35:33 -04:00
Ryan Lortie
e70250bbd5 Export __glib_assert_msg
Put __glib_assert_msg in the dynamic symbol table, but not in any public
headers.

This variable is _not_ part of our API but this way debuggers and
automated crash report utilities will be able to access this variable,
even if debug symbols are not available.

https://bugzilla.gnome.org/show_bug.cgi?id=701800
2013-08-17 12:10:23 -04:00
Dan Winship
f550c0dc9d update .gitignores 2013-08-17 10:35:13 -04:00
Dan Winship
fd5b1939bd build: fix dtrace-related warnings
Fix the warnings when compiling and linking the probes files by
calling dtrace with all the -W flags removed from CFLAGS (since dtrace
generates bad C code), and with CC set to "libtool --mode=compile ..."
(so that it will output a proper .lo file and libtool won't warn when
linking it into the .la).

https://bugzilla.gnome.org/show_bug.cgi?id=693335
2013-08-17 10:34:32 -04:00
Dan Winship
5415537edb glib/tests/gdatetime: use UTC time in test_GDateTime_diff()
test_GDateTime_diff() checks that the span from 2009-01-01 to
2010-01-01 is exactly 365 * G_TIME_SPAN_DAY, but it does this using
local time, and so fails if you are in a timezone that is in the
southern hemisphere which only did DST during one of 2008-2009 and
2009-2010 (in which case the year will end up being one hour too long
or too short).

Switch the diff tests to use UTC time instead; there are plenty of
other local time tests already.

https://bugzilla.gnome.org/show_bug.cgi?id=701529
2013-08-17 10:25:26 -04:00
Wouter Bolsterlee
74a5e92076 Updated Dutch translation 2013-08-17 14:58:12 +02:00
Daiki Ueno
a7f2765dba codegen: Treat input file as binary
Under C locale, open() in Python 3 sets the file encoding to ASCII.
As expat looks at encoding="..." in XML declaration, gdbus-codegen can
simply open the input file as binary and let expat decode the content.

https://bugzilla.gnome.org/show_bug.cgi?id=696633
2013-08-17 06:42:02 +02:00
Chun-wei Fan
1e945933d4 config.h.win32.in: Drop unneeded item
...We no longer have the iconv cache code around.
2013-08-16 10:35:19 +08:00
Chun-wei Fan
2ab9e54477 Update config.h.win32.in
Make its entries match the items that are being checked by the autotools
builds in config.h.in.
2013-08-16 10:29:41 +08:00
Colin Walters
4cea6625cb giochannel: Add an out annotation for g_io_channel_read_unichar()
Since it's an output variable.

https://bugzilla.gnome.org/show_bug.cgi?id=704165
2013-08-15 19:45:34 -04:00
Dan Winship
a93d373812 gio/tests/task: fix a race condition in test_run_in_thread()
When running a task in a thread, GTask may still be internally holding
a ref on the task in that thread even after the callback is called in
the original thread (depending on thread scheduling). Fix the test to
handle that by using a weak notify that signals a GCond, and wait for
that GCond from the main thread. (And add a corresponding check to
test_return_on_cancel().)

https://bugzilla.gnome.org/show_bug.cgi?id=705152
2013-08-15 12:43:57 -04:00
Nick Schermer
4b334ef8f1 gobject: Handle ref_count==0 in notify_by_pspec
Just like g_object_notify, check for a zero ref_count in
g_object_notify_by_pspec and leave if it is 0.

This allows using functions in ->finalize() that possibly also
notify a property change on the object.  Previously,
this resulted in an error from g_object_ref.

https://bugzilla.gnome.org/show_bug.cgi?id=705570
2013-08-14 18:11:05 +01:00
Theppitak Karoonboonyanan
62f173f1f3 Updated Thai translation. 2013-08-14 17:07:38 +07:00
Matthias Clasen
844589b03e GSimpleActionGroup: Deprecated redundant API
See https://bugzilla.gnome.org/show_bug.cgi?id=705600
2013-08-13 16:48:51 -04:00
Cosimo Cecchi
a5fd296cc8 themedicon: correctly fallback to symbolic icons
When an icon is requested as symbolic, our generic fallback algorithm
uses fullcolor icons when the specified icon name is not found, treating
the "-symbolic" suffix as another component of the icon name.

Change the algorithm to check beforehand if the icon is symbolic, remove
the suffix if so, and re-add it at the end for all the generated icon
names.

https://bugzilla.gnome.org/show_bug.cgi?id=680926
2013-08-13 17:19:24 +02:00
Aurimas Černius
aa4b9429b4 Updated Lithuanian translation 2013-08-11 21:01:50 +03:00
Kjartan Maraas
0dcb1db7a0 Updated Norwegian bokmål translation 2013-08-08 22:14:04 +02:00
Daniel Mustieles
4ab30c0770 Updated Spanish translation 2013-08-08 11:14:31 +02:00
Ryan Lortie
c235240905 g_get_tmp_dir(): Clean up envars
On UNIX, we should only ever be looking at TMPDIR.

On Windows, we should only ever look at TEMP.

Also, clean up the documentation to better describe what is actually
happening.  The previous docs may have left someone confused about why
this function returns "/var/tmp" on Solaris, even with no TMPDIR set.

https://bugzilla.gnome.org/show_bug.cgi?id=705075
2013-08-04 17:26:05 +02:00
Yaron Shahrabani
05d6175ded Updated Hebrew translation. 2013-08-04 10:31:19 +03:00
Emanuele Aina
66233f1d1b gtype: Fix typo in g_type_class_add_private() error message
https://bugzilla.gnome.org/show_bug.cgi?id=705398
2013-08-04 08:15:30 +02:00
Yuri Myasoedov
9edd65ad99 Updated Russian translation 2013-08-04 09:44:21 +04:00
Sandeep Sheshrao Shedmake
29b2d3b74b Updated Marathi Translations 2013-08-04 08:57:37 +05:30
Marek Černocký
13759f9ce8 Updated Czech translation 2013-08-03 20:05:34 +02:00
Chao-Hsiung Liao
0d99699ee4 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2013-08-03 21:06:46 +08:00
Rafael Ferreira
8c170c565b Updated Brazilian Portuguese translation proofread by Enrico Nicoletto 2013-08-02 23:15:58 -03:00
Fran Diéguez
3d15261a5c Updated Galician translations 2013-08-02 12:16:30 +02:00
Rico Tzschichholz
7c0d527fa6 GMenuModel: Fix typo in annotation 2013-08-01 20:41:50 +02:00
Sweta Kothari
5451265cf4 Updated Gujarati Translations 2013-08-01 13:47:53 +05:30
Daniel Svensson
8a1b553728 gdesktopappinfo: Add missing return value 2013-07-30 18:20:44 -04:00
Nilamdyuti Goswami
097ba61b33 Assamese translation updated 2013-07-30 22:41:25 +05:30
Dan Winship
54a76e24b3 gsocket: fix a cut-and-pasted error message 2013-07-30 09:13:18 -04:00
Matthias Clasen
0f46a48ee3 post-release version bump 2013-07-29 18:07:32 -04:00
Matthias Clasen
1a78bea7ca 2.37.5 2013-07-29 17:19:06 -04:00