Commit Graph

1051 Commits

Author SHA1 Message Date
David Zeuthen
1f6a9f1e2d GDBus: Move "slow" connection test cases into separate test program
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 15:49:04 -04:00
David Zeuthen
f0b04acfd3 GDBusConnection: Avoid callbacks on finalized connection
Turns out that GDBusWorker will issue callbacks (in its own thread)
even after g_dbus_worker_stop() has been called. This would rarely
happen (and unreffing a connection is even rarer) so only saw this bug
occasionally when running the gdbus-connection test case in a loop.

Fix up this issue by maintaining a set of GDBusConnection objects that
are currently "alive" and do nothing in the callbacks if the passed
user_data pointer is not in this set.

Also attempted to fix up a race condition with
_g_object_wait_for_single_ref_do() and its use of GObject toggle
references - for now, just resort to busy waiting, thereby
sidestepping the toggle reference mess altogether.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 15:16:56 -04:00
Ryan Lortie
b4ee303ed6 .gitignore some test cases 2010-09-17 13:26:50 -04:00
Ryan Lortie
2e78d07f86 Add g_data_input_stream_read_upto{,async,finish}
These functions are meant to replace the read_until() flavour, with the
following improvements:

  - consistency between the synchronous and asynchronous versions as to
    if the separator character is read (it never is).

  - support for using a nul byte as a separator character by way of
    addition of a length parameter which allows stop_chars to be treated
    as a byte array rather than a nul-terminated string.

The read_until() functions are not yet formally deprecated, but a note
has been added to the documentation warning not to use them as they will
be in the future.

This is bug #584284.
2010-09-13 13:14:25 -04:00
David Zeuthen
0b74058fa3 Add work-around for Bug 627724
The root problem is with GObject - for now, just work around it in
GDBus. Also include a test-case. See

 https://bugzilla.gnome.org/show_bug.cgi?id=627724

for more information.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-10 16:23:14 -04:00
Ryan Lortie
77e3badcf3 split GSettings.list_items => list_{children,keys}
This is an incompatible public API/ABI change.
2010-09-09 16:42:55 -04:00
David Zeuthen
7c66068544 GDBusMessage: Don't reset serial number when copying
Ryan pointed out that it's safe to do this because we have the
G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag and that it simplifies
how filter functions work.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 15:15:13 -04:00
David Zeuthen
ee945d8f62 GDBusServer: Make ::new-connection return whether the connection was claimed
Otherwise things probably won't work in a garbage-collected world
(consider the trivial GC that never collects garbage).

This commit breaks GDBusServer ABI. No known released software is
using this code.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:02:31 -04:00
David Zeuthen
c3371efcaa Bug 624546 – Modification of GDBusMessage in filter function
Rework filter functions as per

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

This commit breaks ABI. However, this ABI break affects only
applications using filter functions. The only known user of is dconf.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 13:21:35 -04:00
David Zeuthen
67a00658ea GDBusMessage: Make it possible to lock and copy messages
Don't actually use this yet as that will require a couple of
modifications to the filter function signature. This is part of the
bug-fix for

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 12:00:32 -04:00
Emmanuele Bassi
19972a1b57 build: Quench the compiler's thirst for warnings 2010-09-04 18:24:50 +01:00
Christian Persch
db4fb1b115 Plug a mem leak in the gdbus-proxy test
==23341== 65 bytes in 3 blocks are definitely lost in loss record 927 of 1,020
==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23341==    by 0x4057094: g_malloc (gmem.c:134)
==23341==    by 0x40573DB: g_malloc_n (gmem.c:281)
==23341==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
==23341==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==23341==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==23341==    by 0x41240FF: g_object_get (gobject.c:1731)
==23341==    by 0x804C39E: test_basic (gdbus-proxy.c:522)

Bug #628331.
2010-09-03 16:05:28 -04:00
Christian Persch
5de1bf4a91 Plug a mem leak in the gdbus-proxy test
==23341== 85 (24 direct, 61 indirect) bytes in 1 blocks are definitely lost in loss record 900 of 971
==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23341==    by 0x4057094: g_malloc (gmem.c:134)
==23341==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==23341==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==23341==    by 0x403A751: g_error_new_valist (gerror.c:54)
==23341==    by 0x403AAD4: g_set_error (gerror.c:240)
==23341==    by 0x420B807: decode_method_reply (gdbusconnection.c:4774)
==23341==    by 0x420C2BA: g_dbus_connection_call_sync (gdbusconnection.c:5188)
==23341==    by 0x421B7C9: g_dbus_proxy_call_sync (gdbusproxy.c:2477)
==23341==    by 0x804BD89: test_bogus_method_return (gdbus-proxy.c:430)

Bug #628331.
2010-09-03 16:04:29 -04:00
Christian Persch
be33ef85d0 Plug some mem leaks in gdbus-peer test
==29535== 56 (24 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 1,112 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D63A: test_nonce_tcp (gdbus-peer.c:1229)

==29535== 107 (24 direct, 83 indirect) bytes in 1 blocks are definitely lost in loss record 1,188 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D8E8: test_nonce_tcp (gdbus-peer.c:1259)

==29535== 112 (24 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 1,193 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D79A: test_nonce_tcp (gdbus-peer.c:1248)

==29535== 73 (24 direct, 49 indirect) bytes in 1 blocks are definitely lost in loss record 1,152 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804C6CE: test_peer (gdbus-peer.c:803)

Bug #628331.
2010-09-03 16:03:48 -04:00
Christian Persch
3df5866139 Plug a mem leak in the gdbus-peer test
==6793== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 779 of 1,423
==6793==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==6793==    by 0x4057094: g_malloc (gmem.c:134)
==6793==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==6793==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==6793==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==6793==    by 0x412372A: g_object_constructor (gobject.c:1482)
==6793==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==6793==    by 0x4122B93: g_object_new (gobject.c:1178)
==6793==    by 0x41DB4F9: g_unix_fd_list_new (gunixfdlist.c:159)
==6793==    by 0x804AADD: test_interface_method_call (gdbus-peer.c:172)

Bug #628331.
2010-09-03 16:02:11 -04:00
Christian Persch
bd2faedefd Plug a mem leak in network-address test
==4616== 46 (32 direct, 14 indirect) bytes in 1 blocks are definitely lost in loss record 193 of 305
==4616==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==4616==    by 0x4057094: g_malloc (gmem.c:134)
==4616==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==4616==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==4616==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==4616==    by 0x412372A: g_object_constructor (gobject.c:1482)
==4616==    by 0x4123147: g_object_newv (gobject.c:1347)
==4616==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==4616==    by 0x4122BB4: g_object_new (gobject.c:1181)
==4616==    by 0x41B2D0F: g_network_address_new (gnetworkaddress.c:262)
==4616==    by 0x8048A70: test_basic (network-address.c:10)

Bug #628331.
2010-09-03 16:01:10 -04:00
Christian Persch
fa6937603c Plug a mem leak in contexts test
==14059== 96 bytes in 2 blocks are definitely lost in loss record 520 of 543
==14059==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==14059==    by 0x4057094: g_malloc (gmem.c:134)
==14059==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==14059==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==14059==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==14059==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==14059==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==14059==    by 0x411DB93: g_object_new (gobject.c:1178)
==14059==    by 0x42296AF: _g_local_file_input_stream_new (glocalfileinputstream.c:152)
==14059==    by 0x422281F: g_local_file_read (glocalfile.c:1322)
==14059==    by 0x418A8A9: open_read_async_thread (gfile.c:5050)
==14059==    by 0x41B71BB: run_in_thread (gsimpleasyncresult.c:853)
==14059==    by 0x41A5FBC: io_job_thread (gioscheduler.c:181)
==14059==    by 0x407DCDE: g_thread_pool_thread_proxy (gthreadpool.c:314)
==14059==    by 0x407C6B0: g_thread_create_proxy (gthread.c:1897)
==14059==    by 0x57D918: start_thread (pthread_create.c:301)
==14059==    by 0x4C6CBD: clone (clone.S:133)

Bug #628331.
2010-09-03 16:00:15 -04:00
Christian Persch
60349ecc4d Plug mem leaks in contexts test
==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 515 of 547
==2464==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2464==    by 0x4057094: g_malloc (gmem.c:134)
==2464==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2464==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2464==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==2464==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==2464==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==2464==    by 0x411DB93: g_object_new (gobject.c:1178)
==2464==    by 0x4220D74: _g_local_file_new (glocalfile.c:310)
==2464==    by 0x422C897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2464==    by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94)
==2464==    by 0x418C1B6: g_file_new_for_path (gfile.c:5898)
==2464==    by 0x8049509: test1_thread (contexts.c:110)

==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 516 of 547
==2464==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2464==    by 0x4057094: g_malloc (gmem.c:134)
==2464==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2464==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2464==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==2464==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==2464==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==2464==    by 0x411DB93: g_object_new (gobject.c:1178)
==2464==    by 0x4220D74: _g_local_file_new (glocalfile.c:310)
==2464==    by 0x422C897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2464==    by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94)
==2464==    by 0x418C1B6: g_file_new_for_path (gfile.c:5898)
==2464==    by 0x804964D: test_context_independence (contexts.c:144)

Bug #628331.
2010-09-03 15:58:51 -04:00
Christian Persch
e4a6b1dcdc Plug a mem leak in buffered-input-stream test
==2429== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 276 of 355
==2429==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2429==    by 0x4057094: g_malloc (gmem.c:134)
==2429==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2429==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2429==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2429==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2429==    by 0x4175525: g_buffered_input_stream_read_byte (gbufferedinputstream.c:880)
==2429==    by 0x804A21A: test_read_byte (buffered-input-stream.c:153)

Bug #628331.
2010-09-03 15:57:26 -04:00
Christian Persch
01a19dee68 Plug a mem leak in g-icon test
==2428== 256 bytes in 1 blocks are definitely lost in loss record 591 of 604
==2428==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==2428==    by 0x40571A5: g_realloc (gmem.c:181)
==2428==    by 0x4075287: g_string_maybe_expand (gstring.c:395)
==2428==    by 0x40760D8: g_string_insert_c (gstring.c:1049)
==2428==    by 0x4074D41: g_string_append_c_inline (gstring.h:153)
==2428==    by 0x4075B3C: g_string_append_uri_escaped (gstring.c:822)
==2428==    by 0x41A46AC: g_icon_to_string_tokenized (gicon.c:164)
==2428==    by 0x41A498F: g_icon_to_string (gicon.c:252)
==2428==    by 0x8049E1A: test_g_icon_serialize (g-icon.c:222)

Bug #628331.
2010-09-03 15:56:23 -04:00
Christian Persch
e8bdd2cb7a Plug a huge mem leak in data-output-stream test
==12763== 16,777,215 bytes in 1 blocks are possibly lost in loss record 357 of 357
==12763==    at 0x4004F1B: calloc (vg_replace_malloc.c:418)
==12763==    by 0x405711D: g_malloc0 (gmem.c:157)
==12763==    by 0x8048ED6: test_basic (data-output-stream.c:40)

Bug #628331.
2010-09-03 15:55:10 -04:00
Christian Persch
05d6fcf88c Plug a mem leak in data-output-stream test
==2426== 45,034 bytes in 4,094 blocks are definitely lost in loss record 358 of 361
==2426==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2426==    by 0x4057094: g_malloc (gmem.c:134)
==2426==    by 0x40573DB: g_malloc_n (gmem.c:281)
==2426==    by 0x4071ABD: g_strconcat (gstrfuncs.c:315)
==2426==    by 0x804916A: test_read_lines (data-output-stream.c:83)

Bug #628331.
2010-09-03 15:53:56 -04:00
Christian Persch
45331a4640 Plug a mem leak in data-input-stream test
==12351== 45,045 bytes in 4,095 blocks are definitely lost in loss record 377 of 380
==12351==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==12351==    by 0x4057094: g_malloc (gmem.c:134)
==12351==    by 0x40573DB: g_malloc_n (gmem.c:281)
==12351==    by 0x4071ABD: g_strconcat (gstrfuncs.c:315)
==12351==    by 0x8049811: test_read_lines (data-input-stream.c:99)

Bug #628331.
2010-09-03 15:53:05 -04:00
Christian Persch
36c7d95c9c Plug a mem leak in data-input-stream test
==2415== 45,045 bytes in 4,095 blocks are definitely lost in loss record 393 of 399
==2415==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2415==    by 0x4057094: g_malloc (gmem.c:134)
==2415==    by 0x417FC29: g_data_input_stream_read_line (gdatainputstream.c:797)
==2415==    by 0x8049874: test_read_lines (data-input-stream.c:111)

==12088== 360 bytes in 40 blocks are definitely lost in loss record 368 of 381
==12088==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==12088==    by 0x4057094: g_malloc (gmem.c:134)
==12088==    by 0x417FF4C: g_data_input_stream_read_until (gdatainputstream.c:914)
==12088==    by 0x8049B6F: test_read_until (data-input-stream.c:182)

Bug #628331.
2010-09-03 15:47:38 -04:00
Christian Persch
91e3803596 Plug a mem leak in data-input-stream test
==2415== 165 (72 direct, 93 indirect) bytes in 3 blocks are definitely lost in loss record 373 of 399
==2415==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2415==    by 0x4057094: g_malloc (gmem.c:134)
==2415==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2415==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2415==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2415==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2415==    by 0x417ED29: read_data (gdatainputstream.c:309)
==2415==    by 0x417EE9D: g_data_input_stream_read_byte (gdatainputstream.c:344)
==2415==    by 0x8049DEC: test_data_array (data-input-stream.c:263)

Bug #628331.
2010-09-03 15:45:48 -04:00
Christian Persch
31b15451cf Plug a mem leak in readwrite test
==10395== 80 (24 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 529 of 561
==10395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==10395==    by 0x4057094: g_malloc (gmem.c:134)
==10395==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==10395==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==10395==    by 0x403A751: g_error_new_valist (gerror.c:54)
==10395==    by 0x403AAD4: g_set_error (gerror.c:240)
==10395==    by 0x4230328: _g_local_file_output_stream_create (glocalfileoutputstream.c:628)
==10395==    by 0x4227A04: g_local_file_create_readwrite (glocalfile.c:1388)
==10395==    by 0x418974C: g_file_create_readwrite (gfile.c:1784)
==10395==    by 0x8049FCD: test_g_file_create_readwrite (readwrite.c:187)

Bug #628331.
2010-09-03 15:44:28 -04:00
Christian Persch
94102a40f7 Plug some huge mem leaks in converter-stream test
==8564== 24,000,000 bytes in 6 blocks are possibly lost in loss record 592 of 594
==8564==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==8564==    by 0x4057094: g_malloc (gmem.c:134)
==8564==    by 0x804AA37: test_corruption (converter-stream.c:589)
==8564==    by 0x804B05B: test_roundtrip (converter-stream.c:652)

==9459== 25,165,824 bytes in 6 blocks are possibly lost in loss record 593 of 594
==9459==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==9459==    by 0x40571A5: g_realloc (gmem.c:181)
==9459==    by 0x41B08A3: array_resize (gmemoryoutputstream.c:501)
==9459==    by 0x41B0A5D: g_memory_output_stream_write (gmemoryoutputstream.c:578)
==9459==    by 0x41B57EF: g_output_stream_write (goutputstream.c:216)
==9459==    by 0x41B591B: g_output_stream_write_all (goutputstream.c:268)
==9459==    by 0x417D617: flush_buffer (gconverteroutputstream.c:359)
==9459==    by 0x417D958: g_converter_output_stream_write (gconverteroutputstream.c:502)
==9459==    by 0x41B5D7F: g_output_stream_real_splice (goutputstream.c:428)
==9459==    by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380)
==9459==    by 0x804AB10: test_corruption (converter-stream.c:600)

==9785== 25,165,824 bytes in 6 blocks are possibly lost in loss record 592 of 592
==9785==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==9785==    by 0x40571A5: g_realloc (gmem.c:181)
==9785==    by 0x41B08A3: array_resize (gmemoryoutputstream.c:501)
==9785==    by 0x41B0A5D: g_memory_output_stream_write (gmemoryoutputstream.c:578)
==9785==    by 0x41B5D7F: g_output_stream_real_splice (goutputstream.c:428)
==9785==    by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380)
==9785==    by 0x804ADF1: test_corruption (converter-stream.c:622)
==9785==    by 0x804B06C: test_roundtrip (converter-stream.c:652)

Bug #628331.
2010-09-03 15:43:03 -04:00
Christian Persch
24bee1a130 Plug a mem leak in convert-stream test
==7540== 487 (64 direct, 423 indirect) bytes in 2 blocks are definitely lost in loss record 597 of 615
==7540==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==7540==    by 0x4057094: g_malloc (gmem.c:134)
==7540==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==7540==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==7540==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==7540==    by 0x412372A: g_object_constructor (gobject.c:1482)
==7540==    by 0x4123147: g_object_newv (gobject.c:1347)
==7540==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==7540==    by 0x41A756E: g_initable_new_valist (ginitable.c:214)
==7540==    by 0x41A743E: g_initable_new (ginitable.c:138)
==7540==    by 0x417B67A: g_charset_converter_new (gcharsetconverter.c:215)
==7540==    by 0x804B043: test_charset (converter-stream.c:675)

Bug #628331.
2010-09-03 15:40:55 -04:00
Christian Persch
ac8600a14b Plug a mem leak in converter-stream test
==2396== 168 (92 direct, 76 indirect) bytes in 1 blocks are definitely lost in loss record 598 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2396==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2396==    by 0x4123147: g_object_newv (gobject.c:1347)
==2396==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==2396==    by 0x4122BB4: g_object_new (gobject.c:1181)
==2396==    by 0x417C54D: g_converter_input_stream_new (gconverterinputstream.c:204)
==2396==    by 0x804A53E: test_compressor (converter-stream.c:484)

Bug #628331.
2010-09-03 15:39:58 -04:00
Christian Persch
85179745ac Plug a mem leak in converter-stream test
==2396== 66 (24 direct, 42 indirect) bytes in 1 blocks are definitely lost in loss record 565 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2396==    by 0x417BA38: g_charset_converter_convert (gcharsetconverter.c:344)
==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==2396==    by 0x417C9EB: g_converter_input_stream_read (gconverterinputstream.c:403)
==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
==2396==    by 0x41A7B43: g_input_stream_read_all (ginputstream.c:256)
==2396==    by 0x804B0E4: test_charset (converter-stream.c:682)

Bug #628331.
2010-09-03 15:39:07 -04:00
Christian Persch
7ec414229b Plug a mem leak in converter-stream test
==2396== 39 (24 direct, 15 indirect) bytes in 1 blocks are definitely lost in loss record 398 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2396==    by 0x80498F7: g_compressor_converter_convert (converter-stream.c:244)
==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==2396==    by 0x417CBDE: g_converter_input_stream_read (gconverterinputstream.c:460)
==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
==2396==    by 0x804A832: test_compressor (converter-stream.c:545)

Bug #628331.
2010-09-03 15:37:56 -04:00
Christian Persch
d5d277dccf Plug a mem leak in g-file-info test
==2395== 64 bytes in 1 blocks are definitely lost in loss record 381 of 407
==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==2395==    by 0x40571A5: g_realloc (gmem.c:181)
==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
==2395==    by 0x4199AA9: g_file_info_list_attributes (gfileinfo.c:646)
==2395==    by 0x80491CE: test_g_file_info (g-file-info.c:76)

==2395== 132 (64 direct, 68 indirect) bytes in 1 blocks are definitely lost in loss record 396 of 407
==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==2395==    by 0x40571A5: g_realloc (gmem.c:181)
==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
==2395==    by 0x4199A82: g_file_info_list_attributes (gfileinfo.c:642)
==2395==    by 0x80492B7: test_g_file_info (g-file-info.c:86)

Bug #628331.
2010-09-03 15:37:08 -04:00
Christian Persch
35e101fa0a Plug a mem leak in the readwrite test
And use g_assert_[no_]error().

==2392== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 451 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2392==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2392==    by 0x41B7619: g_output_stream_set_pending (goutputstream.c:1198)
==2392==    by 0x41B5799: g_output_stream_write (goutputstream.c:210)
==2392==    by 0x41B590B: g_output_stream_write_all (goutputstream.c:268)
==2392==    by 0x8049B54: verify_iostream (readwrite.c:110)

Bug #628331.
2010-09-03 15:35:44 -04:00
Christian Persch
93d85ade57 Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 369 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x804A2B9: test_g_file_replace_readwrite (readwrite.c:235)

Bug #628331.
2010-09-03 15:34:12 -04:00
Christian Persch
9fba7a43be Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 368 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x8049F23: test_g_file_create_readwrite (readwrite.c:183)

Bug #628331.
2010-09-03 15:33:28 -04:00
Christian Persch
e481bf8bf6 Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 367 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x8049E30: test_g_file_open_readwrite (readwrite.c:153)

Bug #628331.
2010-09-03 15:32:32 -04:00
Christian Persch
689b054b6e Plug a mem leak in the memory-input-stream test
==2389== 84 (44 direct, 40 indirect) bytes in 1 blocks are definitely lost in loss record 299 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2389==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2389==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2389==    by 0x4122B93: g_object_new (gobject.c:1178)
==2389==    by 0x41AF54C: g_memory_input_stream_new (gmemoryinputstream.c:199)
==2389==    by 0x8048BD1: test_read_chunks (memory-input-stream.c:40)

Bug #628331.
2010-09-03 15:31:37 -04:00
Christian Persch
53ae72b926 Plug a mem leak in the memory-input-stream test
==2389== 59 (24 direct, 35 indirect) bytes in 1 blocks are definitely lost in loss record 290 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2389==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2389==    by 0x41AFD15: g_memory_input_stream_truncate (gmemoryinputstream.c:517)
==2389==    by 0x41BAC0F: g_seekable_truncate (gseekable.c:174)
==2389==    by 0x8049595: test_truncate (memory-input-stream.c:123)

Bug #628331.
2010-09-03 15:30:47 -04:00
Christian Persch
6320b04fe9 Plug a mem leak in gsettings test
==2530== 13 bytes in 1 blocks are definitely lost in loss record 373 of 681
==2530==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2530==    by 0x4057094: g_malloc (gmem.c:134)
==2530==    by 0x40573DB: g_malloc_n (gmem.c:281)
==2530==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
==2530==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==2530==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==2530==    by 0x41240FF: g_object_get (gobject.c:1731)
==2530==    by 0x804A4BA: test_basic (gsettings.c:28)

Bug #628331.
2010-09-03 15:29:51 -04:00
Ryan Lortie
846b0b3466 GAction is now an interface
the new class GSimpleAction is the implementation half
2010-08-30 19:26:37 +02:00
Ryan Lortie
6cd62920bb GActionGroup is now an interface
- make GAction.get_state() return a reference
 - fix some leaks/warnings in the tests
 - fix signal propagation in GSimpleActionGroup
2010-08-30 19:26:37 +02:00
Christian Persch
fa671dc5e2 Fix invalid reads
Don't use a guint16* when getting a guint property via g_object_get()!

Bug #628323.
2010-08-30 10:21:43 -04:00
Matthias Clasen
b8ff287167 Disable the 'extra data' test for now 2010-08-30 08:58:31 -04:00
Matthias Clasen
c3135d1d39 Add some more gdbus introspection tests (currently failing) 2010-08-30 08:49:41 -04:00
David Zeuthen
1e7243ad7b Bug 628084 – gdbus-peer fails with assertion
Make it work on systems where /etc/hosts is bigger than 1024 bytes.

https://bugzilla.gnome.org/show_bug.cgi?id=628084

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-27 10:50:03 -04:00
Matthias Clasen
8f40c0e45a Improve GDBus introspection test coverage 2010-08-23 00:38:19 -04:00
David Zeuthen
3ff9894826 Bug 624546 – Modification of GDBusMessage in filter function
Allow modifying a GDBusMessage in a filter function and also add tests
for this. This breaks API but leaves ABI (almost) intact - at least
dconf's GSettings backend (the only big user I know of) will keep
working.

https://bugzilla.gnome.org/show_bug.cgi?id=624546

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-05 20:37:27 -04:00
Matthias Clasen
41ce91d057 Better fix for the build problem
Use gnetworkingprivate.h instead, patch by Emilio Pozuelo Monfort,
bug 627407.
2010-08-21 22:09:32 -04:00
Matthias Clasen
3d01283f69 Make gdbus-peer build on !linux
Based on a patch by Koop Mast, bug 627088.
2010-08-21 22:06:56 -04:00
Matthias Clasen
892f9b6458 Improve test coverage for actions and action groups 2010-08-21 19:18:40 -04:00
Ryan Lortie
5b38bc5ad5 Simplify/fix state logic in GAction, test it. 2010-08-21 17:35:32 -04:00
Dan Winship
8f5ec0dad3 Fix misc compiler warnings in (mostly) test programs 2010-08-19 18:24:53 -04:00
Nicolas Dufresne
e2a90bcb5f Implemented proxy sample code that connect to proxy 2010-08-19 16:32:38 -04:00
Nicolas Dufresne
1094c84238 Implemented proxy sample for all Connectables 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6749ffce59 Added GProxyAddressEnumerator to proxy sample code 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6b1d851cc5 Implemented proxy sample code
Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:36 -04:00
David Zeuthen
7d6a6ca57b Bug 627188 – gdbus-non-socket test occasionally fails
Fix logical bug in test case to avoid race condition between the
client and the server.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-18 13:09:04 -04:00
Ryan Lortie
5db9e5ad58 add GSimpleActionGroup
and a simple test
2010-08-18 02:18:54 -04:00
Ryan Lortie
8014e9c6e6 add testcase for GAction
fix some small bugs it found
2010-08-18 01:55:48 -04:00
Dan Winship
ddad707b85 update gio/tests/.gitignore 2010-08-17 18:38:34 -04:00
Christian Persch
a91a4a420e Plug a mem leak in gdbus-connection test
==26538== 145 (24 direct, 121 indirect) bytes in 1 blocks are definitely lost in loss record 765 of 790
==26538==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==26538==    by 0x405233C: g_malloc (gmem.c:134)
==26538==    by 0x406A57E: g_slice_alloc (gslice.c:836)
==26538==    by 0x406A60C: g_slice_copy (gslice.c:858)
==26538==    by 0x4035C5A: g_error_copy (gerror.c:160)
==26538==    by 0x41B6387: g_simple_async_result_set_from_error (gsimpleasyncresult.c:638)
==26538==    by 0x41FCDEB: g_dbus_connection_call_done (gdbusconnection.c:4808)
==26538==    by 0x41B682E: g_simple_async_result_complete (gsimpleasyncresult.c:762)
==26538==    by 0x41B686A: complete_in_idle_cb (gsimpleasyncresult.c:772)
==26538==    by 0x404DA7C: g_idle_dispatch (gmain.c:4224)
==26538==    by 0x4049FCD: g_main_dispatch (gmain.c:2119)
==26538==    by 0x404B2C1: g_main_context_dispatch (gmain.c:2672)
==26538==    by 0x404B716: g_main_context_iterate (gmain.c:2750)
==26538==    by 0x404BE7F: g_main_loop_run (gmain.c:2958)
==26538==    by 0x804B5CC: test_connection_send (gdbus-connection.c:407)
==26538==    by 0x4073D04: test_case_run (gtestutils.c:1174)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
75563e81c2 Plug a mem leak in gdbus-connection test
==25403== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 603 of 787
==25403==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==25403==    by 0x405233C: g_malloc (gmem.c:134)
==25403==    by 0x406A57E: g_slice_alloc (gslice.c:836)
==25403==    by 0x406A5C3: g_slice_alloc0 (gslice.c:848)
==25403==    by 0x4035B4E: g_error_new_literal (gerror.c:117)
==25403==    by 0x4035ED9: g_set_error_literal (gerror.c:314)
==25403==    by 0x41F6434: g_dbus_connection_close_sync (gdbusconnection.c:1284)
==25403==    by 0x804A861: test_connection_life_cycle (gdbus-connection.c:158)
==25403==    by 0x4073D04: test_case_run (gtestutils.c:1174)
==25403==    by 0x4073FC2: g_test_run_suite_internal (gtestutils.c:1223)
==25403==    by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403==    by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403==    by 0x40741FB: g_test_run_suite (gtestutils.c:1274)
==25403==    by 0x40733E5: g_test_run (gtestutils.c:877)
==25403==    by 0x804DC92: main (gdbus-connection.c:1024)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
a62a2fd8ed Plug a mem leak in the gdbus-connection test
Bug #627182.
2010-08-18 00:13:41 +02:00
Christian Persch
cae86073ea Add GZIP header processing to GZlibCompressor/GZlibDecompressor
Add GZlibCompressor:file-info property. If it contains a non-NULL
GFileInfo, and the compressor is in GZIP mode, the filename and
modification time from the file info are written to the GZIP header
in the output data.

Add GZlibDeompressor:file-info property. If the decompressor is in GZIP
mode, and the GZIP data contains a GZIP header, the filename and
modification time are read from it, stored in a GFileInfo, and the
file-info property is notified.

Bug #617691.
2010-08-17 17:37:32 +02:00
David Zeuthen
8a3a4596e2 Bug 626748 – Use async methods for writing and handle EAGAIN
If sending a lot of data and/or the other peer is not reading it, then
socket buffers can overflow. This is communicated from the kernel by
returning EAGAIN. In GIO, it is modelled by g_output_stream_write()
and g_socket_send_message() returning G_IO_ERROR_WOULD_BLOCK.

It is also problematic that that we're using synchronous IO in the
shared GDBus IO thread. It means that one GDBusConnection can lock up
others.

It turns out that by porting from g_output_stream_write() to
g_output_stream_write_async() we fix the EAGAIN issue. For GSocket, we
still need to handle things manually (by creating a GSource) as
g_socket_send_message() is used.

We check the new behavior in Michael's producer/consumer test case (at
/gdbus/overflow in gdbus-peer.c) added in the last commit.

Also add a test case that sends and receives a 20 MiB message.

Also add a new `transport' G_DBUS_DEBUG option so it is easy to
inspect partial writes:

 $ G_DBUS_DEBUG=transport ./gdbus-connection -p /gdbus/connection/large_message
 [...]
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 0 on a GSocketOutputStream
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 128000 on a GSocketOutputStream
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 256000 on a GSocketOutputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 43669 bytes of message with serial 4 and
        size 20971669 from offset 20928000 on a GSocketOutputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 16 bytes of message with serial 3 and
        size 20971620 to offset 0 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 15984 bytes of message with serial 3 and
        size 20971620 to offset 16 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 16000 bytes of message with serial 3 and
        size 20971620 to offset 16000 from a GSocketInputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 144000 bytes of message with serial 3 and
        size 20971620 to offset 20720000 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 107620 bytes of message with serial 3 and
        size 20971620 to offset 20864000 from a GSocketInputStream
 OK

https://bugzilla.gnome.org/show_bug.cgi?id=626748

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-16 13:54:13 -04:00
Dan Winship
16bafb4799 GSocketClient: add a timeout property
GSocket has a timeout flag now, but when using GSocketClient there was
no way to set the timeout until after connecting (or failing). Fix
that by adding a timeout property to GSocketClient.
2010-08-14 15:26:16 -04:00
Matthias Clasen
e02571e93b Add bug references to some tests 2010-08-13 21:23:23 -04:00
Matthias Clasen
4160c5c74a Add tests for async file replace and load 2010-08-13 19:40:48 -04:00
Matthias Clasen
93bd5298c7 Add an async file create/write/read/delete test 2010-08-13 17:23:44 -04:00
Matthias Clasen
13e55b84eb Run volumemonitor test with local vfs
This is an attempt to stop the test from hanging on some build bots
in build.gnome.org.
2010-08-13 17:23:44 -04:00
David Zeuthen
d344ff9d67 Bug 626841 – Add test-case for non-socket GIOStream
Also fix a couple of bugs so it actually works.

https://bugzilla.gnome.org/show_bug.cgi?id=626841

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-13 14:01:36 -04:00
Michael Meeks
9be94e8899 Add test for EAGAIN overflow in gdbusconnection based on David's test. 2010-08-13 17:56:19 +01:00
Matthias Clasen
5d9d3f0318 Add some async file tests 2010-08-13 12:04:21 -04:00
Matthias Clasen
584787f580 Improve the async result test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
7c129c9011 Improve dbus address test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
8e236f7ec1 Add some more test about gdbus_error apis 2010-08-07 18:55:21 -04:00
Matthias Clasen
402ad1958c Make the closure variants of name owning and watching actually work
The GClosure API is a bit funky (and badly documented), and requires
you to set a marshaller on the closure, and the marshaller has an
implicit 'this' argument, and the caller is reponsible for unsetting
the values after invoking the closure.

I've added some calls of the _with_closures variants to the
gdbus-names test now.
2010-08-07 17:10:17 -04:00
Ryan Lortie
b91f9274d9 Fix volumemonitor test case
Don't blindly g_object_unref() that which may be NULL.
2010-08-06 13:12:20 -04:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
Ryan Lortie
ba0208b3a8 Clean up improper #includes
We have a lot of broken #including going on around the tree.  This has
gone unnoticed due to our sloppy use of -I.
2010-08-06 13:05:18 -04:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00
David Zeuthen
89a1b571ad GDBusMessage: Validate header fields when serializing/deserializing
The D-Bus spec mentions exactly what header fields are required for
various message types. Add tests for this as well.

Also disallow empty interfaces for signals since the D-Bus spec says
this is Verboten already.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 14:38:51 -04:00
David Zeuthen
6f070be65b GDBusMessage: Add a way to get/set byte order of a message
Also use this in the test cases to check that serialization to and
from both big and little endian works.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 13:34:14 -04:00
David Zeuthen
5bd34a820e GDBusMessage: Validate UTF-8 strings when serializing from blob
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 11:26:48 -04:00
Dan Winship
e62bc8e8f6 remove a junk line 2010-08-04 07:36:34 -04:00
David Zeuthen
86d947f01f Fix gdbus-exit-on-close test case
Forgot to update the test case after last commit.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 12:47:07 -04:00
Matthias Clasen
b2715bbc5e Fix a possible deadlock
the FdSource was calling g_cancellable_disconnect while holding the
main context lock, which is bad news if the ::cancelled handler is
trying to get that lock to wake up the mainloop...

Bug 586432
2010-08-03 10:41:21 -04:00
Emmanuele Bassi
b3de028a43 Update the Git ignore files 2010-08-03 14:21:02 +01:00
Ryan Lortie
ca3b7b75bf GSettings: add G_SETTINGS_BIND_INVERT_BOOLEAN flag
When binding a boolean setting to a boolean property, invert the values.
This avoids the requirement for writing a pair of mapping functions for
this extremely common case.

Add a test.

https://bugzilla.gnome.org/show_bug.cgi?id=625833
2010-08-03 02:09:10 -04:00
Matthias Clasen
8246bf4bde Improve gdbus test coverage 2010-07-31 00:13:02 -04:00
Matthias Clasen
5033be80d1 Add a test for g_dbus_proxy_get_cached_property_names 2010-07-30 19:51:22 -04:00
Matthias Clasen
aa196c60df Improve coverage of buffered output stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
ffa938fc65 Improve coverage of credentials tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
670528c187 Improve coverage of converter stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
9794a648a9 Improve coverage of memory stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
620582e59c Remove redundant include 2010-07-30 19:51:20 -04:00
Matthias Clasen
17d4898d75 Improve coverage of icon tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
7710c50fb2 Improve coverage of application tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
758c3216cd Improve coverage of stream tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
c6b0507167 Reenable unix-streams test 2010-07-30 19:51:20 -04:00
Matthias Clasen
04c7abba11 Work around deadlock in unix-streams test 2010-07-30 19:51:20 -04:00
Matthias Clasen
b463b2ea25 Add tests about file associations 2010-07-30 19:51:20 -04:00
Matthias Clasen
13ac9f94fd Add some more GFile tests 2010-07-30 19:51:19 -04:00
Matthias Clasen
8263d691cb Improve compressor test coverage a bit 2010-07-30 19:51:19 -04:00
Matthias Clasen
b77a19f238 Test g_settings_list_schemas 2010-07-30 19:51:19 -04:00
Matthias Clasen
caa9453b72 Fix a warning 2010-07-30 19:51:18 -04:00
Matthias Clasen
d0750c9d6e Don't leak in converter test 2010-07-30 19:51:18 -04:00
Matthias Clasen
63bdeb0dab Fix an icon test 2010-07-30 19:51:17 -04:00
Matthias Clasen
a8f83ea834 Add tests for GNetworkAddress 2010-07-30 19:51:17 -04:00
Matthias Clasen
e103b93694 Drop an unneeded if 2010-07-30 19:51:17 -04:00
Matthias Clasen
9fc3c980cc Add some volume monitor tests
Although not much of this is easily testable.
2010-07-30 19:51:17 -04:00
David Zeuthen
aefc6df6bb Fix gschema-compile test
This was broken by commit 1b5b87bfa0

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 16:30:34 -04:00
David Zeuthen
d2d97a214d Bug 625584 – Crashes application on unref with signal subscription
Don't do too much work in the finalizer - in particular, there's no
need to send RemoveMatch() messages to the bus daemon since we're
going to sever the connection and the bus will garbage collect
anyway. In this case it crashed the process.

Also add a test case that checks that the appropriate GDestroyNotify
callbacks are called when unreffing a connection with either 1)
exported objects; 2) signal subscriptions or 3) filter functions
.. yes, ideally apps would unregister such callbacks before giving up
their ref but that's not how things work :-)

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 16:06:18 -04:00
Ryan Lortie
d5bd531d96 Cleanup the GSettingsBackend API
This is a substantial ABI break.  Rebuild dconf.
2010-07-22 18:39:50 -04:00
Benjamin Otte
dd1d1b3510 tests: Use GPOINTER_TO_SIZE() instead of just casting to guint
a) gcc doesn't like this ("Cast to pointer of different size)
b) It compares only half of the pointer
2010-07-22 21:56:20 +02:00
Ryan Lortie
dc7348b305 Fix very small leak in the GSettings test 2010-07-22 11:49:30 -04:00
Ryan Lortie
23a904fc15 Bug 624991 - GSettings mapping for G_TYPE_STRV
Added default mapping for G_TYPE_STRV based on a patch from Garrett
Regier.

Add a test case.
2010-07-22 11:34:57 -04:00
David Zeuthen
7eba41346e Bug 617483 – Credentials passing
- Make GCredentials instance and class structures private so it can't
   be subclassed and we don't have to worry about ABI compat
   issues. This also allows us to get rid of the GCredentialsPrivate
   struct.

 - Add a GCredentialsType enumeration that is used whenever exchanging
   pointers with the user. This allows us to support OSes with
   multiple native credential types. In particular, it allows
   supporting OSes where the native credential evolves or even changes
   over time.

 - Add g_socket_get_credentials() method.

 - Add tests for g_socket_get_credentials(). Right now this is in the
   GDBus peer-to-peer test case but we can change that later.

 - Move GTcpConnection into a separate gtk-doc page as was already
   half-done with GUnixConnection. Also finish the GUnixConnection
   move and ensure send_credentials() and receive_credentials()
   methods are in the docs. Also nuke comment about GTcpConnection
   being empty compared to its superclass.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 16:34:18 -04:00
David Zeuthen
2be167f57c GDBus: Add support for D-Bus type 'h' (ie. G_VARIANT_TYPE_HANDLE)
This allows sending and receiving D-Bus messages with instances of the
'h' D-Bus type. Unlike libdbus-1's dbus_message_iter_get_basic()
method, g_variant_get_handle() does not return a duplicated unix file
descriptor (that must be closed with close(2)) - instead, it returns
an index that can be used to get/dup the file descriptor from a
GUnixFDList object that can be obtained from the GDBusMessage object.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 11:38:23 -04:00
David Zeuthen
0b2b4deac5 GDBus: Add GDBusSendMessageFlags
This is currently unused but might be useful in the future. For
example, it might be nice with a way to bypass the current queue of
outgoing messages - having a flag enumeration allows us to add a
G_DBUS_SEND_MESSAGE_FLAGS_BYPASS_QUEUE etc. etc.

This commit breaks ABI and API. Users of the (rarely used) API to send
messages will have to port to this new API.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 16:07:57 -04:00
David Zeuthen
7190af4394 GDBus: Remove constness from introspection data structures
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 15:45:27 -04:00
David Zeuthen
4a1c5a1b98 GDBus: Add GDBusSignalFlags and use it in g_dbus_connection_signal_subscribe()
This is currently unused but will probably be useful in the
future. For example, we could have a _ARG0_IS_PATH to specify that
arg0 should be used for arg0path.

This commit breaks API and ABI. Users of
g_dbus_connection_signal_subscribe() will need to port to this new
version.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 15:05:10 -04:00
Ryan Lortie
1a06bd8d3f Update the GDBus subtree example for the new API 2010-07-19 15:03:54 -04:00
David Zeuthen
f30aef9a10 GDBus: Add nonce-tcp: test case
Also fix a couple of TODO items in gdbusaddress.c

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-16 13:22:45 -04:00
Ryan Lortie
8a2d157d49 Bug 624484: GDBusSubtreeDispatchFunc clarification
Pass NULL rather than "/" for the toplevel of a subtree.

Add clarification to the docs about how trees are flat.
2010-07-15 17:32:04 -04:00
Ryan Lortie
e6b5546cf5 Bug 624473: GDBusSubtreeIntrospectFunc return type
Return a NULL terminated C array instead of a GPtrArray

Also, document that %NULL is a permitted return value and clarify its
meaning.

Finally, avoid calling the enumeration function during dispatch when the
G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag was given.
2010-07-15 17:31:59 -04:00
David Zeuthen
48b1fe948c Bug 623810 – Message serialization bug
https://bugzilla.gnome.org/show_bug.cgi?id=623810

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-15 12:20:30 -04:00
David Zeuthen
914b046226 GDBusConnection: Fix up g_dbus_connection_close()
... so it is async, cancelable and returns an error. Also provide a
synchronous version.

This is an API/ABI break but it is expected that only very few
applications use this API.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 12:37:32 -04:00
David Zeuthen
497edd8b40 Bug 623815 – Don't check sender for GDBusProxy objects where name is not set
Based on a patch from Peng Huang <shawn.p.huang@gmail.com>, thanks!

https://bugzilla.gnome.org/show_bug.cgi?id=623815

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 11:19:24 -04:00
Matthias Clasen
c24a29e13b Adapt to recent MLS changes
g_file_query_info returns non-NULL more often now.
2010-07-09 07:24:08 -04:00
Matthias Clasen
5adf506d5b Use proper variables
And also make sure we don't read garbage.
2010-07-08 11:33:21 -04:00
Ryan Lortie
c243905c95 .gitignore updates 2010-07-07 16:52:41 -04:00
Ryan Lortie
d9e90c3894 GVariant: improve bytestring support
- add G_VARIANT_TYPE_BYTESTRING, _BYTESTRING_ARRAY, _STRING_ARRAY

 - remove g_variant_{new,get}_byte_array functions

 - add g_variant_{new,get,dup}_bytestring{,_array} functions

 - remove undocumented support for deserialising arrays of objectpaths
   or signature strngs using g_variant_get_strv()

 - add and document new format strings '^ay', '^&ay', '^aay' and '^a&ay'

 - update GApplication to use the new API

 - update GSettings binding code to use the new API

 - add tests
2010-07-07 16:25:48 -04:00
David Zeuthen
62a1ccf526 Bug 618882 – No way to ensure that a message is sent
Add g_dbus_connection_flush{_finish,sync}().

https://bugzilla.gnome.org/show_bug.cgi?id=618882

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 15:03:03 -04:00
David Zeuthen
acc9bb2403 GDBus: Only rewrite serial number if g_dbus_message_get_serial() returns 0
While this a dangerous thing to allow (collissions, reply_serial not
matching up etc.), the added flexibility makes this a good trade-off -
for example, with this feature, it's now a lot easier to build message
routers.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 11:06:23 -04:00
Matthias Clasen
bad9a3718e Clear the buffer initially 2010-07-07 01:00:58 -04:00
David Zeuthen
ef29644063 GDBus: Properly handle empty address strings
Changes this error

 DBUS_SESSION_BUS_ADDRESS= \
 gdbus introspect --session \
                  --dest org.freedesktop.DBus \
                  --object-path /org/freedesktop/DBus
 **
 GLib-GIO:ERROR:gdbusaddress.c:913:g_dbus_address_get_stream_sync: assertion failed: (last_error != NULL)
 Aborted (core dumped)

to

 DBUS_SESSION_BUS_ADDRESS= \
 gdbus introspect --session \
                  --dest org.freedesktop.DBus \
                  --object-path /org/freedesktop/DBus
 Error connecting: The given address is empty

which is much more preferable.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-06 17:03:36 -04:00
Matthias Clasen
fb02422404 Test charset conversion with fallbacks 2010-07-05 23:13:17 -04:00
Matthias Clasen
20dca5935c Add several more settings tests 2010-07-05 23:13:17 -04:00
Matthias Clasen
c6e8d0ada8 Fix icons test to compile 2010-07-05 23:13:17 -04:00
Matthias Clasen
81a0a26813 Test enum mapping 2010-07-05 23:13:17 -04:00
Matthias Clasen
2764b75d53 More stream tests 2010-07-05 23:13:17 -04:00
Matthias Clasen
10b2606af5 Add more checks 2010-07-05 23:13:16 -04:00
Matthias Clasen
aec652677b Add some buffered output tests 2010-07-05 23:13:16 -04:00
Matthias Clasen
4ab9b708c0 Add some more tests for the buffered read code 2010-07-05 23:13:16 -04:00
Matthias Clasen
dea042b855 Misc test additions 2010-07-05 03:09:36 -04:00
Matthias Clasen
c53c701e53 Cleanups 2010-07-05 00:56:12 -04:00
Matthias Clasen
f90eb144d4 Add some more tests 2010-07-04 23:42:07 -04:00
Matthias Clasen
74fbd3296d Add some GAppLaunchContext tests 2010-07-04 23:41:40 -04:00
Matthias Clasen
c915c68b6b Add the new tests to the correct variable 2010-07-04 23:40:42 -04:00
Matthias Clasen
14db75381e Add some contenttype tests 2010-07-04 22:27:01 -04:00
Matthias Clasen
fb120b5d87 Add a test for skipping 2010-07-04 20:51:06 -04:00
Matthias Clasen
9788c4c7e6 Add some CharsetConverter tests 2010-07-04 20:51:06 -04:00
Matthias Clasen
401fa10445 Add some more appinfo tests 2010-07-04 20:51:06 -04:00
Matthias Clasen
9fd1339460 Move GZlibConverter tests 2010-07-03 03:31:24 -04:00
Matthias Clasen
aaba9276f7 Add tests for GIcon 2010-07-03 03:31:07 -04:00
Ryan Lortie
5383c7110f Bug 622124 - implement flags for GSettings
Add a <flags> tag to the schema file format and a flags='' attribute to
go along with.  Add some extra test cases for those.

Add new g_settings_{get,set}_flags() calls and support binding to
GParamSpecFlags properties.  Add test cases.
2010-07-01 19:06:02 -04:00
David Zeuthen
51ed44e7ad GDBus: Fix bug in child enumeration
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-01 13:07:58 -04:00
Ryan Lortie
93bf09a9e7 Use "unix:" instead of tcp in test for now...
Temporarily avoids the issue reported in bug #623306.
2010-07-01 12:55:04 -04:00
David Zeuthen
87fa3a6e75 GDBus: Take a reference to the GDBusInterfaceInfo object
Things will still work fine if the GDBusInterfaceInfo is allocated
statically because if so the ref_count will be -1.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-30 12:19:28 -04:00
David Zeuthen
038d03cd08 Bug 623142 – Ensure ::new-connection runs before processing D-Bus messages
Without this guarantee, peer-to-peer connections are not very
useful. However, with this guarantee it's possible to export objects
in a handler for the GDBusServer::new-connection signal.

There are two caveats with this patch

 - it won't work on message bus connections
 - we don't queue up messages to be written

that can be addresses later if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=623142

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-30 11:51:40 -04:00
Ryan Lortie
3628b0b499 GSettings: add <override>, tests, modify output
Add <override> tag, more tests, and actually output the results of these
new tags to the gschemas.compiled file.
2010-06-29 20:24:39 -04:00
Ryan Lortie
900a756e8f GSettings: new <schema> tags 'extends', 'list-of'
Add support for extends='' and list-of='' tags to the <schema> element.
The attributes are parsed and some sanity-checking is done but currently
nothing happens as a result.

Add some tests.
2010-06-29 15:58:35 -04:00
Ryan Lortie
65fc931fb9 Rework the GSettings keyfile backend 2010-06-24 01:39:12 -04:00
Ryan Lortie
519edcc2b3 fix leaks in the GSettings test case 2010-06-24 00:39:38 -04:00
Dan Winship
d68f8012b2 gio/tests/testapps: Fix source refcounting
Either child_watch_source or timeout_source will already have been
destroyed after we finish the loop, and it's not safe to call
g_source_destroy() on it a second time unless we're still holding a
ref on it.
2010-06-22 15:37:42 -04:00
David Zeuthen
45411ccbe3 Bug 621945 – Filter outgoing messages in GDBusConnection
This patch breaks some rarely-used public API (only known user is
dconf).

This patch is based on work from Peng Huang <shawn.p.huang@gmail.com>.

See https://bugzilla.gnome.org/show_bug.cgi?id=621945

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-21 16:12:23 -04:00
Ryan Lortie
e549bbf664 distcheck fix 2010-06-21 13:25:51 -04:00
Ryan Lortie
a768953760 Fix bug in strinfo
We can't search for a larger needle inside of a smaller haystack, and
unsigned integer subtraction tends to result in very large numbers
rather than small ones.

Add a check for this case and abort out immediately.

Also add a test case (lifted directly from the docs) that demonstrates
the problem.

Issue discovered and tracked down by Milan Bouchet-Valat
2010-06-19 11:41:30 -04:00
Colin Walters
8f5bde679e [GApplication] Add working directory to platform data
https://bugzilla.gnome.org/show_bug.cgi?id=621838
2010-06-18 16:05:00 -04:00
David Zeuthen
79d32c2fc1 GDBusMessage: Fix bug when deserializing a message
See https://bugzilla.gnome.org/show_bug.cgi?id=621838 for the whole
story. The problem was that we ended up reading data from arrays of
arrays when we were just supposed to be aligning the buffers.

Also add a host of debug infrastructure that was needed to find the
root cause. For now it can be turned on only via defining
DEBUG_SERIALIZER. In the future we might want to make it work via
G_DBUS_DEBUG. In a nutshell, the added debug info looks like this

Parsing blob (blob_len = 0x0084 bytes)
  0000: 6c 01 00 01  3c 00 00 00  41 00 00 00  37 00 00 00    l...<...A...7...
  0010: 08 01 67 00  08 61 61 79  61 7b 73 76  7d 00 00 00    ..g..aaya{sv}...
  0020: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
  0030: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
  0040: 4d 65 6d 62  65 72 00 00  00 00 00 00  34 00 00 00    Member......4...
  0050: 03 00 00 00  63 77 64 00  01 73 00 00  23 00 00 00    ....cwd..s..#...
  0060: 2f 68 6f 6d  65 2f 64 61  76 69 64 7a  2f 48 61 63    /home/davidz/Hac
  0070: 6b 69 6e 67  2f 67 6c 69  62 2f 67 69  6f 2f 74 65    king/glib/gio/te
  0080: 73 74 73 00                                           sts.

Parsing headers (blob_len = 0x0084 bytes)
  Reading type a{yv} from offset 0x000c: array spans 0x0037 bytes
    Reading type {yv} from offset 0x0010
      Reading type y from offset 0x0010: 0x08 '
      Reading type v from offset 0x0011
        Reading type g from offset 0x0014: 'aaya{sv}'
    Reading type {yv} from offset 0x001e
      Reading type y from offset 0x0020: 0x01 ''
      Reading type v from offset 0x0021
        Reading type o from offset 0x0024: '/foo/bar'
    Reading type {yv} from offset 0x0031
      Reading type y from offset 0x0038: 0x03 ''
      Reading type v from offset 0x0039
        Reading type s from offset 0x003c: 'Member'
Parsing body (blob_len = 0x0084 bytes)
  Reading type (aaya{sv}) from offset 0x0047
    Reading type aay from offset 0x0048: array spans 0x0000 bytes
    Reading type a{sv} from offset 0x004c: array spans 0x0034 bytes
      Reading type {sv} from offset 0x0050
        Reading type s from offset 0x0050: 'cwd'
        Reading type v from offset 0x0058
          Reading type s from offset 0x005b: '/home/davidz/Hacking/glib/gio/tests'
OK

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-17 18:01:32 -04:00
Ryan Lortie
58e000d301 Only run the schema compiler from the test cases 2010-06-17 14:33:50 -04:00
Ryan Lortie
6c3ae976e6 Bug 621266 - GSettings "context" clarification
Remove the concept of "context" in favour of dealing with
GSettingsBackend directly.
2010-06-17 14:05:40 -04:00
Ryan Lortie
d352ec2bf3 GSettings-related distcheck fixups 2010-06-17 10:50:47 -04:00
Ryan Lortie
fc538894d3 GSettings: enum/choices/aliases/range test cases
Fix a small bug that one of the tests uncovered.
2010-06-17 00:03:44 -04:00
Ryan Lortie
597290d5c8 GSettings: major refactor. Add enums, range. 2010-06-16 18:17:53 -04:00
Colin Walters
102c5f6a7d Rework GApplication API to use GInitable
https://bugzilla.gnome.org/show_bug.cgi?id=620952
2010-06-16 11:13:43 -04:00
Emmanuele Bassi
25ba90ffdd Add gdbus-proxy-well-known-name to the ignore file 2010-06-16 15:09:33 +01:00
Hib Eris
b079d6a546 Use native glib-compile-schemas when cross compiling 2010-06-15 00:38:35 -04:00
Colin Walters
85210bcf9b Switch to using variants for timestamps, split out signals
Like how we're handling activation, use GVariant for timestamps.  To
avoid polluting the GtkApplication API with GVariants, we rename the
GApplication signals to "quit-with-data" and "action-with-data".
GtkApplication will then wrap those as just "quit" and "action".

https://bugzilla.gnome.org/show_bug.cgi?id=621002
2010-06-14 16:36:23 -04:00
Matthias Clasen
fdb15058a4 Avoid a race in application registration
We need to register the object before taking the name.
Remove the workarounds for this race from the test suite.
2010-06-13 01:03:10 -04:00
Matthias Clasen
19012ada57 Accept no-reply errors
This can happen if the app quits before the dbus reply can be
sent out.
2010-06-12 01:55:25 -04:00
Matthias Clasen
330cdfbdf1 Make the tests not fall over every other time 2010-06-11 23:21:49 -04:00
David Zeuthen
32f2e9a85b Bug 621213 – GDBusProxy and well-known names
Allow constructing a GDBusProxy for well-known names as discussed here
http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00075.html
including test cases.

Make it possible to create a GDBusProxy for a GBusType instead of a
GDBusConnection. This requires G_BUS_TYPE_NONE so add that too.

Nuke g_bus_watch_proxy() since one can now more or less use GDBusProxy
for this.

Port gdbus-example-watch-proxy to this new API and include this
example in the GDBusProxy doc page.

Also nuke the GType parameter from the GDBusProxy constructors as
requested here: https://bugzilla.gnome.org/show_bug.cgi?id=621229

Also update the porting guide and other API docs for this change.

Also fix a bug in the signal dispatching code so each subscriber only
get notified once, not N times, for the same signal. Also add a test
case for this.

https://bugzilla.gnome.org/show_bug.cgi?id=621213

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-11 18:21:27 -04:00
Ryan Lortie
e0f8d30dea gitignore GApplication test-cases 2010-06-11 14:52:34 -04:00
Christian Dywan
85ea72c0c5 Add a regression test for GConverterOutputStream corruption
See bug #619945 for background
2010-06-11 09:46:47 +02:00
Ryan Lortie
ceee4c21a3 GSettings test case fixes
- call g_settings_sync()
 - fix bug #618715 by not forking if a backend is specified via
   environment variable
2010-06-10 22:35:31 -04:00
Colin Walters
cc19922183 Rewrite apps test to ensure children are killed
Create a function run_with_application that both ensures the
app is running exactly while the test is running, which most
of the tests use.  We start it beforehand, and kill it after.
This avoids having any interdependence between the tests (and
there definitely was before, because we didn't wait for
the process to actually terminate after a kill() call).

Also, open a pipe between the two, and have the child app
monitor that pipe.  If it gets closed (e.g. because the parent
died), the child exits.  This is the most reliable way to
avoid stale children; before, if we failed an assertion, the
parent would abort, and not run kill().

https://bugzilla.gnome.org/show_bug.cgi?id=621034
2010-06-10 13:14:29 -04:00
Matthias Clasen
6720596544 Fix GApplication tests to run without a session bus
We reuse code from the GDBus tests here to launch a session bus.
2010-06-09 23:44:13 -04:00
Juan A. Suarez Romero
67193f55c3 Fix warning
Disable functions defined but not used.
2010-06-09 10:32:36 +02:00
Juan A. Suarez Romero
992e07c8b2 Fix warnings
Do explicit casts to avoid warnings.
2010-06-09 10:32:12 +02:00
Matthias Clasen
c59cc94318 Fix !srcdir checks 2010-06-07 22:10:27 -04:00
Matthias Clasen
6427e93757 Merge the wip/gapplication branch
This adds a GApplication object to GIO, which is the core of
an application support class, supporting
- uniqueness
- exporting actions (simple scripting)
- standard actions (quit, activate)

The implementation for Linux uses D-Bus, takes a name on the
session bus, and exports a org.gtk.Application interface.

Implementations for Win32 and OS X are still missing.
2010-06-07 13:48:42 -04:00
Matthias Clasen
486c46b945 Include the right header 2010-06-07 06:24:28 -04:00
Ryan Lortie
71c5e3f899 Bug 620496 - schema compiler: reject invalid paths
The GSettings schema compiler was accepting any string as a path.  It is
probably quite a common mistake to suspect that '/apps/foo' is a valid
path name when this will cause all sorts of trouble later.  Check for
this case and report the error.
2010-06-07 10:18:43 +02:00
David Zeuthen
eec66b2f94 GDBus: Big-endian fixes
Tested this on my Powerbook G4 12", 867MHz PowerPC G4 running Fedora
11ish.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-25 12:03:27 -04:00
Ryan Lortie
3160bcad6a GDBusConnection.call(): add 'reply_type' argument
This allows the caller to specify the reply type that they are expecting
for this call.  If the reply comes back with the wrong type, GDBus will
generate an appropriate error internally.

  - add a GVariantType * argument to g_dbus_connection_call() and
    _call_sync().

  - move the internal API for computing message types from introspection
    data to be based on GVariantType instead of strings.  Update users
    of this code.

  - have GDBusProxy pass this calculated GVariantType into
    g_dbus_connection_call().  Remove the checks done in GDBusProxy.

  - Update other users of the code (test cases, gdbus-tool, GSettings
    tool, etc).  In some cases, remove redundant checks; in some other
    cases, we are fixing bugs because no checking was done where it
    should have been.

Closes bug #619391.
2010-05-24 17:00:04 -04:00
Tor Lillqvist
a83a9a43ed Most of the gdbus test programs build only on Unix 2010-05-24 11:22:41 +03:00
David Zeuthen
bf24dff88e Return an error for calls into unknown interfaces or unknown objects
Ryan pointed out on IRC that we didn't do anything here. Looking at
the code, it's painfully obvious that we should be returning an error
here since a comment already says that we've exhausted all possible
options.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-21 12:11:04 -04:00
David Zeuthen
366b3ffcde Bug 619142 – Build fixes
- Fix various #include issues

 - Change #error to #warning for the EXTERNAL authentication mechanism.
   It is not clear if this should work on Win32 at all.

 - Call close() before unlink() for the SHA1 keyring

 - Change #error to #warning so we don't forget to do
   permission checking of the .dbus-keyrings directory

 - Use Win32 SID for the SHA1 auth mech

 - Apparently we can't use word 'interface' as an identifier

 - Implement a _g_dbus_win32_get_user_sid() function. For now it's
   private. Don't know if it should be public somewhere. Maybe in
   a future GCredentials support for Win32? I don't know.

 - GFileDescriptorBased is not available on Win32. So avoid using
   it in GLocalFile stuff. Now, Win32 still uses GLocalFile + friends
   (which works with file descriptors) so expose a private function
   to get the fd for an OutputStream so things still work.

 - Fixup gio.symbols

 - Fixup tests/gdbus-peer.c so it builds

With this, at least things compile and the gdbus-peer.exe test case
passes. Which is a great start. I've tested this by cross-compiling on
a x86_64 Fedora 13 host using mingw32 and running the code on a 32-bit
Windows 7 box.

https://bugzilla.gnome.org/show_bug.cgi?id=619142

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-20 10:53:08 -04:00
Ryan Lortie
719e2dcb3b Bug 619031 - method-calls-in-thread test failing
The test was assuming that g_timeout_add() waited for at least the amount of
time given to it before running the function.  This is not the case -- the
function can be run as much as 1ms early.  Make the lower time bound asserted
in the test more permissive to account for this.
2010-05-18 17:25:43 -04:00
Robert Ancell
587bdf3f0a Add missing gunixfdlist.h include in gdbus-example-server.c 2010-05-18 12:01:25 +10:00
Ryan Lortie
4967b6d2ab gitignore additions for gdbus, new test cases 2010-05-17 07:16:37 -04:00
Sebastian Dröge
5d379f1c37 Fix gio tests linking with binutils gold linker 2010-05-16 10:22:10 +02:00
Matthias Clasen
2ed13de153 Fix issues with GSETTINGS_CHECK_RULE
Rename the --schema-files option to --schema-file, since it only
accepts one file at a time. Change the GSETTINGS_CHECK_RULE to
use it that way, too. And also make it work better with !srcdir
builds.

Bugs #616731 and #616864
2010-05-14 21:58:08 -04:00
Christian Persch
661e5ea69f Plug mem leaks in gdbus tests & examples
Use "&s" instead of "s", and free the variant iters after use.

Bug #618663.
2010-05-15 00:12:18 +02:00
David Zeuthen
ddc94bd0a6 GDBus: Remove cached value if a property is invalidated
Also add a test case to catch this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-14 12:56:09 -04:00
David Zeuthen
bb6530eb34 GDBus: Fix serialization of empty arrays
It turns out that we didn't observe padding (neither when reading nor
writing) for empty arrays which (apparently) is needed according to
the D-Bus spec and reference implementation. A simple test case to
provoke this behavior is as follows (notice the lack of 4 bytes worth
of padding at position 0x0064):

 Error calling dbus_message_demarshal() on this blob: org.freedesktop.DBus.Error.InvalidArgs: Message is corrupted (Alignment padding not null)
 0000: 6c 01 00 01  2e 00 00 00  41 00 00 00  37 00 00 00    l.......A...7...
 0010: 08 01 67 00  08 73 61 7b  73 76 7d 61  73 00 00 00    ..g..sa{sv}as...
 0020: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
 0030: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
 0040: 4d 65 6d 62  65 72 00 00  11 00 00 00  30 31 32 33    Member......0123
 0050: 34 35 36 37  38 39 30 31  32 33 34 35  36 00 00 00    4567890123456...
 0060: 00 00 00 00  0e 00 00 00  09 00 00 00  53 6f 6d 65    ............Some
 0070: 74 68 69 6e  67 00                                    thing.

 The blob was generated from the following GVariant value:
 ('01234567890123456', @a{sv} {}, ['Something'])

 If the blob was encoded using DBusMessageIter, the payload would have been:

 0000: 6c 01 00 01  32 00 00 00  41 00 00 00  36 00 00 00    l...2...A...6...
 0010: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
 0020: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
 0030: 4d 65 6d 62  65 72 00 00  08 01 67 00  08 73 61 7b    Member....g..sa{
 0040: 73 76 7d 61  73 00 00 00  11 00 00 00  30 31 32 33    sv}as.......0123
 0050: 34 35 36 37  38 39 30 31  32 33 34 35  36 00 00 00    4567890123456...
 0060: 00 00 00 00  00 00 00 00  0e 00 00 00  09 00 00 00    ................
 0070: 53 6f 6d 65  74 68 69 6e  67 00                       Something.
 ** ERROR:gdbus-serialization.c:547:check_serialization: code should not be reached
 Aborted

and this is now in the libdbus-1-using serialization test case.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-14 12:56:09 -04:00
Matthias Clasen
ee9b16242c another !srcdir build fix 2010-05-14 10:49:03 -04:00
Matthias Clasen
159f533abf More !srcdir build fixes 2010-05-14 10:25:31 -04:00
Matthias Clasen
0540798991 Fix !srcdir build
Thankfully we already had a SRCDIR define.
2010-05-14 01:36:25 -04:00
Matthias Clasen
6223341cac Merge branch 'gdbus-merge'
Conflicts:
	docs/reference/gio/gio-docs.xml
	docs/reference/gio/gio-sections.txt
	gio/tests/Makefile.am
2010-05-13 23:08:34 -04:00
Matthias Clasen
8f89b63930 Clean up platform-specific includes
The problem was pointed out in bug 618029. To solve it, we moved
the GUnixFDList typedef to giotypes.h.
2010-05-13 20:29:04 -04:00
Ryan Lortie
e1fb92551f check for working gettext() before running tests 2010-05-14 01:01:40 +02:00
David Zeuthen
68078ed648 GDBus: Nuke G_BUS_TYPE_NONE 2010-05-13 18:04:48 -04:00
David Zeuthen
0e2c708bb2 GDBus: Don't take a GError for g_dbus_proxy_get_cached_property_names()
We stopped doing this for get_cached_property() so no reason to do it
here.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 17:10:15 -04:00
David Zeuthen
3ca28ef718 GDBus: Update docs for GDBusProxy::g-properties-changed signal
Also update the example. See

https://bugzilla.gnome.org/show_bug.cgi?id=618559

for more details.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 16:57:29 -04:00
David Zeuthen
60e7ae26af GDBus: Add GDBusAuthObserver param in g_dbus_connection_new_for_address()
This is to match g_dbus_connection_new(). This extension allows us to
extend GDBusAuthObserver to also be used in client-side authentication
in the future (right now it's only used on the server-side).
2010-05-13 16:32:11 -04:00
David Zeuthen
cb753dfd49 GDBus: Rename ::deny-authentication-peer to ::authorize-authenticated-peer 2010-05-13 16:20:31 -04:00
David Zeuthen
33952347ff GDBus: Make message serialization routines take capabilities param
This is needed to e.g. allow encoding maybe types (once we add
G_DBUS_CAPABILITY_FLAGS_MAYBE_TYPES) if, and only if, that capability
has been negotiated with the peer (via authentication).
2010-05-13 14:03:58 -04:00
Matthias Clasen
107b4d4bae remove the redundant interface_name parameter 2010-05-13 13:09:58 -04:00
David Zeuthen
82158afdad GDBus: Catch up with new PropertiesChanged signal
After a long discussion, this has finally been standardized in the
D-Bus spec. See

 http://lists.freedesktop.org/archives/dbus/2010-May/012667.html
 http://lists.freedesktop.org/archives/dbus/2010-May/012712.html

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 11:56:15 -04:00
Matthias Clasen
2d75583fb2 Fill out the export section of the migration guide 2010-05-13 01:04:29 -04:00
Matthias Clasen
9a065edf6f Add an example of exporting a GObject
This is more manual work than dbus-glib.
2010-05-13 00:40:41 -04:00
David Zeuthen
9695c23d4c GDBus: Make gdbus(1) print annotations when introspecting data
Also make the gdbus-example-server include some example
annotations. The output looks like this:

$ gdbus introspect --session --dest org.gtk.GDBus.TestServer --object-path /org/gtk/GDBus/TestObject
node /org/gtk/GDBus/TestObject {
  interface org.freedesktop.DBus.Properties {
    methods:
      Get(in  s interface_name,
          in  s property_name,
          out v value);
      GetAll(in  s interface_name,
             out a{sv} properties);
      Set(in  s interface_name,
          in  s property_name,
          in  v value);
    signals:
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties);
  };
  interface org.freedesktop.DBus.Introspectable {
    methods:
      Introspect(out s xml_data);
  };
  interface org.freedesktop.DBus.Peer {
    methods:
      Ping();
      GetMachineId(out s machine_uuid);
  };
  @org.gtk.GDBus.Annotation("OnInterface")
  @org.gtk.GDBus.Annotation("AlsoOnInterface")
  interface org.gtk.GDBus.TestInterface {
    methods:
      @org.gtk.GDBus.Annotation("OnMethod")
      HelloWorld(in  s greeting,
                 out s response);
      EmitSignal(@org.gtk.GDBus.Annotation.("OnArg")
                 in  d speed_in_mph);
      GimmeStdout();
    signals:
      @org.gtk.GDBus.Annotation("Onsignal")
      VelocityChanged(d speed_in_mph,
                      @org.gtk.GDBus.Annotation.("OnArg_NonFirst")
                      s speed_as_string);
    properties:
      @org.gtk.GDBus.Annotation("OnProperty")
        @org.gtk.GDBus.Annotation("OnAnnotation_YesThisIsCrazy")
      readonly s FluxCapicitorName = 'DeLorean';
      readwrite s Title = 'Back To C!';
      readonly s ReadingAlwaysThrowsError;
      readwrite s WritingAlwaysThrowsError = "There's no home like home";
      writeonly s OnlyWritable;
      readonly s Foo = 'Tick';
      readonly s Bar = 'Tock';
  };
};
2010-05-12 22:11:18 -04:00
David Zeuthen
f909cb5b27 GDBusProxy: Remove error in get_cached_property() and add set_cached_property()
This makes it possible to use the cached properties mechanism even if
constructing the proxy with the DO_NOT_LOAD_PROPERTIES flag.

This is useful for cases where you obtain the and track object
properties out-of-band. For example, in udisks, the plan is to have
something like this

 Manager.GetObjects    (out ao paths, out aa{sa{sv}} all_properties);
 Manager.ObjectAdded   (o path, a{sa{sv}} all_properties);
 Manager.ObjectChanged (o path, a{sa{sv}} all_properties);
 Manager.ObjectRemoved (o path, a{sa{sv}} all_properties);

E.g. the first GetObjects() call will return *all* data about *all*
exported objects. Further, this way a client will only need to listen
these three signals (three AddMatch) on the Manager object and it will
never need to do GetAll() etc (e.g. can use DO_NOT_LOAD_PROPERTIES).

(Of course this only works if the client is interested in all
objects... while this is true for udisks it is generally not true for
other D-Bus services).

Also use expected_interface to check for programming errors.
2010-05-12 20:51:06 -04:00
David Zeuthen
d40767fc62 GDBus: Add an example of a GDBusProxy subclass 2010-05-12 15:52:08 -04:00
Jesse van den Kieboom
246db9bfdb Added test cases for g_output_stream_close_async
https://bugzilla.gnome.org/show_bug.cgi?id=617937
2010-05-12 09:21:12 +02:00
Matthias Clasen
54a57bb894 Strip copyright headers from examples
These are included wholesale in the docs, and the copyright
headers make them even more overwhelming. Plus, we don't have
copyright headers on examples anywhere else.
2010-05-11 15:50:19 -04:00
David Zeuthen
7e8b07ae3b GDBus: Use GVariant instead of GHashTable for GDBusProxy::g-properties-changed 2010-05-10 13:31:54 -04:00
David Zeuthen
869b4c6833 GDBus: Use call() instead of invoke_method()
Lots of people been suggesting this. We still use MethodInvocation /
method_invocation for handling incoming method calls so use call()
instead of invoke_method() helps to separate the client and server
facilities. Which is a good thing(tm).
2010-05-10 11:47:08 -04:00
Matthias Clasen
728c4e38e7 More copyright year updates 2010-05-10 08:07:28 -04:00
Dan Winship
af263a3a10 remove broken useless initialization in socket-client/socket-server
https://bugzilla.gnome.org/show_bug.cgi?id=618051
2010-05-07 19:08:13 -04:00
David Zeuthen
46ce134d51 GDBus: Add new symbols to gio.symbols 2010-05-06 17:31:51 -04:00
David Zeuthen
d0a14469d0 Initial GDBus code-drop from GDBus-standalone repo
Things compile and the test-suite passes. Still need to hook up
gio.symbols and docs. There are still a bunch of TODOs left in the
sources that needs to be addressed.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-06 14:21:32 -04:00
Dan Winship
9ba690b386 .gitignore updates for gsettings stuff 2010-04-27 17:04:57 -04:00
Christian Persch
6f7fb3744b Add testcases for <range> and <choices>
Bug #616102.
2010-04-25 20:07:26 -05:00
Tor Lillqvist
da306296cf Can't use stderr as a field name 2010-04-25 17:26:41 +03:00
Matthias Clasen
daa405c191 Rename in more places 2010-04-23 20:05:27 -04:00
Matthias Clasen
ec664445a9 Rename gschema-compile to glib-compile-schemas
And clean up the autofoo a bit: use an uppercase variable,
check for pkg-config, check for presence of glib-compile-schemas.
2010-04-23 17:27:26 -04:00
Dan Winship
29f3e3f766 GSocket: add support for timeouts
Also add options for testing timeouts to socket test programs

https://bugzilla.gnome.org/show_bug.cgi?id=587898
2010-04-23 12:31:31 -04:00
Dan Winship
5b329c506a gio/tests/socket-client, socket-server: fix for win32
The addition of unix socket support broke these on win32
2010-04-23 12:24:30 -04:00
Dan Winship
19d8cc3375 GUnixSocketAddress: handle abstract sockets with non-0-padded names
There are apparently two incompatible ways of naming abstract sockets:
pad the sockaddr with 0s and use the entire thing as the name, or else
don't, and just pass a shorter length value to the relevant functions.
We previously only supported the former method. Add support for the
latter.

Also correctly handle "anonymous" unix sockaddrs (eg, the client side
of a connection, or a socketpair() socket), and add unix domain socket
support to the socket-client and socket-server test programs to make
sure this all works.

https://bugzilla.gnome.org/show_bug.cgi?id=615960
2010-04-22 11:54:41 -04:00
Matthias Clasen
78ed401a51 Add a test for g_settings_get_child 2010-04-21 21:03:53 -04:00
Matthias Clasen
585a37f374 Handle NULL string properties in bindings
Admittely, we just handle them by failing the conversion...
2010-04-21 14:49:05 -04:00
Matthias Clasen
8a988e8e88 Test binding non-readable/writable properties 2010-04-21 12:31:10 -04:00
Bastien Nocera
e63a1a3d6e Fix gschema-compile tests for --schema-files changes 2010-04-21 15:04:28 +01:00
Matthias Clasen
1c2aea7854 Add tests for --allow-any-name 2010-04-21 09:50:42 -04:00
Matthias Clasen
9708431788 Remove leftover test data 2010-04-21 09:34:57 -04:00
Matthias Clasen
c83a976245 Add some more schema compiler tests 2010-04-21 00:43:55 -04:00
Matthias Clasen
afff087785 Simplify gschema-compile test suite
Add --one-schema-file option to gschema-compile to allow easier test
setup. Simplify the test setup.

Bug #616276.
2010-04-20 23:28:49 -04:00
Christian Persch
9488d18a87 Fix gsettings mapping for uint64
Bug #616295.
2010-04-20 19:40:26 -04:00
Matthias Clasen
cd9b8b563f 2.25.0 2010-04-19 17:30:42 -04:00
Matthias Clasen
2d38da0746 Remove misnamed files 2010-04-19 13:28:00 -04:00
Matthias Clasen
0e48b0638d Some tests for gschema-compile
Mostly making sure that we produce reasonable error messages for
typical mistakes.
2010-04-19 13:28:00 -04:00
Javier Jardón
a64625a134 Little fix in gio/test/Makefile.am
This was introduced in
commit 4a605693fc
2010-04-19 17:59:23 +02:00
Matthias Clasen
4a605693fc Don't segfault when <default> is missing
Also add a framework for schema compiler tests.

Fixes bug 616086.
2010-04-19 11:49:12 -04:00
Matthias Clasen
a072c1fc29 Fix up some typos in the new tests 2010-04-19 10:34:22 -04:00
Christian Persch
230038f684 Add testcase for g_settings_bind with [u]int64 properties
And use different values for the doubles test.

All of these fail currently since g_settings_bind default mapping
truncate to glong (eek!).

Bug #616119
2010-04-19 10:00:03 -04:00
Matthias Clasen
69bd033e11 Call setlocale initially
That seems to be required to make bindtextdomain work in the
l10n tests. See bug 616152.
2010-04-19 09:31:31 -04:00
Tor Lillqvist
4523b2b9cd Bypass l10n tests for now on Windows 2010-04-19 16:14:45 +03:00
Tor Lillqvist
a96360ad68 Avoid non-portable <glob.h> API
And thus we can build gschema-compile on all platforms, and run it in
tests.
2010-04-19 15:48:30 +03:00
Tor Lillqvist
df8800e59a Portability improvements
Gschema-compile uses glob which is available on Unix only. Thus can't
run the gschema-compile test except on Unix either.

To avoid an Automake error, comment out the SOURCES and LDADD of
unix-streams which for some reason has been commented out from
TEST_PROGS.

Can't use a Makefile.am target called foo_PROGRAMS for random files
that aren't actually programs, as Automake assumes EXEEXT should be
appended to the file names.
2010-04-19 12:28:44 +03:00
Tor Lillqvist
9af8b83211 Add GWin32InputStream and GWin32OutputStream classes
Correspond to GUnixInputStream and GUnixOutputStream. No true async
support though. But that is how the Win32 API is, for files not
explicitly opened for so-called overlapped IO.

The API to create these streams takes Win32 HANDLEs. Not file
descriptors, because file descriptors are specific to the C library
used. The user code and GLib might be using different C libraries.

Also add a test program for the new classes, and a gio-windows-2.0.pc
file.
2010-04-19 11:54:56 +03:00
Matthias Clasen
626d8ac9e1 More distcheck fixes 2010-04-17 21:31:30 -04:00
Matthias Clasen
187883dc58 add a keyfile test 2010-04-17 21:20:33 -04:00
Matthias Clasen
f07613997c More distcheck fix attempts 2010-04-17 20:54:53 -04:00
Matthias Clasen
3db0f554e4 Some build fixes 2010-04-17 16:57:28 -04:00
Matthias Clasen
137cee425f Correct the sense of an assertion 2010-04-17 16:48:10 -04:00
Matthias Clasen
d2b837df5d Document the tests
Add a short note for each test that explains what it tries to test.
2010-04-17 16:13:22 -04:00
Matthias Clasen
c8a7bb6ccd Merge GSettings tests 2010-04-17 01:48:05 -04:00
Alexander Larsson
2bfddf162e Remove GUtf8InputStream for now
It turns out that the way this worked did not work out for the current
main usecase (gedit) due to issues with how this is best integrated
with GtkTextView. So, in order to not have to support an unused non-ideal
API forever we remove this before its been in a stable release.

The basic feature seems to have some utility though, so we hope for it
to eventually return in a better form.
2010-03-01 09:56:02 +01:00
Emilio Pozuelo Monfort
a7cc500d38 Test for unexisting files in $TMP and not in $HOME
Some buildd environments have an unwritable $HOME, which makes the
test that looks for an unexisting file there fail. Use $TMP instead,
which should be more reliable.

https://bugzilla.gnome.org/show_bug.cgi?id=610860
2010-02-23 18:37:39 +01:00
Emilio Pozuelo Monfort
202d7d37d6 Don't fail a couple of tests when running as root
root can access and write to a directory when it doesn't have
exec and write permissions respectively. So expect the tests that
check that to succeed rather than to fail when running as root.

https://bugzilla.gnome.org/show_bug.cgi?id=552912
2010-02-22 19:54:38 +01:00
Matthias Clasen
bc4f3904f2 Another few failing tests disabled 2010-01-25 12:43:10 -05:00
Matthias Clasen
759fbac7b7 Add properties to GMemoryOutputStream
This helps bindings. Patch by Krzysztof Kosiński. See bug 605733.
2010-01-06 17:37:11 -05:00
Dan Winship
f74c0e257f update .gitignores 2009-12-18 12:27:36 +01:00
Paolo Borelli
cdf00a6a9b Add unit tests for some more methods 2009-12-08 17:05:09 +01:00
Paolo Borelli
568cd48365 Add GUtf8InputStream - Bug #603270
Add a filter input stream that performs utf8 validation.
2009-12-06 15:23:33 +01:00
Matthias Clasen
a4a69df105 Remove filter-cat from TEST_PROGS
Since it is not intended to be run as part of make check.
2009-11-29 20:48:52 -05:00
Paolo Borelli
e7992b7b06 Fix return type of g_converter_[in|out]put_stream.
Fixes bug #603265
2009-11-29 15:14:10 +01:00
Ryan Lortie
3d7edc137e Bug 601637 - add GUnixFDList
change GUnixFDMessage to contain a GUnixFDList.

add test case for GUnixFDMessage and GUnixFDList.

update docs.
2009-11-24 17:55:57 -05:00
Alexander Larsson
2af69f4135 Fix GZlibCompressorFormat names
What used to be called RAW is really the zlib header format.
There is a real "raw" format, so rename the default and add a RAW type.
2009-11-24 13:02:05 +01:00
Alexander Larsson
230745a350 Add filter-cat test for GConverter streams 2009-11-23 16:22:53 +01:00
Alexander Larsson
fce2873641 Add test for converter streams 2009-11-23 16:22:52 +01:00
Javier Jardón
ba0a6e1911 Fix compilation warning: Initialize the variable 2009-11-17 20:44:16 +01:00
Ryan Lortie
3d09b8e09c Bug 591216 - Warning building resolver.o
check result of write system call to quiet compiler warning
2009-11-11 23:21:48 -05:00
Dan Winship
021dd960cf Re-run res_init() when resolv.conf changes
libc caches the contents of resolv.conf, so if it changes (eg, because
the network state changed), we need re-run res_init().

http://bugzilla.gnome.org/show_bug.cgi?id=584246
2009-08-19 12:08:15 -04:00
Dan Winship
45067ab9e9 Fix leaks in GSocketClient and GThreadedResolver
Also update gio/tests/send-data.c to test async connection, and free
more stuff in several tests to make leaks easier to see.
2009-07-23 16:27:01 -04:00
Matthias Clasen
5694ab7642 Revert "Move gio tests from gio/tests/ to tests/gio/"
This reverts commit 2262d76b33.

Move GIO tests back to where they belong.
2009-07-05 22:49:24 -04:00
Benjamin Otte
2262d76b33 Move gio tests from gio/tests/ to tests/gio/
This avoids getting tests built every time when working on libgio and
running make in the gio/ directory.
2009-07-01 19:03:19 +02:00
Dan Winship
65cc5d895a Support g_main_context_push_thread_default() in gio
GFile allows for the possibility that external implementations may not
support thread-default contexts yet, via
g_file_supports_thread_contexts(). GVolumeMonitor is not yet
thread-default-context aware.

Add a test program to verify that basic gio async ops work correctly
in non-default contexts.

http://bugzilla.gnome.org/show_bug.cgi?id=579984
2009-07-01 09:02:46 -04:00
Benjamin Otte
d589da7e86 Bug 587434 – regression tests fail
make this test not only compile, but also run successfully with mad
CFLAGS.
2009-06-30 20:42:14 +02:00
Benjamin Otte
80561f9718 Bug 587434 – regression tests fail
I missed one s/tmpfile/tmp_file/ which caused crashes.
2009-06-30 20:40:52 +02:00
Dan Winship
53beca955e Add GCancellables to GSocket ops
Currently, to implement cancellability correctly, all synchronous
calls to GSocket must be preceded by a g_socket_condition_wait() call,
(even though GSocket does this internally as well) and all
asynchronous calls must do occasional manual
g_cancellable_is_cancelled() checks. Since it's trivial to do these
checks inside GSocket instead, and we don't particularly want to
encourage people to use the APIs non-cancellably, move the
cancellation support into GSocket and simplify the existing callers.

http://bugzilla.gnome.org/show_bug.cgi?id=586797
2009-06-30 11:42:17 -04:00
Benjamin Otte
afd63c3281 fix warnings from gcc compilation with my mad CFLAGS 2009-06-29 18:25:02 +02:00
Matthias Clasen
50a7f53055 Don't use deprecated GLib api
Fixes bug 585673.
2009-06-15 01:12:50 -04:00
Ryan Lortie
4dbc2074bc Add GNIO test cases to .gitignore 2009-06-14 13:58:35 -04:00
Dan Winship
ce6fbd6231 Fix multiple bugs in g_srv_target_list_sort()
In particular, targets with weight 0 should be very UNlikely to be
selected, not very likely, as they were before. However, even ignoring
that bug in the logic, there was an additional bug (swapping list
items would cause the 0-weight items to get re-ordered incorrectly
anyway), and the code contained several fencepost errors.

This patch also adds gio/tests/srvtarget.c, which confirms that for a
sample list of targets, we now generate all possible correct random
sortings and no incorrect sortings, and the correct sortings occur in
roughly the expected proportions (though if the current code is
still wrong, those proportions may be wrong as well).

http://bugzilla.gnome.org/show_bug.cgi?id=583398
2009-06-01 14:31:48 -04:00
Alexander Larsson
6a9df8256a Use G_GSSIZE_FORMAT where needed (#577884) 2009-05-20 14:17:27 +02:00
Alexander Larsson
053f9e72b1 Add support for graceful disconnect to GTcpConnection 2009-05-20 11:19:47 +02:00
Alexander Larsson
fdfdec36d0 Add send-data, a g_socket_client test case 2009-05-19 13:44:11 +02:00
Alexander Larsson
69130db81a Read socket state in g_socket_get_local/remote_address
Previously we saved the location in various places which is unnecessary
and sometimes even wrong. For instance, we saved the address we bound to
which may not have the final port set.
2009-05-19 10:40:27 +02:00
Alexander Larsson
13cb011762 Add max_threads argument to g_threaded_socket_service_new 2009-05-18 08:47:49 +02:00
Alexander Larsson
34e74378c9 Add test apps for highlevel socket classes
echo-server - simple echo server
httpd - simple http server
2009-05-15 21:34:14 +02:00
Alexander Larsson
8f67f47e05 Add test apps for GSocket API 2009-05-15 10:08:18 +02:00
Alexander Larsson
ed08218565 Add tests for local GIOStream GFile ops 2009-05-13 14:42:57 +02:00
Dan Winship
92ac8d165e Misc warning fixes
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
2009-05-01 10:37:45 -04:00
Dan Winship
9a3d18d2a6 GResolver wrappers: GNetworkAddress, GNetworkService, GSocketConnectable
Higher-level wrappers around GResolver. GSocketConnectable provides an
interface for synchronously or asynchronously iterating multiple
socket addresses, with GNetworkAddress and GNetworkService providing
interfaces based on hostname and SRV record resolution.
Part of #548466.
2009-04-22 08:36:38 -04:00
Dan Winship
c94d3f9288 Add GResolver, a glib-ish interface to DNS
GResolver provides asynchronous (and synchronous-but-cancellable) APIs
for resolving hostnames, reverse-resolving IP addresses back to
hostnames, and resolving SRV records. Part of #548466.
2009-04-22 08:36:32 -04:00
Alexander Larsson
b89e432e8d Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as
2009-02-26  Alexander Larsson  <alexl@redhat.com>

	Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as document
        * gmemoryoutputstream.c:
	Track actual valid size, even if we later seek back.

        * tests/memory-output-stream.c:
	Add testcase



svn path=/trunk/; revision=7916
2009-02-26 15:41:29 +00:00
Ryan Lortie
1ee6cc4882 update gitignore
svn path=/trunk/; revision=7887
2009-02-19 17:26:29 +00:00
Ryan Lortie
129e86cf2c Bug 568575 – _async functions for GDataInputStream
2009-01-28  Ryan Lortie  <desrt@desrt.ca>

        Bug 568575 – _async functions for GDataInputStream

        * gdatainputstream.h:
        * gdatainputstream.c: add _async versions of read_line and read_until.
        * gio.symbols:
        * ../docs/reference/gio/gio-sections.txt: add new functions
        * tests/sleepy-stream.c: new test case for async read line
        * tests/Makefile.am: add new test


svn path=/trunk/; revision=7835
2009-01-28 16:39:39 +00:00
Ryan Lortie
a9c978a354 Bug 568394 – dropping the last reference to a stream filter closes the
2009-01-20  Ryan Lortie  <desrt@desrt.ca>

        Bug 568394 – dropping the last reference to a stream filter closes the
        base stream

        * gfilterinputstream.h:
        * gfilterinputstream.c: add "close-base-stream" property and only
        close the base stream if it is true.  issue async close callbacks from
        correct source object.
        * gfilteroutputstream.h:
        * gfilteroutputstream.c: add a "close-base-stream" property and only
        close the base stream if it is true.  issue async close callbacks from
        correct source object.
        * gbufferedoutputstream: check g_filter_output_stream_get_close_base()
        before closing the base stream.  fix invalid source tag comparison in
        close_async (was comparing to flush_async).
        * ../docs/reference/gio/gio-sections.txt:
        * gio.symbols: add
        g_filter_{in,out}put_stream_{g,s}et_close_base_stream
        * tests/filter-streams.c: new test cases
        * tests/Makefile.am: add new test
        * tests/.gitignore: add new test


svn path=/trunk/; revision=7825
2009-01-21 14:09:56 +00:00
Ryan Lortie
481559a031 improve add new simple-async-result test new file to test
2009-01-05  Ryan Lortie  <desrt@desrt.ca>

        * tests/.gitignore: improve
        * tests/Makefile.am: add new simple-async-result test
        * tests/simple-async-result.c: new file to test GSimpleAsyncResult


svn path=/trunk/; revision=7767
2009-01-05 06:58:22 +00:00
Matthias Clasen
649c25f216 2.19.3
svn path=/trunk/; revision=7746
2008-12-15 20:01:49 +00:00
Matthias Clasen
b2f0d44acb Support compilers that don't understand ISO C varargs macros. Patch by
* tests/live-g-file.c: Support compilers that don't understand
        ISO C varargs macros. Patch by Eric Lamarque



svn path=/trunk/; revision=7734
2008-12-08 04:38:54 +00:00
Matthias Clasen
e959473234 Revert behaviour change in g_data_input_stream_read_line
svn path=/trunk/; revision=7720
2008-12-01 19:02:58 +00:00
Matthias Clasen
8b39fa1e6a Comment out two failing tests
svn path=/trunk/; revision=7714
2008-12-01 06:47:04 +00:00
Matthias Clasen
e449a91b98 Bug 547481 – g_data_input_stream_read_line behaves not as stated in the
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 547481 – g_data_input_stream_read_line behaves not as stated in
        the docs

        * gdatainputstream.c (g_data_input_stream_read_line): Behave as
        documented and include the line end in the returned string.
        Pointed out by Paul Pogonyshev.

        * tests/data-input-stream.c: Fix the read_line test to test the
        documented behaviour.



svn path=/trunk/; revision=7694
2008-11-28 07:42:48 +00:00
Matthias Clasen
0b715510de Bug 562393 – g_buffered_input_stream_read_byte broken if data available
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 562393 – g_buffered_input_stream_read_byte broken if data
        available

        * gio/gbufferedinputstream.c (g_buffered_input_stream_read_byte): Fix
        handling of buffered content.  Patch by Philip Withnall

        * gio/tests/buffered-input-stream.c: Add a testcase for this bug.
        * gio/tests/Makefile.am: And build it



svn path=/trunk/; revision=7686
2008-11-28 05:57:07 +00:00
Alexander Larsson
4f0b18d203 Bug 555740 - gicon serialization Based on patch from David Zeuthen
2008-10-21  Alexander Larsson  <alexl@redhat.com>

	Bug 555740 - gicon serialization
	Based on patch from David Zeuthen
	
        * gicon.[ch]:
        * gio.symbols:
	Add g_icon_to_string() and g_icon_new_for_string().
	
        * gemblem.c:
        * gemblemedicon.c:
        * gfileicon.c:
        * gthemedicon.c:
	Implement icon serialization for built-in icon types
	
        * tests/Makefile.am:
        * tests/g-icon.c:
	Added GIcon serialization test



svn path=/trunk/; revision=7618
2008-10-21 11:51:48 +00:00
Matthias Clasen
82c68c6a14 2.19.0
svn path=/trunk/; revision=7611
2008-10-16 23:59:50 +00:00
Matthias Clasen
6310f898b8 Fix gcc warnings
svn path=/trunk/; revision=7585
2008-10-10 04:54:51 +00:00
Tor Lillqvist
402d950ec7 Build desktop-app-info only on Unix.
2008-09-30  Tor Lillqvist  <tml@novell.com>

	* tests/Makefile.am: Build desktop-app-info only on Unix.


svn path=/trunk/; revision=7562
2008-09-30 11:08:38 +00:00
Dan Winship
29ddd48ff2 Use g_assert_error() and g_assert_no_error()
* tests/data-input-stream.c:
	* tests/data-output-stream.c:
	* tests/live-g-file.c:
	* tests/memory-input-stream.c:
	* tests/memory-output-stream.c: Use g_assert_error() and
	g_assert_no_error()

svn path=/trunk/; revision=7556
2008-09-27 01:43:43 +00:00
Matthias Clasen
764e187fd9 Bug 545350 – GAppInfo deletion Bug 545351 – Reset associations for
2008-09-26  Matthias Clasen  <mclasen@redhat.com>

        Bug 545350 – GAppInfo deletion
        Bug 545351 – Reset associations for content type

        * gio.symbols:
        * gappinfo.[hc]: New functions g_app_info_can_delete,
        g_app_info_delete and g_app_info_reset_type_associations.

        * gdesktopappinfo.c:
        * gwin32appinfo.c: Implementations of these.

        * tests/Makefile.am:
        * tests/desktop-app-info.c: Tests for GAppInfo functionality.


svn path=/trunk/; revision=7554
2008-09-26 19:57:36 +00:00
Dan Winship
7f4864e58d Bug 505361 - gunixinputstream.c assumes poll() available
Bug 509446 - portable blocking gio cancellation

	* gcancellable.c (g_cancellable_make_pollfd): New method to make a
	GPollFD for a cancellable (which is slightly more complicated on
	Windows than Unix).

	* gunixinputstream.c (g_unix_input_stream_read):
	* gunixoutputstream.c (g_unix_output_stream_write): Use
	g_cancellable_make_pollfd() and g_poll() rather than using poll()
	directly.

	* tests/unix-streams.c: test of GUnixInputStream,
	GUnixOutputStream, and GCancellable.

svn path=/trunk/; revision=7553
2008-09-26 16:19:35 +00:00
Ryan Lortie
920f3bffb3 Bug 549771 – improved .gitignore for glib
2007-09-02  Ryan Lortie  <desrt@desrt.ca>

        Bug 549771 – improved .gitignore for glib

        * docs/reference/.gitignore:
        * docs/reference/gio/.gitignore:
        * docs/reference/gobject/tmpl/.gitignore:
        * gio/.gitignore:
        * gio/tests/.gitignore:
        * glib/.gitignore:
        * glib/libcharset/.gitignore:
        * glib/tests/.gitignore:
        * gmodule/.gitignore:
        * gobject/.gitignore:
        * gobject/tests/.gitignore:
        * po/.gitignore:
        * tests/.gitignore: new files
        * .gitignore: remove 'build' (since it's part of glib now), add more
        useful things.


svn path=/trunk/; revision=7432
2008-09-02 18:40:39 +00:00
Cody Russell
3d93bf6968 Moved all relevant typedefs into these files.
2008-07-01  Cody Russell  <bratsche@gnome.org>

        * gio/gioenums.h:
        * gio/giotypes.h:
	Moved all relevant typedefs into these	files.

        * gio/*.[ch]:
	Updated wrt added files.

        Split types into separate file	for easier maintainership. (#538564)


svn path=/trunk/; revision=7127
2008-07-01 06:32:35 +00:00
Matthias Clasen
e3313b2651 Add some tests for GMemoryOutputStream.
2008-06-29  Matthias Clasen  <mclasen@redhat.com>

        * tests/Makefile.am:
        * tests/memory-output-stream.c: Add some tests for
        GMemoryOutputStream.

2008-06-29  Matthias Clasen  <mclasen@redhat.com>

        Bug 540423 – unrecoverable error after g_seekable_truncate(seekable,
        0, ...)

        * gmemoryoutputstream.c (array_resize): Handle truncation to
        zero correctly. Reported by Akira Tagoh



svn path=/trunk/; revision=7106
2008-06-30 03:47:27 +00:00
Yevgen Muntyan
e5347891fe Use less fancy unicode filenames, so the test doesn't fail on Mac OS X
2008-06-12  Yevgen Muntyan  <muntyan@tamu.edu>

	* tests/live-g-file.c (sample_struct):
        Use less fancy unicode filenames, so the test doesn't fail
        on Mac OS X (#531476).


svn path=/trunk/; revision=7035
2008-06-13 03:56:26 +00:00
A. Walton
52a03b97c6 Fix broken test case.
2008-06-11  A. Walton  <awalton@gnome.org>

	* tests/g-file.c (test_g_file_new_null):
	Fix broken test case.


svn path=/trunk/; revision=7016
2008-06-11 20:02:31 +00:00
Michael Natterer
03a5797a62 don't define G_DISABLE_SINGLE_INCLUDES, it's in the global CPPFLAGS now.
2008-05-28  Michael Natterer  <mitch@imendio.com>

	* Makefile.am: don't define G_DISABLE_SINGLE_INCLUDES, it's in
	the global CPPFLAGS now.

	* tests/data-input-stream.c
	* tests/data-output-stream.c
	* tests/g-file-info.c
	* tests/g-file.c
	* tests/live-g-file.c
	* tests/memory-input-stream.c: don't include <glib/gtestutils.h>


svn path=/trunk/; revision=6954
2008-05-28 16:17:45 +00:00
Matthias Clasen
e14f918de9 2.17.0
svn path=/trunk/; revision=6948
2008-05-27 21:22:45 +00:00
Matthias Clasen
689a9e4b1a Revert the patch for bug 527214 and related changes. GTimer
is supposed to work without threads.


svn path=/trunk/; revision=6943
2008-05-27 16:00:51 +00:00
Matthias Clasen
cdc2910103 Make tests work
svn path=/trunk/; revision=6935
2008-05-26 05:57:09 +00:00
Tomas Bzatek
15e21178c6 Include live-g-file in standard set of tests, making a temporary directory
2008-03-13  Tomas Bzatek  <tbzatek@redhat.com>

        * tests/live-g-file.c:
        Include live-g-file in standard set of tests, making a temporary
        directory in source structure.

        Clean target directory before the tests (write mode only)


svn path=/trunk/; revision=6699
2008-03-13 16:32:31 +00:00
Alexander Larsson
5241d96b21 Fix sparse warnings (#519489)
2008-03-06  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
        * gfilemonitor.c:
        * gthemedicon.c:
        * gunionvolumemonitor.c:
        * gunixmounts.c:
        * tests/g-file.c:
        * tests/live-g-file.c:
        * xdgmime/xdgmimecache.c:
	Fix sparse warnings (#519489)


svn path=/trunk/; revision=6632
2008-03-06 09:53:35 +00:00
Alexander Larsson
6dc9b7ee00 Add new g_file_has_prefix that does the same as g_file_contains_file.
2008-02-21  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gio.symbols:
	Add new g_file_has_prefix that does the same as g_file_contains_file.
	Deprecate g_file_contains_file and add a macro that converts
	it to g_file_has_prefix.
	The reason for this change is that the contains_file() name seems to
	imply that this does more work than what it does, but its really only
	a name match (from #517086)
	
        * gdummyfile.c:
        * glocalfile.c:
        * tests/g-file.c:
	Update to match the above change.


svn path=/trunk/; revision=6546
2008-02-21 09:09:59 +00:00
Alexander Larsson
767e18bf82 C89 fixes (#515892)
2008-02-12  Alexander Larsson  <alexl@redhat.com>

        * tests/live-g-file.c:
	C89 fixes (#515892)



svn path=/trunk/; revision=6506
2008-02-12 10:06:01 +00:00
Matthias Clasen
8ad07dcf1c Fix a mismerge
svn path=/trunk/; revision=6489
2008-02-10 04:54:25 +00:00
Matthias Clasen
da0e7e81c1 /bin/ksh can't handle a for-loop with no arguments, so add a "." for when
2008-02-09  Matthias Clasen <mclasen@redhat.com>

        * Makefile.decl: /bin/ksh can't handle a for-loop with no
        arguments, so add a "." for when $(SUBDIRS) is empty.

        * glib/tests/option-context.c:
        * glib/tests/testing.c:
        * gthread/gthread-posix.c:
        * tets/testingbase64.c:
        * glib/gtester.c:
        * glib/gsequence.c: Portability fixes.  (#515154)



svn path=/trunk/; revision=6487
2008-02-10 04:41:25 +00:00
Tor Lillqvist
7077781cc3 live-g-file won't build on Windows, too Unix-specific.
2008-02-07  Tor Lillqvist  <tml@novell.com>

	* tests/Makefile.am (TEST_PROGS): live-g-file won't build on
	Windows, too Unix-specific.


svn path=/trunk/; revision=6478
2008-02-07 09:56:25 +00:00
Tomas Bzatek
d87c1c0af4 New GIO testing module working over real data
2008-02-06  Tomas Bzatek  <tbzatek@redhat.com> 

        * tests/Makefile.am:
        * tests/live-g-file.c: 
        * tests/live-g-file.txt:
        New GIO testing module working over real data


svn path=/trunk/; revision=6465
2008-02-06 13:52:07 +00:00
Alexander Larsson
fc93e63edd C89 fixes from Jens Granseuer (#512849)
2008-01-30  Alexander Larsson  <alexl@redhat.com>

        * tests/data-input-stream.c:
        * tests/data-output-stream.c:
	C89 fixes from Jens Granseuer (#512849)



svn path=/trunk/; revision=6423
2008-01-30 09:28:10 +00:00
Matthias Clasen
8cb30318e5 Disable some tests
svn path=/trunk/; revision=6400
2008-01-28 19:46:18 +00:00
Alexander Larsson
2544ae3cd6 Canonicalize paths that start with more than two slashes.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (canonicalize_filename):
	Canonicalize paths that start with more than
	two slashes.
	
        * tests/g-file.c:
        (compare_two_files):
        (test_g_file_new_for_path):
	Test the above



svn path=/trunk/; revision=6353
2008-01-22 09:38:37 +00:00
Alexander Larsson
db5224fa85 Fix c++ comment
svn path=/trunk/; revision=6352
2008-01-22 09:19:58 +00:00
Alexander Larsson
b784923e9c Allow UTF-8 in file:// parse names.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
	Allow UTF-8 in file:// parse names.
	
        * tests/Makefile.am:
        * tests/data-input-stream.c:
        * tests/data-output-stream.c:
        * tests/g-file-info.c:
        * tests/g-file.c:
	Added a bunch of tests from Tomas Bzatek


svn path=/trunk/; revision=6351
2008-01-22 09:13:28 +00:00
Matthias Clasen
3cbcbee7a6 Add some tests
svn path=/trunk/; revision=6257
2008-01-07 06:14:40 +00:00