Commit graph

14 commits

Author SHA1 Message Date
Félix Piédallu
362b22605c shell-test: Print diagnostics to stderr
Some of the command-lines that we print as diagnostics contain newlines,
which will cause warnings or errors under a strict TAP parser (and one of
them wasn't correctly prefixed with '#' anyway). TAP parsers only parse
stdout, not stderr, so we can use stderr for these diagnostic messages.

[smcv: Expand commit message]

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-28 11:50:23 +01:00
Simon McVittie
e95dc1d58f tests: Call dbus_shutdown()
Not all of these tests will be fully valgrind-clean yet (or perhaps
ever), but it's easier to add this to all of them than to think
about it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
2018-08-02 17:14:39 +01:00
Simon McVittie
e354380e82 shell-test: Don't use _dbus_get_tmpdir()
There's no particular reason to be using a temporary directory (it's
just some arbitrary string), and it will be harder for future changes
to eradicate uses of a temporary directory that is shared between users
if we list it here.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99828
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-02-16 16:00:14 +00:00
Philip Withnall
c5a5c4047d test: Add some OOM paths to the shell-test
I am increasingly of the opinion that this is a gigantic waste of time.
But at least Coverity will be happy.

Coverity IDs: 60585, 60586
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99724
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2017-02-13 16:04:18 +00:00
Ralf Habacker
8b31f2fee9 shell-test: Calling _dbus_string_init without checking return value (CID 60587).
Reported by Coverity: CID 60587: Unchecked return value (CHECKED_RETURN)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-12 23:07:30 +01:00
Ralf Habacker
c396b8ea56 test_command_line_internal: Fix variable original_argv going out of scope leaks the storage it points to (CID 60588).
Reported by Coverity: CID 60588: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-01 23:05:14 +02:00
Ralf Habacker
e48dd5b3ca test_command_line_internal: Fix 'variable shell_argv going out of scope leaks the storage it points to' (CID 54751)
Reported by Coverity: CID 54751: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-01 23:05:05 +02:00
Simon McVittie
58eefa1031 test-shell, test-printf: produce TAP output like the other installable tests
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846
2015-04-16 13:06:13 +01:00
Ralf Habacker
54f92110f6 CID 54766: Resource leak (RESOURCE_LEAK).
Variable original_argv going out of scope leaks the storage it points to.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-04-14 19:51:33 +02:00
Simon McVittie
f17fd1cc4e Define DBUS_COMPILATION externally for all tests that use internal stuff
It might as well go in the AM_CPPFLAGS rather than in the source code.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03 12:00:44 +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
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
2974c82428 * dbus/dbus-sysdeps.c:
* dbus/dbus-address.c:
* bus/activation.c:
* test/shell-test.c:
  don't hardcode tmp directory (patch from Dave Meikle
  <dmk at davemeikle dot co dot uk>)
2006-08-10 20:09:43 +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