summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* * Remove all bindingsJohn (J5) Palmieri2006-07-1429-7734/+2
|
* * test/qt/*: Update the testcases, including testing the newThiago Macieira2006-06-1110-133/+738
| | | | | | functionality of sending null QByteArray and QString over the bus. Add new headertest test and restore the old qdbusxmlparser test.
* * test/qt/tst_hal.cpp: Remove the waiting, since it's notThiago Macieira2006-04-101-3/+3
| | | | needed anymore. Requires Qt 4.1.3 to work properly. (r528148)
* * test/qt/*: Sync with KDE Subversion revision 523647.Thiago Macieira2006-03-2810-1483/+837
| | | | | Update the testcases to the new API. Remove testcases for classes that are no longer public or have been removed.
* 2006-03-06 Thiago Macieira <thiago.macieira@trolltech.com>Thiago Macieira2006-03-0611-241/+1294
| | | | * test/qt/*: Update the self-tests.
* 2006-03-02 John (J5) Palmieri <johnp@redhat.com>John (J5) Palmieri2006-03-023-1/+134
| | | | | | | | | | | | | | | * dbus/dbus-connection.c: (_dbus_connection_block_pending_call): Check to see if our data has already been read off the connection by another blocking pending call before we block in poll. (check_for_reply_and_update_dispatch_unlocked): Code taken from _dbus_connection_block_pending_call - checks for an already read reply and updates the dispatch if there is one. * test/name-test/test-pending-call-dispatch.c: New test for making sure we don't get stuck polling a dbus connection which has no data on the socket when blocking out of order on two or more pending calls.
* 2006-02-16 Robert McQueen <robot101@debian.org>Robert McQueen2006-02-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Patch from Rob Taylor <rob.taylor@collabora.co.uk> to correct a bogus assertion that the next element to read from the iter is fixed in size. This is not the case when you are at the end of the iter, because the next element type is INVALID. * dbus/dbus-string.c (_dbus_string_init_const_len): Correct a a bogus assert which means that you may not initialise a 0-length string unless you provide a non-NULL pointer. This prevented you from marshalling messages containing zero-length arrays in some cases. * glib/dbus-gvalue.c (demarshal_collection_array): Another patch from Rob to correct bogus asserts when trying to demarshal an array and get_fixed_array got you 0 elements. Append nothing to the GArray in this case. * test/glib/test-dbus-glib.c: Add a test case for round-tripping an empty array via the glib bindings. Without all of the above patches, this new test fails.
* Add new tests and update the existing one.Thiago Macieira2006-02-157-15/+1710
|
* 2006-01-27 Robert McQueen <robot101@debian.org>Robert McQueen2006-01-273-0/+141
| | | | | | | | | | | | * glib/dbus-gtype-specialized.[ch], glib/dbus-gvalue-utils.c: Patch by me and Rob Taylor to add a simple_free function to D-Bus map and collection types, which allows those types which can be freed with a GDestroyNotify (such as GHashTables and GArrays, but not GPtrArrays) to be stored as the values in hashtables. * test/glib/test-dbus-glib.c, test/glib/test-service-glib.{c,xml}: Patch by Rob Taylor to add nested dicts to the glib tests to check the above code works, and appears not to leak when called repeatedly.
* convert to QTestLib 4.1Harald Fernengel2006-01-221-33/+33
|
* * test/qt/Makefile.am: build from srcdirdbus-0.60John (J5) Palmieri2005-12-011-1/+1
| | | | | | | | | | * qt/qtconnection.cpp (requestName): Changed PROHIBIT_REPLACE to ALLOW_REPLACE Note - this code is wrong and needs to be fixed by the Qt binding developers. The flags should be treated as bitfields and not enums. * qt/qtconnection.h: Change ProhibitReplace to AllowReplace * dbus/dbus-list.c (link_after): remove #ifdef DBUS_BUILD_TESTS
* * dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c,John (J5) Palmieri2005-11-303-5/+2
| | | | | | | | | | dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c test/test-segfault.c, test/test-utils.c, test/glib/test-dbus-glib.c, tools/dbus-cleanup-sockets.c tools/dbus-launch.c, tools/dbus-tree-view.c, tools/dbus-viewer.c: Various cleanup of dead code and compiler warnings (patch from Kjartan Maraas <kmaraas at gnome.org>)
* 2005-11-27 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-271-0/+1
| | | | | | | | | | * python/dbus_bindings.pyx: Repair my previous commit which reverted part of the preceding one. Oops. Merge patch by Johan Hedberg <johan.hedberg@nokia.com> to fix marshalling of 16-bit integer values on big-endian platforms. * test/python/test-client.py: Add some 16-bit integers to the test values.
* 2005-11-27 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-271-2/+3
| | | | | | | | | | | * python/dbus_bindings.pyx: Fix a bug where doing a strict append with type v of an instance of dbus.Variant(foo, type='x') caused it to be boxed twice before sending over the bus. * python/dbus_bindings.pyx, python/service.py, test/python/test-client.py: Update the constants for the new request_name flags, and update comments/test cases now that queueing is the default action.
* * configure.in: Add test/name-test/Makefile to the generatedJohn (J5) Palmieri2005-11-224-2/+636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 2005-11-15 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | * bus/driver.c, bus/services.c, bus/services.h: Add a ReleaseName method to org.freedesktop.DBus to release a bus name or give up waiting in the queue for it. * dbus/dbus-bus.c, dbus/dbus-bus.h, dbus/dbus-shared.h: Add a dbus_bus_release_name method to send the ReleaseName method calls. Add constants for the return values to dbus/dbus-shared.h. * doc/dbus-specification.xml: Document the new ReleaseName method in the specification. * python/dbus_bindings.pyx: Add a low-level python binding for the release name method. * python/exceptions.py, python/service.py: Make freeing BusName objects release the name. Add a NameExistsException, and fix a bug with creating UnknownMethodException. * test/python/test-client.py: Add tests for freeing BusName objects causing names to be released.
* 2005-11-14 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-142-0/+9
| | | | | | | | | | * python/decorators.py, python/service.py: Add a new argument to the dbus.service.method decorator called sender_keyword, which if set, specifies the name of an argument which will be provided the bus name of the method caller. * test/python/test-client.py, test/python/test-service.py: Add a method and test to check the sender_keyword functionality.
* 2005-11-07 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-072-13/+67
| | | | | | | | | | | | | | | | | | | | * python/decorators.py: Change emit_signal function to use the signature annotation of the signal when marhsalling the arguments from the service. Fix a bug where the code checking signature length against argument length referenced the wrong variable. * python/introspect_parser.py: Avoid adding the type signature of signal arguments to any methods which occur after them in the introspection data (!) by making the parser a little more careful about its current state. * python/service.py: Remove debug prints from last commit (again :D). * test/python/test-client.py, test/python/test-service.py: Add test signals with signature decorators to test the strict marshalling code gives errors at the right time. Could do with checking the signals actually get emitted too, given that the test does nothing with signals at the moment...
* 2005-11-07 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-071-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | * python/_dbus.py: Add WeakReferenceDictionary cache of dbus.Bus instances to stop madness of creating new instances representing the same bus connection all the time, rendering any tracking of match rules and bus names quite meaningless. Caught a bug where the private argument to SessionBus() and friends was being passed in as use_default_mainloop by mistake. Still some problems with multiple dbus_binding.Connection instances representing the same low-level connection (eg when you use both SessionBus() and StarterBus() in same process), but it's a lot better now than it was. * python/dbus_bindings.pyx: Add constants with the return values for bus_request_name(). * python/service.py: Store bus name instances in a per-dbus.Bus cache and retrieve the same instances for the same name, so deletion can be done with refcounting. Also now throws some kind of error if you don't actually get the name you requested, unlike previously... * test/python/test-client.py: Add tests for instance caching of buses and bus name objects.
* 2005-11-04 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-042-0/+32
| | | | | | | | | | | | | | | | | | | | | | | * python/dbus_bindings.pyx, test/python/test-client.py: Fix marshalling of boolean values. Add some booleans to the values in the test client. * python/decorators.py, python/service.py: Add an 'async_callbacks' argument to the dbus.service.method decorator, which allows you to name arguments to take two callback functions for replying with return values or an exception. * test/python/test-client.py, test/python/test-service.py: Add test case using asynchronous method reply functions, both return values and errors, and from within both the function itself and from a mainloop callback. * python/decorators.py, python/service.py: Perform checking that the number of method/signal arguments matches the number of types in the signature at class loading time, not when you first introspect the class. * python/service.py: Remove debug print left by the last commit.
* 2005-11-03 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-031-4/+7
| | | | | | | | | | | | | | | | | | * python/service.py: Heavy refactoring of method invocation, with hopefully no effect on functionality. Nuked _dispatch_dbus_method_call in favour of a new _message_cb that uses seperate functions for looking up the method to call, marshalling the return values, and sending exceptions as errors, and is easier to follow as a consequence. Fixes some corner cases about returning things that don't match your declared out_signature, allows exceptions to define _dbus_error_name and have it be sent over the bus as the error name, and paves the way for cool stuff like heeding the message no reply flag, asynchronous method implementations, informing the method of the sender, and including backtraces in the error messages. * test/python/test-client.py: Catch and print exceptions thrown in the async callback tests, rather than passing them to the low-level bindings to be ignored in a noisy and frustrating manner.
* 2005-11-03 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-031-1/+1
| | | | | | | | * python/_dbus.py, python/proxies.py, python/service.py: Add __repr__ functions to dbus.Bus, dbus.service.BusName and dbus.service.Object, tweak others to be consistent. * test/python/test-client.py: Tweak output of testInheritance.
* 2005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-292-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * python/service.py: Major changes to allow multiple inheritance from classes that define D-Bus interfaces: 1. Create a new Interface class which is the parent class of Object, and make the ObjectType metaclass into InterfaceType. 2. Patch written with Rob Taylor to replace use of method_vtable with code that walks the class's __MRO__ (method resolution order) to behave like Python does when invoking methods and allow overriding as you'd expect. Code is quite tricky because we have to find two methods, the one to invoke which has the right name and isn't decorated with the /wrong/ interface, and the one to pick up the signatures from which is decorated with the right interface. The same caveats apply as to normal multiple inheritance - this has undefined behaviour if you try and inherit from two classes that define a method with the same name but are decorated with different interfaces. You should decorate your overriding method with the interface you want. 3. Replace grungy introspection XML generation code in the metaclass with dictionaries that cope correctly with multiple inheritance and the overriding of methods. This also uses the signature decorations to provide correct introspection data, including the debut appearance of the types of your return values. :D * test/python/test-client.py, test/python/test-service.py: Add a test case to try invoking an method that overrides one inherited from a D-Bus interface class.
* 2005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-292-1/+76
| | | | | | | | | | | | | | | | | | | | | | | * python/decorators.py: Add optional arguments to the method and signal decorators to allow you to specify the signature of arguments and return values. Preserve the doc strings of signal functions in the decorated version, for pydoc and friends. * python/dbus_bindings.pyx, python/proxies.py: Replace the parse_signature_block function with an iterable dbus.Signature() type. Fix a bug in MessageIter.append_strict where you could append anything by claiming it was a string. * python/service.py: Use the out_signature decoration on methods to marshal return values, meaning you no longer require dbus.Array() or dbus.Dictionary() to indicate the type when returning empty arrays or dictionaries. Fix a bug where exceptions which are defined in __main__ are not turned into error replies. * test/python/test-client.py, test/python/test-service.py: Add test for correct marshalling of return values according to out_signature. Fix a bug in the async call test where the error_handler is missing a self argument.
* 2005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-291-0/+1
| | | | | | | | | | | | * glib/Makefile.am, glib/examples/Makefile.am, glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by Daniel Stone to replace explicit calls to libtool with $(LIBTOOL). * test/python/.cvsignore: Add run-with-tmp-session-bus.conf. * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch from Ubuntu by Daniel Silverstone to allow specifying match rules on the command line.
* 2005-10-24 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-243-1/+6
| | | | | | | | | | | | | | * python/dbus_bindings.pyx (String, MessageIter): make D-Bus strings derive from unicode instead of str, and encode/decode UTF-8 when marshalling/unmarshalling bus messages * python/introspect_parser.py: encode introspection data as UTF-8 before passing the buffer into libxml2 * test/python/test-client.py: add unicode test strings * test/data/valid-service-files/.cvsignore, test/python/.cvsignore: ignore generated python test files
* * glib/dbus-gvalue-utils.c (hash_free_from_gtype): handle gdoubleJohn (J5) Palmieri2005-10-183-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | and G_TYPE_VALUE_ARRAY (DBUS_TYPE_STRUCT) (gvalue_from_hash_value, hash_value_from_gvalue): handle gdouble * glib/dbus-gvalue.c (dbus_gvalue_to_signature): add missing DBUS_STRUCT_BEGIN_CHAR and DBUS_STRUCT_END_CHAR charaters when constructing struct signatures * python/_dbus.py (Bus): handle private connections using the private keyword in the constructor. defaults to private=False (Bus::close): new method to close a connection to the bus * python/dbus_bindings.pyx (Connection::close): renamed method was previously called disconnect (bus_get): now supports getting a private connection * python/proxies.py (ProxyMethod::__call__): check if ignore_reply keyword is set to True. if it is, execute the method without waiting for a reply (ProxyObject::_introspect_execute_queue): new method for executing all the pending methods that were waiting for the introspect to finish. this is called when introspect either succeeds or fails (ProxyObject::_introspect_error_handler): call queued methods
* * python/dbus_bindings.pyx (MessageIter::append_strict): check forJohn (J5) Palmieri2005-10-143-2/+25
| | | | | | | | | | | | | | | | STRUCT_BEGIN not TYPE_STRUCT in indicate we are marshalling a struct * python/service.py (Object::_message_cb): handle exceptions correctly by sending them over the wire to the calling app. This makes sure the client returns immediately instead of waiting the 15 seconds to timeout. * test/python/test-client.py (TestDBusBindings::testBenchmarkIntrospect): Add a test to benchmark how long it takes to introspect a service and call a method which returns a large element (pretty fast) * test/python/test-service.py (TestObject::GetComplexArray): new test method which pushes a lot of data
* * glib/dbus-gvalue.c (marshal_variant): call _dbus_gvalue_marshalJohn (J5) Palmieri2005-10-054-11/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of marshal basic so we can handle recursive types in a variant * test/glib/test-dbus-glib.c: Add test for marshaling recurive types in variants * test/glib/test-service-glib.c, test-service-glib.xml (my_object_echo_variant [EchoVariant], my_object_process_variant_of_array_of_ints123 [ProcessVariantOfArrayOfInts123]): Add two test methods * python/introspect_parser.py: New module for parsing introspect data. * python/dbus_bindings.pyx: (various places): when throwing errors fix to use errormsg instead of message local variable because Pyrex can get confused with other message variables (initial patch by Robert McQueen <robert.mcqueen at collabora.co.uk>) (MessageIter::parse_signature_block): new method for getting the next block in a signiture. (MessageIter::append_strict): new method for appending values strictly using the passed in signature instead of guessing at the type (MessageItter:: append_dict, append_struct, append_array): use signatures to marshal children if the signature is available * python/exceptions.py (IntrospectionParserException): new exception * python/proxies.py (ProxyMethod::__call__): Marshal args with introspected signatures if available, else we fall back to the old way of doing things. (ProxyObject::_introspect_reply_handler ): parse introspection data * python/service.py (ObjectType::_reflect_on_method): Properly terminate <method> if there are no args in the reflection data * test/python/test-client.py: add tests for talking with the GLib test server. This gives us better coverage for introspection since python to python will always generate arguments as variants. It also allows us to test the robustness of the GLib bindings and interlanguage communications.
* ignore meHarald Fernengel2005-09-301-0/+11
|
* compile out of the boxHarald Fernengel2005-09-302-6/+6
|
* adding an autotest and "dbus-ify" the build process and include schemeHarald Fernengel2005-09-233-2/+195
|
* * dbus/dbus-marshal-validate.c, doc/dbus-specification.xml,Waldo Bastian2005-09-123-1/+87
| | | | test/Makefile.am, test/test-names.c: allow hyphens in bus names.
* 2005-09-11 Mark McLoughlin <mark@skynet.ie>Mark McLoughlin2005-09-111-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/data/auth/fallback.auth-script: we don't retry the EXTERNAL method when we know its going to fail anymore. 2005-09-11 Mark McLoughlin <mark@skynet.ie> * dbus/dbus-connection-internal.h: rename (add|remove|toggle)_(watch|timeout) to unlocked() * dbus/dbus-connection.c: ditto. * dbus/dbus-timeout.c, dbus/dbus-transport-unix.c: Update some callers for the renaming. 2005-09-10 Mark McLoughlin <mark@skynet.ie> * dbus/dbus-auth.c: (record_mechanisms): don't retry the first auth mechanism because we know we're just going to get rejected again. * dbus/dbus-keyring.c: (_dbus_keyring_reload): Fix thinko ... and what a nasty little bugger to track down you were ... * dbus/dbus-connection.c: (_dbus_connection_add_watch), (_dbus_connection_remove_watch): add note about these needing the connection to be locked. (_dbus_connection_get_dispatch_status_unlocked): set status to DATA_REMAINS when we queue the disconnected message. * bus/dispatch.c: (bus_dispatch): fix warning. (check_existent_service_no_auto_start): Expect ChildSignaled error too. (check_existent_hello_from_self): fix another couple of warnings.
* * python/Makefile.am: Break on pyrexc errors instead of ignoring themJohn (J5) Palmieri2005-09-011-30/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * python/dbus_bindings.pyx: Memory management foo (global): remove hacky _user_data_references global list (GIL_safe_cunregister_function_handler): userdata now stuffed into tuples. Unref user_data (GIL_safe_cmessage_function_handler): userdata now stuffed into tuples (Connection::__del__): Remove and replace with __dealloc__ method (Connection::add_filter): Stuff user_data into a tuple. Use Py_INCREF to keep tuple from being deallocated instead of the global var hack (Connection::register_object_path): Stuff user_data into a tuple. Use Py_INCREF to keep tuple from being deallocated instead of the global var hack (Connection::register_fallback): Stuff user_data into a tuple. Use Py_INCREF to keep tuple from being deallocated instead of the global var hack (GIL_safe_pending_call_notification): Don't unref the message because it gets unreffed when going out of scope. Py_XDECREF the user_data (PendingCall::__del__): Remove and replace with __dealloc__ method (PendingCall::set_notify): ref the pending call because we will need it to stick around for when the notify callback gets called (Message::__del__): Remove and replace with __dealloc__ method * python/dbus_glib_bindings.pyx (init_gthreads): Changed to gthreads_init to match up with the dbus call * python/glib.py (init_threads): Changed to threads_init to match up with gobject.threads_init(). init_threads is kept for backwards compat but will most likely be deprecated in the future * test/python/test-client.py: - revamp to use Python's unittest functionality - add async call tests - setup threads in glib and dbus so we make sure locks are working
* * s/Message(_create=0)/EmptyMessage everywhere elseJohn (J5) Palmieri2005-08-263-2/+4
| | | | | | * test/python/test-{server|client}.py: add the python/.libs directory to the lookup path so dbus_bindings and dbus_glib_bindings don't get picked up from the system
* * forgot to add the service fileJohn (J5) Palmieri2005-08-251-0/+3
|
* * test/python: Add python regression testJohn (J5) Palmieri2005-08-255-2/+136
| | | | | | * configure.in: Add test/python/Makefile * test/Makefile.am: Add the python directory to SUBDIRS
* 2005-08-23 Colin Walters <walters@verbum.org>Colin Walters2005-08-231-6/+1
| | | | | * test/glib/Makefile.am (test_profile_LDADD): Don't multiply-define EXTRA_DIST.
* 2005-08-04 Colin Walters <walters@verbum.org>Colin Walters2005-08-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gvalue-utils.h (_dbus_g_type_specialized_builtins_init) (dbus_g_type_is_fixed, dbus_g_type_fixed_get_size) (dbus_gvalue_set_from_pointer, dbus_g_hash_table_value_foreach) (dbus_g_hash_table_insert_values, dbus_g_hash_table_insert_steal_values) (dbus_gtype_is_valid_hash_key, dbus_gtype_is_valid_hash_value) (dbus_g_hash_func_from_gtype, dbus_g_hash_free_from_gtype) (dbus_g_hash_equal_from_gtype, dbus_gvalue_stor, dbus_gvalue_take): * glib/dbus-gvalue.h (dbus_g_value_types_init) (dbus_gvalue_demarshal, dbus_gvalue_demarshal_variant) (dbus_gvalue_demarshal_message, dbus_gvalue_marshal): Prefix name with _ to ensure they're not exported. All callers updated. * glib/dbus-gvalue.c (typecode_to_gtype) (dbus_typecode_maps_to_basic, basic_typecode_to_gtype) (signature_iter_to_g_type_dict) (signature_iter_to_g_type_array) (dbus_gtype_from_signature_iter, dbus_gtype_from_signature) (dbus_gtypes_from_arg_signature): Move to dbus-gsignature.c. * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call dbus_g_type_specialized_builtins_init instead of dbus_g_value_types_init. (dbus_binding_tool_output_glib_client): Ditto. * glib/Makefile.am (DBUS_GLIB_INTERNALS): Add dbus-gsignature.c and dbus-gsignature.h * test/glib/test-service-glib.c (my_object_rec_arrays): Delete unused variable.
* 2005-08-03 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-08-031-1/+1
| | | | | | | | * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): fix typo, from Julien Puydt * bus/connection.c (bus_connection_disconnected): we were always doing a wait_for_memory due to a buggy loop, found by Timo Hoenig
* 2005-07-29 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-07-301-2/+3
| | | | | * test/glib/test-profile.c (write_junk): initialize the junk buffer so valgrind doesn't have a breakdown
* 2005-07-24 Colin Walters <walters@verbum.org>Colin Walters2005-07-243-0/+157
| | | | | | | | | * glib/dbus-gvalue.c (signature_iter_to_g_type_array): Don't require typedata; recursive arrays won't have it. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Add recursive arrays tests.
* * Merge DBUS_0_35_2 branch into HEADJohn (J5) Palmieri2005-07-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-07-17 John (J5) Palmieri <johnp@redhat.com> * NEWS: Update to 0.35.2 2005-07-17 John (J5) Palmieri <johnp@redhat.com> * python/_dbus.py: Remove import of the dbus.services module as it no longer exists (patch from Dimitur Kirov) * python/service.py (Object::__init__): Fixed typo s/name/bus_name (patch from Dimitur Kirov) * python/examples/example-signal-emitter.py: import dbus.glib to get the main loop and use glib mainloop instead of gtk so X doesn't have to be running. * python/examples/example-signal-recipient.py: import dbus.glib to get the main loop and use glib mainloop instead of gtk so X doesn't have to be running. Import the decorators module directly. * test/glib/Makefile.am: Added DIST_EXTRA files that distcheck didn't pick up on but are needed to build * configure.in: upped version to 0.35.2 * bus/driver.c, bus/selinux.c, bus/selinux.h, dbus/dbus-protocol.h: added Colin Walters' SELinux API rename patch from head s/unix sercurity context/selinux security context/ 2005-07-16 John (J5) Palmieri <johnp@redhat.com> * python/Makefile.am: dbus_binding.pxd.in should be included in EXTRA_DIST not dbus_binding.pxd fix up $(srcdir) hopefully for the last time * NEWS: Update to 0.35.1
* * bus/dispatch.c, test/test-service.c: Add testcaseJohn (J5) Palmieri2005-07-151-3/+174
| | | | | | | | | | | | for sending messages to oneself (TODO item). * python/service.py (class Object): Swap ordering of bus_name and object_path parameters to better support inheritance. * doc/dbus-tutorial.xml: change Python docs to reflect change in parameter ordering and fix the inheritance section. * doc/TODO: remove sending message to oneself TODO item
* Checking in Rodrigo's patch along with my fixes to the patchJohn (J5) Palmieri2005-07-147-2/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-11 Colin Walters <walters@verbum.org>Colin Walters2005-07-113-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gvalue.c (struct _DBusGValue): Delete. (dbus_g_value_types_init): Remove assertion. (dbus_g_value_get_g_type, dbus_g_value_open) (dbus_g_value_iterator_get_values, dbus_g_value_get_signature) (dbus_g_value_copy, dbus_g_value_free): Delete unimplemented functions related to DBusGValue. Now we marshal/demarshal structures as GValueArray. (dbus_gtype_from_signature_iter): Return G_TYPE_VALUE_ARRAY for structures. (signature_iter_to_g_type_array): Don't call signature_iter_to_g_type_struct. (signature_iter_to_g_type_struct): Delete. (dbus_gvalue_to_signature): Delete. (dbus_gvalue_to_signature): New function with same name as other one; we can convert structures to signatures. (demarshal_valuearray): New function. (get_type_demarshaller): Use it. (demarshal_recurse): Delete. (marshal_proxy): New function. (marshal_map): Warn if we can't determine signature from type. (marshal_collection_ptrarray): Ditto. (marshal_collection_array): Ditto. (get_type_marshaller): Use marshal_valuearray. (marshal_recurse): Delete. (_dbus_gvalue_test): Add some tests. * dbus/dbus-glib.h (struct _DBusGValueIterator): (dbus_g_value_get_g_type, DBUS_TYPE_G_VALUE) (dbus_g_value_open, dbus_g_value_iterator_get_value) (dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse) (dbus_g_value_free): Remove prototypes. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_lookup_function): Handle G_TYPE_VALUE_ARRAY. * glib/examples/example-service.c: * glib/examples/example-client.c: Implement GetTuple. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Add structure tests.
* 2005-07-10 Colin Walters <walters@verbum.org>Colin Walters2005-07-103-11/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/TODO: Knock off some GLib items with this patch. * glib/dbus-gvalue-utils.c (_dbus_gtype_can_signal_error) (_dbus_gvalue_signals_error): New functions. * glib/dbus-gvalue-utils.h: Prototype them. * glib/dbus-gobject.c (arg_iterate): Update to handle return vals and change to not output const/retval flags for input args. All callers updated. (invoke_object_method): Refactor to handle return values. Add some more comments in various places. Remove debug g_print. * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_RETURNVAL): New. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_marshal_name): Handle G_TYPE_NONE. (compute_gsignature): New function; refactored from code from compute_marshaller and compute_marshaller_name. Enhance to handle return values and async ops more cleanly. Update for async ops returning NONE instead of BOOLEAN. (compute_marshaller, compute_marshaller_name): Call compute_gsignature and output appropriate string. (generate_glue): Handle return value annotation. Also don't dump constness flag for input arguments. * glib/Makefile.am (DBUS_GLIB_INTERNALS): New variable; contains files shared between installed library and utilities. (libdbus_glib_1_la_SOURCES): Move some stuf into DBUS_GLIB_INTERNALS. (libdbus_gtool_la_SOURCES): Suck in DBUS_GLIB_INTERNALS so the binding tool can access gtype utility functions. * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: * test/glib/test-dbus-glib.c: Add some tests for return values.
* 2005-07-09 Colin Walters <walters@verbum.org>Colin Walters2005-07-092-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_CONST): Define. * glib/dbus-binding-tool-glib.c (generate_glue): Handle Const annotation. * glib/dbus-gobject.c (arg_iterate): Update to parse constval too. (method_dir_signature_from_object_info): Handle arg_iterate change. (write_interface): Ditto. (lookup_object_info): Don't barf if format_version is > 0. (invoke_object_method): Handle arg constness. * glib/dbus-gidl.c (struct ArgInfo): Add annotations. (arg_info_new): Create. (arg_info_unref): Destroy. (arg_info_get_annotations, arg_info_get_annotation) (arg_info_add_annotation): New functions. * glib/dbus-gidl.h: Prototype them. * glib/dbus-gparser.c (parse_annotation): Allow annotations in args, disallow them in properties. (parse_annotation): Handle arg annotations. * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c: Update to make some methods const.
* 2005-07-08 Colin Walters <walters@verbum.org>Colin Walters2005-07-093-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c: * test/glib/test-dbus-glib.c: Test a{sv}. * glib/examples/statemachine/statemachine.c: * glib/examples/statemachine/statemachine-server.c: * glib/examples/statemachine/statemachine-client.c: Fix some bugs, add progress bar, etc. * glib/dbus-gvalue.c (register_array, register_dict): Delete; not needed anymore due to generic array/map marshalling. (dbus_g_value_types_init): Don't register basic arrays or the string/string hash. (dbus_gtype_from_signature_iter): Don't try to recurse into variants. (dbus_gtype_to_signature): Check collection/map before type metadata. (demarshal_garray_basic): Renamed to demarshal_collection_array. (demarshal_ghashtable): Renamed to demarshal_map; fix to use new generic map creation/append functions instead of hash table specifically. (get_type_demarshaller): Handle maps. (demarshal_collection): Dispatch on collection type to either demarshal_collection_ptrarray or demarshal_collection_array. (get_type_marshaller): Handle maps. (marshal_collection): Dispatch collection type to either marshal_collection_ptrarray or marshal_collection_array. (_dbus_gvalue_test): New test. * glib/dbus-gvalue-utils.c (unset_and_free_g_value): New function. (hash_free_from_gtype): Use it to free GValues. (hashtable_append): New function. (ptrarray_append): Fix prototype. (slist_append): Ditto. (_dbus_gvalue_utils_test): Extend tests. * glib/dbus-gtype-specialized.c (dbus_g_type_specialized_init_append): Renamed from dbus_g_type_specialized_collection_init_append. Remove const from value, since we steal it. (dbus_g_type_specialized_map_append): New function. * glib/dbus-gtype-specialized.h: Update prototypes. Add DBusGTypeSpecializedMapAppendFunc. * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run _dbus_gvalue_test. * glib/dbus-gtest.h: Prototype it.