Commit graph

8 commits

Author SHA1 Message Date
Simon McVittie
f59b4f9226 test-utils: Separate failable and non-failable functions
test_object_try_whatever() now has libdbus-like OOM handling,
while test_object_whatever() has GLib-like OOM handling. This is
because an overwhelming majority of the callers of these functions
either didn't check for OOM anyway, or checked for it but then
aborted. In the uncommon case where we do care, we can use the _try_
version.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-12-04 11:52:52 +00:00
Simon McVittie
7959d90719 Add missing function attributes suggested by clang (but not by gcc)
clang is a little more enthusiastic about suggesting these.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-13 22:44:13 +01:00
Simon McVittie
565ae9dea9 test-service, test-shell-service: check what RequestName returned
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 12:26:48 +01:00
Marcus Brinkmann
dbecdeabb2 Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
Havoc Pennington
7020b57376 2006-10-01 Havoc Pennington <hp@redhat.com>
* test/test-service.c (path_message_func): remove broken extra
	unref that was hidden by the bugs in dbus-connection.c/dbus-bus.c

	* test/test-shell-service.c (path_message_func): same fix

	* dbus/dbus-connection.c
	(_dbus_connection_get_dispatch_status_unlocked): break up the
	function a little for clarity and fix the notification of
	dbus-bus.c to not require dispatch to be complete

	* dbus/dbus-connection.c (dbus_connection_unref): improve the
	warning when you try to finalize an open connection.
2006-10-01 17:21:03 +00:00
John (J5) Palmieri
1eae184450 * doc/TODO:
- Remove pending call locking todo item
- dbus_connection_open now holds hard ref.  Remove todo item
- do proper locking on _dbus_bus_check_connection_and_unref
  and handle DBUS_BUS_STARTER. Remove todo item
- Warn on closing of a shared connection.  Remove todo item

* bus/bus.c, bus/connection.c, bus/dispatch.c, dbus/dbus-bus.c,
  dbus/dbus-connection.c: Use the dbus_connection_close_internal
  so we don't get the warning when closing shared connections

* test/test-service.c, test/test-shell-service.c: Applications
  don't close shared connections themselves so we unref instead of
  close

* test/test-utils.c (test_connection_shutdown): Close the connection

* dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): Changed to
  _dbus_bus_check_connection_and_unref_unlocked since we only call this
  method on a locked connection.
  Make sure we call _dbus_connection_unref_unlocked instead of
  dbus_connection_unref also.
  Handle DBUS_BUS_STARTER correctly

* dbus/dbus-connection.c (connection_record_shared_unlocked):
  Mark as shared and hard ref the connection
  (connection_forget_shared_unlocked): Remove the hard ref from the
  connection
  (_dbus_connection_close_internal_and_unlock):  New internal function
  which takes a locked connection and unlocks it after closing it
  (_dbus_connection_close_internal): New internal function which acts
  like the origonal dbus_connection_close method by grabbing a connection
  lock and calling _dbus_connection_close_internal_and_unlock
  (dbus_connection_close): Public close method, warns when the app
  trys to close a shared connection
2006-09-06 22:00:07 +00:00
John (J5) Palmieri
c1091cbbd2 Patches by Kjartan Maraas <kmaraas at gnome dot org>
* bus/services.c (bus_service_list_queued_owners):
        Add a pointer cast to fix compiler warning

        * dbus/dbus-dataslot.c (_dbus_data_slot_list_get):
        return a NULL instead of FALSE since the return type
        is not expecting a boolean

        * dbus/dbus-marshal-basic.c (_dbus_marshal_test):
        Remove unused variable

        * dbus/dbus-marshal-recursive-util.c (node_new):
        return a NULL instead of FALSE since the return type
        is not expecting a boolean

        * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
        Send a NULL into _dbus_transport_new_for_fd instead of a FALSE
        because we are expecting a pointer not a boolean

        * dbus/dbus-sysdeps-util.c (_dbus_get_tmpdir):
        add void as the parameter so some compilers
        don't complain

        * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket,
          _dbus_transport_new_for_tcp_socket):
        Send a NULL into _dbus_transport_new_for_fd instead of a FALSE
        because we are expecting a pointer not a boolean

        * test/shell-test.c (test_command_line):
        cast the second argument to _dbus_list_append to avoid compiler
        warnings

        * test/test-names.c (main): remove unused variable

        * test/test-service.c (check_hello_from_self_reply):
        Initialize echo_message and echo_reply to NULL

        * test/test-shell-service.c (handle_echo):
        Remove unused variable and cast the third parameter passed to
        dbus_connection_get_object_path_data to avoid compiler warrnings

        * test/name-test/test-names.c (clear_message_queue):
        Remove unused function

        * test/name-test/test-pending-call-dispatch.c:
        Fix format string in printf
2006-08-14 19:11:35 +00:00
John (J5) Palmieri
075945f611 Checking in Rodrigo's patch along with my fixes to the patch
2005-07-14  John (J5) Palmieri  <johnp@redhat.com>

	* bus/activation.c: clean up all tabs to be 8 spaces
	(bus_activation_activate_service): make sure we clean up
	if activation fails

	* bus/dispatch.c: clean up all tabs to be 8 spaces
	(check_shell_fail_service_auto_start): New function
	tests to make sure we get fail properly when trying to auto start a service
	with a faulty command line
	(check_shell_service_success_auto_start): New function tests to make sure
	auto started services get the arguments on the command line

	* test/test-shell-service.c: Added service for testing auto-starting with
	command line arguments

	* test/data/valid-service-files/debug-shell-echo-fail.service.in,
	test/data/valid-service-files/debug-shell-echo-success.service.in:
	Added service files for testing auto-starting with command line arguments

	* */.cvsignore: added a bunch of generated files to various .cvsignore files

2005-07-14  Rodrigo Moya  <rodrigo@novell.com>

	* dbus/dbus-shell.[ch]: copy/pasted code from GLib.

	* dbus/Makefile.am: added new files to build.

	* bus/activation.c (bus_activation_activate_service): support
	activation commands with parameters.

	* test/shell-test.c: added test program for the shell parsing
	code.
2005-07-14 20:44:15 +00:00