1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 19:31:02 -08:00

Document D-Bus monitoring

* doc/misc/dbus.texi: Replace "symbol" by "keyword" where appropriate.
(Alternative Buses): Adapt dbus-init-bus description.
(Errors and Events): Adapt dbus-event structure.  New defuns
dbus-event-destination-name, dbus-event-handler and dbus-event-arguments.
(Monitoring Events): New node.

* lisp/net/dbus.el: Replace "symbol" by "keyword" where appropriate.
(cl-lib): Require.
(dbus-register-monitor): Adapt the argument list.
(dbus-monitor-handler): Extend.
(dbus-init-bus): Adapt docstring.

* test/lisp/net/dbus-tests.el (dbus-test01-compound-types):
Skip if needed.  Extend test.
This commit is contained in:
Michael Albinus 2020-09-27 18:59:04 +02:00
parent f2a6bbefa9
commit 4155ca273a
3 changed files with 251 additions and 149 deletions

View file

@ -66,6 +66,7 @@
(ert-deftest dbus-test01-type-conversion ()
"Check type conversion functions."
(skip-unless dbus--test-enabled-session-bus)
(let ((ustr "0123abc_xyz\x01\xff")
(mstr "Grüß Göttin"))
(should
@ -97,6 +98,7 @@
(ert-deftest dbus-test01-basic-types ()
"Check basic D-Bus type arguments."
(skip-unless dbus--test-enabled-session-bus)
;; Unknown keyword.
(should-error
(dbus-check-arguments :session dbus--test-service :keyword)
@ -288,6 +290,8 @@
(ert-deftest dbus-test01-compound-types ()
"Check basic D-Bus type arguments."
(skip-unless dbus--test-enabled-session-bus)
;; `:array'. It contains several elements of the same type.
(should (dbus-check-arguments :session dbus--test-service '("string")))
(should (dbus-check-arguments :session dbus--test-service '(:array "string")))
@ -327,6 +331,11 @@
(dbus-check-arguments
:session dbus--test-service
'(:array (:dict-entry :string "string" :boolean t))))
;; This is an alternative syntax. FIXME: Shall this be supported?
(should
(dbus-check-arguments
:session dbus--test-service
'(:array :dict-entry (:string "string" :boolean t))))
;; The second element is `nil' (implicitly). FIXME: Is this right?
(should
(dbus-check-arguments