Commit Graph

966 Commits

Author SHA1 Message Date
Matthias Clasen
2299bcd88d Improve GResourceFile test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
3eeeb7aaa7 Improve gsettings test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
1041fc2190 Improve gdbus test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
df3ac947ac Improve converter test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
354ae1d61c Add tests for remote actions
This improves the GApplication test coverage.
2014-01-01 17:59:21 -05:00
Matthias Clasen
8aeb391a77 Improve GIOModule test coverage
Add a dedicated test for GIOModule.
2014-01-01 17:59:21 -05:00
Matthias Clasen
b5ba22f163 Add a generic property test
This test is inspired by its namesake in GTK+. We instantiate
all types, and check the default values of their properties,
with some exceptions for types that are known not to work.
2014-01-01 17:59:21 -05:00
Matthias Clasen
6c75ba2b90 Add tests for x-content type sniffing
This test exercises the tree matching parts of gcontenttype.c
2014-01-01 17:59:20 -05:00
Matthias Clasen
159459bc2d Simplify fileattributematcher tests a bit
Just use assertions instead of pretty-printed error messages.
2014-01-01 17:59:20 -05:00
Matthias Clasen
3bbfd90880 Improve GApplicationCommandline test coverage
Add tests for many GApplicationCommandline apis to the
existing application tests.
2014-01-01 17:59:20 -05:00
Matthias Clasen
7846d6154a Improve GSubprocess test coverage
Test the synchronous communicate functions.
2014-01-01 17:59:20 -05:00
Matthias Clasen
e021bb9101 Improve GInitable test coverage
This just adds a bit more variety to the uses of GInitiable
in other tests.
2014-01-01 17:59:20 -05:00
Matthias Clasen
864d960d75 More settings backend tests
This adds some more test coverage around writability changes
in the keyfile and delayed settings backends.
2013-12-22 00:44:56 -05:00
Matthias Clasen
3c873e7617 More test coverage for settings backends 2013-12-21 16:49:52 -05:00
Matthias Clasen
dac1ad66eb Improve gsettings test coverage
Deal with corner cases around delay.
2013-12-21 13:22:00 -05:00
Matthias Clasen
fc828c4de8 contenttype tests: better assertions
I recently had to track down why these tests failed. Turned
out that some rogue package on my system had installed mime
types that declared all files with 3 letter names to be
'chemical/x-turbomole-vibrational'.
This change will make it more obvious what is going on by
mentioning the mime types in the assertion message.
2013-12-21 13:22:00 -05:00
Matthias Clasen
6d8ac1125e Slightly improve coverate for notification tests 2013-12-21 13:22:00 -05:00
Matthias Clasen
5ab9e21d7a Improve test coverage for GPropertyAction 2013-12-21 13:22:00 -05:00
Matthias Clasen
f9747d07c8 Test some gsettings corner case
Setting a strv to NULL was not tested before.
2013-12-21 13:22:00 -05:00
Matthias Clasen
5ccdf2b86a Expand the truncate tests
Check that the data is expanded with zeros.
2013-12-15 21:07:12 -05:00
Matthias Clasen
453a69534c Update tests for new truncate behavior 2013-12-15 21:07:12 -05:00
Stef Walter
baed90af43 gdbus-export: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-12-15 21:07:11 -05:00
Stef Walter
db6a297d9e gdbus-auth: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-12-15 21:07:11 -05:00
Matthias Clasen
0b486a49e4 Fix up gsettings test 2013-12-15 18:50:49 -05:00
Ross Lagerwall
3b9ad6e6ef gio: Update GMemoryOutputStream length after truncate
For GMemoryOutputStream, update valid_len when truncating so that
g_memory_output_stream_get_data_size () returns the correct result.

https://bugzilla.gnome.org/show_bug.cgi?id=720080
2013-12-15 11:54:39 -05:00
Matthias Clasen
c34cc2348c Simplify subprocesses in tests
Use the new way of running tests in a subprocess without
registering extra 'subprocess' test cases where appropriate.
2013-12-15 11:50:00 -05:00
Stef Walter
e6456bcfb6 gdbus-connection: Work around race in connection tests
GDBusConnection cleanup is inherently racy due to its use of worker
threads. Put tests that expect a NULL G_BUS_TYPE_SESSION singleton
as the first tests to work around cleanup races.

https://bugzilla.gnome.org/show_bug.cgi?id=719837
2013-12-11 07:32:03 +01:00
Matthias Clasen
a812e110bf Install all test data
The desktop-files directory contains a mimeapps.cache file
that was not installed as data for installed tests, causing
the file measure test to fail only in when installed.
2013-12-01 11:47:00 -05:00
Matthias Clasen
72eae6eddd Improve file measure testcase
Make the testcase compare the byte size to what is reported
by du. Also add a test for the async api, and mak eit test
the progress reporting callback.
2013-11-30 23:10:13 -05:00
Matthias Clasen
b328cae6a9 Add a test for g_file_measure_disk_usage 2013-11-29 00:12:43 -05:00
Colin Walters
7a90c201f7 tests/gsubprocess: Only compare basename of /tmp
Otherwise, we break in Continuous where /tmp == /sysroot/tmp,
and something in the execve() or the kernel will do realpath()
for us.
2013-11-29 04:12:26 +00:00
Matthias Clasen
2cafe37e19 Improve GApplication test coverage
Exercise more of the GActionMap implementation.
2013-11-28 21:57:47 -05:00
Matthias Clasen
5528a0f408 Improve GNotification test coverage 2013-11-28 21:56:48 -05:00
Matthias Clasen
97a06b4252 Improve GSimpleActionGroup test coverage
Add a case that overwrites an existing action.
2013-11-28 21:53:53 -05:00
Matthias Clasen
dbe560ac01 Improve GSettings test coverage
This covers some more GSettingsSchemaKey api.
2013-11-28 16:01:23 -05:00
Matthias Clasen
00ab7790ce Improve GNotification test coverage 2013-11-28 16:01:23 -05:00
Matthias Clasen
a688b2a9c0 Improve test coverage for GSubprocess 2013-11-28 16:01:23 -05:00
Matthias Clasen
f18138a9cf Improve test coverage for gsettings 2013-11-28 16:01:23 -05:00
Matthias Clasen
9a02cfd914 Test new gsettings api
g_settings_get_user_value and g_settings_get_default_value
are now covered.
2013-11-28 16:01:23 -05:00
Matthias Clasen
7d82d6dc5b Test g_subprocess_launcher_spawn
The spawnv variant of this function already had a test, but
spawn was not tested.
2013-11-28 01:36:29 -05:00
Matthias Clasen
4a687ed723 Test some more GSubProcess api
This covers g_subprocess_set_environ, g_subprocess_setenv,
g_subprocess_getenv, and g_subprocess_set_flags.
2013-11-28 01:12:26 -05:00
Matthias Clasen
bd932aa9f8 Add a GAppInfoMonitor test
The test reveals that there's something fishy with this monitor.
One has to call g_app_info_get_all() for it to start working,
and then it only works once.
2013-11-28 00:19:19 -05:00
Matthias Clasen
36a42ab0a5 Add tests for new GAction api
g_action_name_is_valid and g_action_parse_detailed_name are
now covered.
2013-11-27 22:48:06 -05:00
Philip Withnall
c9344fd513 gio/tests: Add a dynamic type check assertion
This shuts up a static analysis false positive, and adds some extra
checking.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=113075
2013-11-27 10:01:30 +00:00
Philip Withnall
32118951ea gio/tests: Add a non-NULL assertion to help static analysis
The static analyser (correctly) considers a type check to fail if the
variable is NULL. In this case, the address must be non-NULL as no error
was thrown by g_socket_connection_get_remote_address(), but the static
analyser doesn’t know this.

Add a non-NULL assertion anyway, both to shut the analyser up, and
because it’s good extra testing.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=113075
2013-11-27 10:01:30 +00:00
Philip Withnall
c9ccc2af91 gio/tests: Add non-NULL assertions to help static analysis
These prevent some false positives from the static analyser which are
caused by it not inspecting the invariants of
g_subprocess_communicate[_utf8]_finish() (i.e. that stdout and
stdout_str will always be set unless an error was returned).

They’re also good testing anyway.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=113075
2013-11-27 10:01:29 +00:00
Philip Withnall
fe004445a4 gio/tests: Fix a g_return_val_if_fail() in a void function
Should be g_return_if_fail() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=113075
2013-11-27 10:01:29 +00:00
Chun-wei Fan
b9322bf9ab gio/tests/memory-output-stream.c: Avoid an uninitialized variable
Be a little bit more careful in regards to initializing a primitive type
variable before passing it by reference, as it could have random stuff
in the variable's address depending on the CRT, such as MSVCR110.DLL,
causing random, invalid stuff being written in that address.

This will fix this test when built with Visual Studio 2012.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-27 08:01:47 +08:00
Matthias Clasen
5efc038e0d Fix up appinfo test
Make it possible to skip the terminal-launching test simply
by setting DISPLAY= . Previously, you had to unset DISPLAY,
which is a little more cumbersome.

https://bugzilla.gnome.org/show_bug.cgi?id=711178
2013-11-23 22:24:51 -05:00
Matthias Clasen
0fc0754e65 Fix up the appinfo test
One testcase was launching appinfo-test from a GAppInfo that
does not have a filename. In this case, the G_LAUNCHED_DESKTOP_FILE
envvar is not exported. Make appinfo-test deal with that, without
spewing warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=711178
2013-11-23 22:21:29 -05:00