summaryrefslogtreecommitdiffstats
path: root/test/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* Add noinst convenience test library, add a test-shutdownColin Walters2008-05-301-14/+12
| | | | | | | | | | | | | * test/Makefile.am: New convenience library libdbus_testutils_la. Reorder build so that test/ gets built before test/name-test so name-test files can depend on it. * test/name-test/test-shutdown.c: New file, exercises dbus_shutdown () a bit. * test/name-test/run-test.sh Run test-shutdown. * test/test-utils.h: In some cases we already have DBUS_COMPILATION defined, avoid double definition warning.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: * test/Makefile.am: * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS uiteNoExec.service.in: * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS uiteNoService.service.in: * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS uiteNoUser.service.in: * test/data/valid-config-files-system/debug-allow-all-fail.conf.in: * test/data/valid-config-files-system/debug-allow-all-pass.conf.in: * test/data/valid-config-files/debug-allow-all-sha1.conf.in: * test/data/valid-config-files/debug-allow-all.conf.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teEchoService.service.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teSegfaultService.service.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teShellEchoServiceFail.service.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teShellEchoServiceSuccess.service.in: * test/data/valid-service-files/debug-echo.service.in: * test/data/valid-service-files/debug-segfault.service.in: * test/data/valid-service-files/debug-shell-echo-fail.service.in: * test/data/valid-service-files/debug-shell-echo-success.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoS ervice.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfa ultService.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell EchoServiceFail.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell EchoServiceSuccess.service.in: Add the data files needed by the system activation unit checks.
* 2007-06-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-181-1/+5
| | | | | | | | | | | | | | * doc/dbus-specification.xml: document org.freedesktop.DBus.GetId() * bus/driver.c (bus_driver_handle_get_id): implement org.freedesktop.DBus.GetId() * bus/bus.c (bus_context_new): generate a unique ID for each bus context * dbus/dbus-connection.c (dbus_connection_get_server_id): new function * dbus/dbus-bus.c (dbus_bus_get_id): new function * dbus/dbus-server.c (dbus_server_get_id): new function
* 2007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-091-0/+1
| | | | | | | | | | | | | | | | | | | * bus/dispatch.c (check_get_connection_unix_process_id): adapt since sysdeps-unix.h stuff isn't included anymore * bus/bus.c (bus_context_new): use more abstract functions to change user, so they can be no-ops on Windows * dbus/dbus-credentials.c, dbus/dbus-credentials.h, dbus/dbus-credentials-util.c: new files containing a fully opaque DBusCredentials data type to replace the old not opaque one. * configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on windows * dbus/dbus-userdb.h: prohibit on Windows, next step is to clean up the uses of it in bus/*.c and factor out the parts of cookie auth that depend on it
* * test/Makefile.am: fixed test data copy problem inRalf Habacker2007-03-041-3/+3
| | | | out of source build, when sources came from svn or cvs.
* 2006-10-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref): Add a hack to make DBusNewConnectionFunction work right. * dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use the hack here. Also, fix the todo about refcount leak. * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): and use the hack here * dbus/dbus-connection.c: Kill the "shared" flag vs. the "shareable" flag; this was completely broken, since it meant dbus_connection_open() returned a connection of unknown shared-ness. Now, we always hold a ref on anything opened as shareable. Move the call to notify dbus-bus.c into connection_forget_shared_unlocked, so libdbus consistently forgets all its knowledge of a connection at once. This exposed numerous places where things were totally broken if we dropped a ref inside get_dispatch_status_unlocked where connection_forget_shared_unlocked was previously, so move connection_forget_shared_unlocked into _dbus_connection_update_dispatch_status_and_unlock. Also move the exit_on_disconnect here. (shared_connections_shutdown): this assumed weak refs to the shared connections; since we have strong refs now, the assertion was failing and stuff was left in the hash. Fix it to close still-open shared connections. * bus/dispatch.c: fixup to use dbus_connection_open_private on the debug pipe connections * dbus/dbus-connection.c (dbus_connection_dispatch): only notify dbus-bus.c if the closed connection is in fact shared (_dbus_connection_close_possibly_shared): rename from _dbus_connection_close_internal (dbus_connection_close, dbus_connection_open, dbus_connection_open_private): Improve docs to explain the deal with when you should close or unref or both * dbus/dbus-bus.c (_dbus_bus_notify_shared_connection_disconnected_unlocked): rename from _dbus_bus_check_connection_and_unref_unlocked and modify to loop over all connections * test/test-utils.c (test_connection_shutdown): don't try to close shared connections. * test/name-test/test-threads-init.c (main): fix warnings in here * dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT env variable to cause blocking waiting for gdb; drop DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace() unconditionally. * configure.in: add -export-dynamic to libtool flags if assertions enabled so _dbus_print_backtrace works. * dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf instead of _dbus_verbose to print the backtrace, and diagnose lack of -rdynamic/-export-dynamic
* * test/Makefile.am: change find to use syntax that works with nonJohn (J5) Palmieri2006-08-251-1/+1
| | | | gnu versions of find
* * Remove all bindingsJohn (J5) Palmieri2006-07-141-13/+2
|
* * configure.in: Add test/name-test/Makefile to the generatedJohn (J5) Palmieri2005-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefile list * dbus/dbus-shared.h (#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT): New flag which replaces DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT (#define DBUS_NAME_FLAG_DO_NOT_QUEUE): New flag for specifying not to queue an ower if it can't be the primary owner * bus/bus.h: Add new internal BusOwner struct * bus/driver.c (bus_driver_handle_hello): Send flags (0 for default) to bus_registry_ensure and don't set the prohibit_replacement flag since they are now set per BusOwner and not per name. (bus_driver_handle_list_queued_owners): bus method (ListQueuedOwners) that returns the list of connections in a name's connection queue * bus/services.c (struct BusService): remove prohibit_replacement field (struct BusOwner): new struct for keeping track of queued connections and their associated flags for the queue (struct BusRegistry): add a BusOwner memory pool (bus_registry_new): initialize the BusOwner memory pool (bus_registry_unref): free the BusOwner memory pool (_bus_service_find_owner_link): new internal method for searching the queue for a specific connection (bus_owner_set_flags): new method for adding setting the flags on a bus owner (bus_owner_new): new method that creates a BusOwner object from the pool and sets its flags (bus_owner_ref, bus_owner_unref): ref counting for BusOwner objects (bus_registry_ensure): Add the flags parameter (bus_registry_acquire_service): Switch from using raw connections to using the BusOwner struct Add new state machine for dealing with the new set of flags (bus_registry_set_service_context_table, struct OwnershipCancelData, cancel_ownership, free_ownership_cancel_data, add_cancel_ownership_to_transaction, struct OwnershipRestoreData, restore_ownership, free_ownership_restore_data, add_restore_ownership_to_transaction): Switch to using BusOwner instead of raw connections (bus_service_add_owner): Add flags parameter Switch to using BusOwner instead of raw connections Add state machine for dealing with the new set of flags (bus_service_swap_owner): Swaps the first and second owners in the queue. Used to make sure proper signals are sent when a service looses or gains primary ownership. We never insert an owner at the top of the queue. Instead we insert it in the second position and then swap. (bus_service_remove_owner): Remove the owner from the queue sending out the NameLost and NameOwnerChanged signals if the we were the primary owner (bus_service_get_primary_owners_connection): New method that extracts the connection from the primary owner (bus_service_get_primary_owner): Returns the BusOwner instead of the connection (bus_service_get_allow_replacement): Changed from the old bus_service_get_prohibit_replacement method. Checks the flags of the primary owner and returns if it can be replaced or not (bus_service_set_prohibit_replacement): removed (bus_service_has_owner): returns TRUE if and owner with the specified connection exists in the queue * dbus/dbus-bus.c (dbus_bus_connection_get_unique_name): New helper method that only compiles if tests are enabled. Allows us to get the unique name of a connection so we can check it against the queue when doing regression tests * bus/activation.c (bus_activation_send_pending_auto_activate), bus/dispatch.c (bus_dispatch), bus/driver.c (bus_driver_handle_get_service_owner, bus_driver_handle_get_connection_unix_user, bus_driver_handle_get_connection_unix_process_id, bus_driver_handle_get_connection_selinux_security_context), bus/signals.c (connection_is_primary_owner): use bus_service_get_primary_owners_connection instead of bus_service_get_primary_owner * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket, _dbus_listen_unix_socket): Calculate the length of the socket path and use that instead of using a fixed length which was causing socket names to contain many trailing Nul bytes. * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c (dbus_g_method_get_sender): New method for extracting the sender from a DBusGMethodInvocation (dbus_g_method_return_get_reply): changed name to dbus_g_method_get_reply (dbus_g_method_return_send_reply): changed name to dbus_g_method_send reply * doc/dbus-specification.xml: New docs that describe how the new queueing system works and talks about the changes to the how we specify socket names * glib/examples/example-service.c, glib/examples/example-signal-emitter.c, glib/examples/statemachine/statemachine-server.c: Changed the RequestName flags to the new system * test/name-test/ (test-names.c, run-test.sh, Makefile.am): New regression test suite for testing various states of the new queueing system
* adding an autotest and "dbus-ify" the build process and include schemeHarald Fernengel2005-09-231-2/+5
|
* * dbus/dbus-marshal-validate.c, doc/dbus-specification.xml,Waldo Bastian2005-09-121-1/+7
| | | | test/Makefile.am, test/test-names.c: allow hyphens in bus names.
* * test/python: Add python regression testJohn (J5) Palmieri2005-08-251-2/+5
| | | | | | * configure.in: Add test/python/Makefile * test/Makefile.am: Add the python directory to SUBDIRS
* Checking in Rodrigo's patch along with my fixes to the patchJohn (J5) Palmieri2005-07-141-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c
* 2004-09-20 Jon Trowbridge <trow@ximian.com>Jon Trowbridge2004-09-201-1/+1
| | | | | | | | | | | | | | Patch from Nat Friedman <nat@novell.com> * mono/Makefile.am: A number of small build fixes to allow "make distcheck" to succeed. * mono/example/Makefile.am: "make distcheck" fixes. * mono/AssemblyInfo.cs.in: When signing the assembly, look for the key in @srcdir@. * test/Makefile.am: "make distcheck" fixes.
* 2004-07-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-07-251-0/+1
| | | | | | | * Makefile.am (DIST_SUBDIRS): add DIST_SUBDIRS, problem solved by Owen * test/Makefile.am (DIST_SUBDIRS): here also
* 2004-05-17 Kristian Høgsberg <krh@redhat.com>Kristian Høgsberg2004-05-171-5/+1
| | | | | | | | | | | | | | | | | | Remove base64 encoding, replace with hex encoding. Original patch from trow@ximian.com, added error handling. * dbus/dbus-string.c (_dbus_string_base64_encode) (_dbus_string_base64_decode): Remove. (_dbus_string_hex_decode): Add end_return argument so we can distinguish between OOM and invalid hex encoding. (_dbus_string_test): Remove base64 tests and add test case for invalid hex. * dbus/dbus-keyring.c, dbus/dbus-auth-script.c, dbus/dbus-auth.c: Replace base64 with hex. * test/data/auth/invalid-hex-encoding.auth-script: New test case for invalid hex encoded data in auth protocol.
* 2004-04-12 Jon Trowbridge <trow@ximian.com>Jon Trowbridge2004-04-131-1/+8
| | | | | | | | | | | | | | | * bus/config-parser.c (struct BusConfigParser): Added included_files field. (seen_include): Added. Checks whether or not a file has already been included by any parent BusConfigParser. (bus_config_parser_new): Copy the parent's included_files. (include_file): Track which files have been included, and fail on circular inclusions. (process_test_valid_subdir): Changed printf to report if we are testing valid or invalid conf files. (all_are_equiv): Changed printf to be a bit clearer about what we are actually doing. (bus_config_parser_test): Test invalid configuration files.
* 2003-09-15 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-pending-call.c: add the get/set object data boilerplate as for DBusConnection, etc. Use generic object data for the notify callback. * glib/dbus-gparser.c (parse_node): parse child nodes * tools/dbus-viewer.c: more hacking on the dbus-viewer * glib/dbus-gutils.c (_dbus_gutils_split_path): add a file to contain functions shared between the convenience lib and the installed lib * glib/Makefile.am (libdbus_glib_1_la_LDFLAGS): add -export-symbols-regex to the GLib library * dbus/dbus-object-tree.c (_dbus_object_tree_dispatch_and_unlock): fix the locking in here, and add a default handler for Introspect() that just returns sub-nodes. 2003-09-14 Havoc Pennington <hp@pobox.com> * glib/dbus-gthread.c (dbus_g_thread_init): rename to make g_foo rather than gfoo consistent * glib/dbus-gproxy.h: delete for now, move contents to dbus-glib.h, because the include files don't work right since we aren't in the dbus/ subdir. * glib/dbus-gproxy.c (dbus_gproxy_send): finish implementing (dbus_gproxy_end_call): finish (dbus_gproxy_begin_call): finish * glib/dbus-gmain.c (dbus_set_g_error): new * glib/dbus-gobject.c (handle_introspect): include information about child nodes in the introspection * dbus/dbus-connection.c (dbus_connection_list_registered): new function to help in implementation of introspection * dbus/dbus-object-tree.c (_dbus_object_tree_list_registered_and_unlock): new function 2003-09-12 Havoc Pennington <hp@pobox.com> * glib/dbus-gidl.h: add common base class for all the foo_info types * tools/dbus-viewer.c: add GTK-based introspection UI thingy similar to kdcop * test/Makefile.am: try test srcdir -ef . in addition to test srcdir = ., one of them should work (yeah lame) * glib/Makefile.am: build the "idl" parser stuff as a convenience library * glib/dbus-gparser.h: make description_load routines return NodeInfo* not Parser* * Makefile.am (SUBDIRS): build test dir after all library dirs * configure.in: add GTK+ detection
* 2003-09-03 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-09-041-0/+7
| | | | | | | | | | | | | | | | * test/glib/Makefile.am: add this with random glib-linked test programs * glib/Makefile.am: remove the random test programs from here, leave only the unit tests * glib/dbus-gobject.c (_dbus_gobject_test): add test for uscore/javacaps conversion, and fix (get_object_property, set_object_property): change to .NET convention for mapping props to methods, set_FooBar/get_FooBar, since one language has such a convention we may as well copy it. Plus real methods in either getFooBar or get_foo_bar style won't collide with this convention.
* 2003-06-29 Miloslav Trmac <mitr@volny.cz>Miloslav Trmac2003-06-291-2/+2
| | | | | * doc/Makefile.am: * tools/Makefile.am: Don't assume srcdir == builddir.
* 2003-04-28 Havoc Pennington <hp@redhat.com>dbus-0.10Havoc Pennington2003-04-281-0/+1
| | | | | | | | | | | | | | | * configure.in: 0.10 * NEWS: update * bus/system.conf.in: add <includedir>system.d</includedir> * dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when username was provided but not uid * bus/config-parser.c (struct BusConfigParser): keep track of whether the parser is toplevel or was included; change some of the error handling if it's included.
* 2003-04-06 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-071-23/+3
| | | | | | | | * test/Makefile.am: remove a lot of stuff that isn't immediately useful, it's in CVS history if we want it. * test/test-service.c: use dbus-mainloop instead of that watch.[hc] crack
* 2003-04-05 Havoc Pennington <hp@pobox.com>dbus-0.7Havoc Pennington2003-04-051-1/+1
| | | | | | | | * test/Makefile.am (dist-hook): also dist *.in files * NEWS: update * configure.in: 0.7
* 2003-04-05 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-051-1/+11
| | | | | | | | | | * Makefile.am (coverage-report.txt): add target "coverage-report.txt" * test/decode-gcov.c: hack up a little program to suck data out of gcov files. Yes this is sort of silly. * configure.in: define something in config.h and do an AM_CONDITIONAL when gcov is enabled
* 2003-04-04 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-051-1/+10
| | | | | | | | | | | | * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to return a "babysitter" object that is used to monitor the status of the spawned process and reap it when required. * test/test-segfault.c, test/test-exit.c, test/test-sleep-forever.c: binaries that do various lame things, used in the test suite. * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
* 2003-04-03 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-031-2/+3
| | | | | | | | | | * bus/activation.c (load_directory): fix up memleaks (bus_activation_entry_free): free the entry * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if we get one from the message bus; fix memleaks. * dbus/dbus-message.c (dbus_set_error_from_message): new function
* 2003-04-03 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * bus/config-parser.c (bus_config_parser_unref): free list of mechanisms, bug discovered by test suite enhancements (putting system.conf and session.conf into suite) * test/Makefile.am, test/test-service.c: add placeholder for a test service that we'll activate as part of test suite. Doesn't do anything yet. * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by setting NULL value, and use system malloc not dbus_malloc() when we have unavoidable memleakage. * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0 didn't work, and support DBUS_BUS_ACTIVATION. * bus/activation.c (child_setup): pass our well-known bus type to the child * bus/config-parser.c: support <type> to specify well-known type * doc/dbus-specification.sgml: document the env variables to locate well-known buses and find service activator
* 2003-04-02 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-031-16/+59
| | | | | | | * test/Makefile.am (all-local): add a rule to copy tests to builddir, so we can have generated tests. Use this to remove the silly hack for testing system.conf and session.conf. Will use this shortly to generate .service files pointing to test binaries.
* 2003-03-31 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-311-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket) (_dbus_transport_new_for_tcp_socket): these didn't need the "server" argument since they are always client side * dbus/dbus-server.c (dbus_server_get_address): new function * bus/main.c (main): take the configuration file as an argument. * test/data/valid-config-files/debug-allow-all.conf: new file to use with dispatch.c tests for example * bus/test-main.c (main): require test data dir * bus/bus.c (bus_context_new): change this to take a configuration file name as argument * doc/config-file.txt (Elements): add <servicedir> * bus/system.conf, bus/session.conf: new files * dbus/dbus-bus.c (dbus_bus_get): look for system bus on well-known socket if none set * configure.in: create system.conf and session.conf
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops - test code was only testing failure of around 30 of the mallocs in the test path, but it turns out there are 500+ mallocs. I believe this was due to misguided linking setup such that there was one copy of dbus_malloc etc. in the daemon and one in the shared lib, and only daemon mallocs were tested. In any case, the test case now tests all 500+ mallocs, and doesn't pass yet, though there are lots of fixes in this patch. * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix this so that it doesn't need to allocate memory, since it has no way of indicating failure due to OOM (and would be annoying if it did). * dbus/dbus-list.c (_dbus_list_pop_first_link): new function * bus/Makefile.am: rearrange to create two self-contained libraries, to avoid having libraries with overlapping symbols. that was resulting in weirdness, e.g. I'm pretty sure there were two copies of global static variables. * dbus/dbus-internals.c: move the malloc debug stuff to dbus-memory.c * dbus/dbus-list.c (free_link): free list mempool if it becomes empty. * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function * dbus/dbus-address.c (dbus_parse_address): free list nodes on failure. * bus/dispatch.c (bus_dispatch_add_connection): free message_handler_slot when no longer using it, so memory leak checkers are happy for the test suite. * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name * bus/bus.c (new_connection_callback): disconnect in here if bus_connections_setup_connection fails. * bus/connection.c (bus_connections_unref): fix to free the connections (bus_connections_setup_connection): if this fails, don't disconnect the connection, just be sure there are no side effects. * dbus/dbus-string.c (undo_alignment): unbreak this * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were leaking (_dbus_auth_new): fix the order in which we free strings on OOM failure * bus/connection.c (bus_connection_disconnected): fix to not send ServiceDeleted multiple times in case of memory allocation failure * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to get the base service name (dbus_bus_register_client): don't return base service name, instead store it on the DBusConnection and have an accessor function for it. (dbus_bus_register_client): rename dbus_bus_register() * bus/dispatch.c (check_hello_message): verify that other connections on the bus also got the correct results, not just the one sending hello
* 2003-03-12 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-131-9/+8
| | | | | | | | | | | Throughout: purge global variables, introduce BusActivation, BusConnections, BusRegistry, etc. objects instead. * bus/bus.h, bus/bus.c: introduce BusContext as a global message bus object * test/Makefile.am (TEST_BINARIES): disable bus-test for now, going to redo this a bit differently I think
* 2003-02-22 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-221-2/+2
| | | | * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
* 2003-02-17 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-161-1/+1
| | | | | | | | | | * doc/.cvsignore: * doc/Makefile.am: * doc/dbus-test-plan.sgml: Add test plan document. * test/Makefile.am: Fix distcheck.
* 2003-02-16 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-161-1/+3
| | | | | | | | | | | | | | | | | | | | * bus/dispatch.c: (send_one_message): Only send broadcast messages to registered connections. * dbus/dbus-message.c: (dbus_message_name_is): * dbus/dbus-message.h: New convenience function. * dbus/dbus-transport-debug.c: (do_reading): Only dispatch one message per run. * test/Makefile.am: * test/bus-test.c: (new_connection_callback), (die), (test_hello_client1_handler), (test_hello_client2_handler), (test_hello_replies), (main): * test/bus-test-loop.[ch]: Add these.
* 2003-02-15 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-151-1/+5
| | | | | | | | | | | | | | | * dbus/dbus-errors.c: (dbus_set_error): * dbus/dbus-errors.h: Add a few errors and make dbus_set_error void. * dbus/dbus-sysdeps.c: (_dbus_errno_to_string), (close_and_invalidate), (make_pipe), (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async): * dbus/dbus-sysdeps.h: Add _dbus_spawn_async. * test/spawn-test.c: (main): Test for _dbus_spawn_async.
* 2003-02-15 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-threads.c: * dbus/dbus-threads.h: Add condvars. Remove static mutext from API. Implement static mutexes by initializing them from threads_init. * glib/dbus-gthread.c: * qt/dbus-qthread.cpp: Update with the thread api changes. * dbus/dbus-list.c: * dbus/dbus-list.h: Turn StaticMutex into normal mutex + init function. Export new functions _dbus_list_alloc_link, _dbus_list_free_link, _dbus_list_append_link, _dbus_list_prepend_link * dbus/dbus-sysdeps.c: * dbus/dbus-sysdeps.h: New type dbus_atomic_t, and new functions _dbus_atomic_inc, _dbus_atomic_dec. Only slow fallback implementation at the moment. * dbus/dbus-protocol.h: Add DBUS_MESSAGE_LOCAL_DISCONNECT define * dbus/dbus-message.c: Make ref/unref atomic. Fix some docs. * dbus/dbus-connection-internal.h: * dbus/dbus-connection.c: * dbus/dbus-connection.h: Make threadsafe. Change _peek to _borrow,_return & _steal_borrowed. Change disconnect callback to event. Make dbus_connection_dispatch_messages reentrant. * dbus/dbus-transport.c: Don't ref the connection on calls to the transport implementation. * dbus/dbus-message-handler.c: Make threadsafe. * glib/dbus-gmain.c: Don't use peek_message anymore * test/Makefile.am: * test/debug-thread.c: * test/debug-thread.h: Simple thread implementation that asserts() on deadlocks in single-threaded code. * test/bus-test.c: (main) Call debug_threads_init. * test/watch.c: Use disconnect message instead of disconnect callback. * bus/connection.c: * bus/connection.h: Don't call dbus_connection_set_disconnect_function. Instead export bus_connection_disconnect. * bus/dispatch.c: Call bus_connection_disconnect when we get a disconnected message.
* 2003-02-13 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-02-131-9/+9
| | | | | | | | | | | | | | | | | | | | * dbus/dbus-auth.c (handle_server_data_external_mech): args to dbus_credentials_match were backward * dbus/dbus-auth-script.c (_dbus_auth_script_run): support NO_CREDENTIALS and ROOT_CREDENTIALS * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine into here. Never process more commands after we've reached an end state; store further data as unused bytes. * test/data/auth/*: add more auth tests * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT command to match exact string and EXPECT_UNUSED to match unused bytes * test/Makefile.am (dist-hook): fix to dist all the test stuff
* 2003-02-06 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-051-1/+5
| | | | | | | | * dbus/Makefile.am: * dbus/dbus-break-loader.c: * test/Makefile.am: * test/break-loader.c: Move dbus-break-loader to test/ and rename it to break-loader.
* 2003-02-02 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-02-021-1/+5
| | | | | | | | * test/Makefile.am: * test/bus-test.c: (get_time), (add_timeout), (remove_timeout), (message_handler), (new_connection_callback), (loop_quit), (loop_run), (main): Add bus test.
* 2003-01-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-01-281-1/+6
| | | | | | | * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in the reverse order from how I had it (_dbus_string_base64_encode): reverse encoding order. I was basically byteswapping everything during encoding.
* 2003-01-28 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-281-8/+8
| | | | | | * test/Makefile.am (dist-hook): fix make distdir * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
* 2003-01-27 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-mempool.c (time_for_size): replace printf with _dbus_verbose * dbus/dbus-message-builder.c (_dbus_message_data_load): allow empty lines; fix the SAVE_LENGTH stuff to be START_LENGTH/END_LENGTH so it actually works; couple other bugfixes * test/Makefile.am (dist-hook): add dist-hook for .message files * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy can be constant or locked. (_dbus_string_free): allow freeing a const string as documented/intended * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility * dbus/dbus-test-main.c (main): take an argument which is the directory containing test data * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir argument to this and load all the messages in test/data/ checking that they can be loaded or not loaded as appropriate.
* 2003-01-18 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-01-181-3/+3
| | | | | | | | | | * configure.in: default --enable-tests to $USE_MAINTAINER_MODE * dbus/Makefile.am: fix it up so dubs-test-main.c is included in the distribution * test/Makefile.am: don't use special variable "TESTS" for echo-* since we don't want to use those in make check
* 2003-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-01-151-4/+7
| | | | | * test/Makefile.am: fix so that test source code ends up in the distribution on make distcheck
* make test compilable without prior make install. not sure how aboutHarri Porten2002-12-151-1/+1
| | | | the preferred way to activate test compilation (DBUS_BUILD_TESTS)
* 2002-11-24 Havoc Pennington <hp@pobox.com>Havoc Pennington2002-11-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/echo-client.c, test/echo-server.c: cheesy test clients. * configure.in (AC_CHECK_FUNCS): check for writev * dbus/dbus-message.c (_dbus_message_get_network_data): new function * dbus/dbus-list.c (_dbus_list_foreach): new function * dbus/dbus-internals.c (_dbus_verbose): new function * dbus/dbus-server.c, dbus/dbus-server.h: public object representing a server that listens for connections. * dbus/.cvsignore: create * dbus/dbus-errors.h, dbus/dbus-errors.c: public API for reporting errors * dbus/dbus-connection.h, dbus/dbus-connection.c: public object representing a connection that sends/receives messages. (Same object used for both client and server.) * dbus/dbus-transport.h, dbus/dbus-transport.c: Basic abstraction for different kinds of stream that we might read/write messages from.
* 2002-11-23 Havoc Pennington <hp@pobox.com>Havoc Pennington2002-11-231-0/+4
| | | | | | | | | | | | | | | | | | | | | * configure.in: pile on more warning flags if using gcc * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have to document static functions * configure.in: add summary to end of configure so it looks nice and attractive * dbus/dbus-hash.c: finish implementation and write unit tests and docs * configure.in: add --enable-tests to enable unit tests * dbus/dbus-test.c: test program to run unit tests for all files in dbus/*, initially runs a test for dbus-hash.c * dbus/dbus-internals.h: file to hold some internal utility stuff
* initial import of "dbus" skeletonHavoc Pennington2002-11-211-0/+0