From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#43252: 27.1; DBus properties lack type hints or overrides Date: Tue, 22 Sep 2020 18:09:17 +0200 Message-ID: <87k0wl6bf6.fsf@gmx.de> References: <87v9gqquct.fsf@ccss.com> <87363sl4hs.fsf@gmx.de> <877dt3bnfl.fsf@ccss.com> <878sdj84kn.fsf@gmx.de> <871rjbaq05.fsf@ccss.com> <874ko6979w.fsf@gmx.de> <87v9gm9x9i.fsf@ccss.com> <871rj9k78r.fsf@gmx.de> <87imclwow5.fsf@gmx.de> <87pn6t9rbq.fsf@ccss.com> <87y2lggzvd.fsf@gmx.de> <87h7rzadlo.fsf@ccss.com> <87k0wtrir2.fsf@gmx.de> <87een19x9n.fsf@ccss.com> <87a6xor25b.fsf@gmx.de> <87bli49rem.fsf@ccss.com> <87h7rva0ku.fsf@gmx.de> <875z8aa1bm.fsf@ccss.com> <87ft7c8p4k.fsf@gmx.de> <87imc7jqms.fsf@gmx.de> <87zh5i8o9h.fsf@ccss.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18090"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43252@debbugs.gnu.org To: Hugh Daschbach Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 22 18:14:33 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKkw4-0004Ym-Kr for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Sep 2020 18:14:32 +0200 Original-Received: from localhost ([::1]:42038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKkvy-0004yW-N2 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Sep 2020 12:14:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKkrm-00014U-5y for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 12:10:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKkri-0006iE-IW for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 12:10:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKkri-0004sW-Cb for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 12:10:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87v9gqquct.fsf@ccss.com> Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Sep 2020 16:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43252 X-GNU-PR-Package: emacs Original-Received: via spool by 43252-submit@debbugs.gnu.org id=B43252.160079096918696 (code B ref 43252); Tue, 22 Sep 2020 16:10:02 +0000 Original-Received: (at 43252) by debbugs.gnu.org; 22 Sep 2020 16:09:29 +0000 Original-Received: from localhost ([127.0.0.1]:33073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKkrA-0004rU-MS for submit@debbugs.gnu.org; Tue, 22 Sep 2020 12:09:28 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:52763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKkr8-0004rF-L2 for 43252@debbugs.gnu.org; Tue, 22 Sep 2020 12:09:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600790958; bh=1EFcLgIRmT4xjOXduUaeizCwImgBvN4u/5FrYyAc3Jg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date; b=H/aizERAtNpFbsTjgqKqmlyJmn1G7IDJ4ahXmbAGjU8XG7j53GmZbIVMBNSFNiAhs CcU4tgk3ThunkQTLEVTqyJM4Jm2MbZpZ08sAvvQMFP8TQJMq4rBlabThLA6kjWyrOl PgrBkYiv59+6p3rMJgngEpB+rKgK5JkMDAo+J9vc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.46.195]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MrQEn-1kqVEP2UDf-00oVH1; Tue, 22 Sep 2020 18:09:18 +0200 X-Provags-ID: V03:K1:YG9D1+l9n+juahjpl9NC4VhhPToh3W9QxEvlaaRq9qnprpV6ZCm 8o+6jGPCPYpuI2s+a7JB7DxPWyTTmc6UFOtGAuIal8HK7AO/kTjnr6n5GS+nqIA9Ci6De2m GsOhej7r8OOQ65Dzr0mw3V73ywcgFihpAuDH06Nb1U7zLcylJNbqsKg6IF7MzMlqXd71tcg j12SCDIcqz4XKfHZioB1A== X-UI-Out-Filterresults: notjunk:1;V03:K0:99zFPcAdCS4=:vb0FyVbYn8QtaAvTD78d3M xb0Wn80LvP03MT349bt/CmTFbFLowrqWKDgTv3w9joke8UqPcx3Ri0u/GvU68Va0TudX73Fmq 2x3R+OQd5NybksqG4z6VB+qfi5cK03IjpI2q/wV/FkexHKAG2y/IfszkwVUg1Lbe3B1EXzgM4 bUUSRHgbb9ktoKiZJW4zy5Ah+Niwep7nNYphWL9fmPWxJNCDOdsZstBcCv1RHpa4Pmpe95DBl YvtrvjAiFkNSVRXdDXwzzgW2Q5bpiLyVIzoaQfqd1VuwbxUXkyJx+2MtsR3WRczSZ+OP75E/N aOmRxm3FE765MGIPHHQBvIVF8pWG6KcTYebUqLb6NcHc8+NkEtrFE0y//SL0kbs1c9huWO9YR eGy3WXMYVmD4ijE5iXbqUMOq0yzvtA2CCAenkrx5f17uaoIljSJUQoa0Qvw4yRQxLeH1BETY0 BS6CX6GTHirO/DONB+lVJIYuCEoIKONLkuLSm82j93ikD3a4U9u5+0SUGtvyQ+ugyDKRnv/J4 aRCsTCidGggnJg4PwXYLJ9ztjrOSDUbDMVZ9OqUBO4eW1ZP6unLRmW22BFHMbjfZzEWwqhmF7 oaaph9sLb3Li7xcj9s/+8Ht2HxjcqnChRRLFmeRxtbMI7hndH2/w7KFnSgGLcrNXMbulMamk0 eynG7lbjkL8c7xqAeAlq/y8n9F07hXNJbTra8nhjVuOHLaZQNHpPXywOe8FtOqdULY+tkkc7h uiGTQeIiNP4VkpTNwh34lNJHsKsXAzlJj01kMKVvkkmXfYhYAMqkzdTNRzqoPLEMOM/HcVi+ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188715 Archived-At: Hugh Daschbach writes: Hi Hugh, > I have attached two patches for your review. I think the property > tests are complete; I've adjusted the tests to expect errors on > register or set rather than get. Thanks for this. AFAICS, there's nothing left open for bug#43252; I'd like to close it. Is this OK for you? > And, of course, let me know what you think should be reworked. There are only some nits left to comment. > Add DBus tests to validate property handling. Includes cycling We call this beast D-Bus, with a hyphen. Here and everywhere in the docstrings and comments. > register, get, set, get, GetAll, and GetManagedObjects over > several property types. > > Add tests that should fail, like setting a property with a type > different from it's type at registration time. We add also a ChangeLog style entry to the commit message, see the git log of dbus-tests.el. > +The argument SELECTOR indicates whether the test should expand to > +'dbus-register-property' (if SELECTOR is 'register) or `dbus-register' (if SELECTOR is `register') or > +(ert-deftest dbus-test06-test-property-types () The "-test" part of the name seems to be superfluous; I'd call it dbus-test06-property-types. (You see, just nitpicks :-) > + (dbus--test-property > + "Dictionary" > + '((:array > + :dict-entry (:string "four" (:variant :string "value of four")) > + :dict-entry ("five" (:variant :object-path "/nodex")) > + :dict-entry ("six" (:variant (:array :byte 4 :byte 5 :byte 6)))) This is one possibility to declare a :dict-entry. The other possibility, with the same result, is '((:array (:dict-entry :string "four" (:variant :string "value of four")) (:dict-entry "five" (:variant :object-path "/nodex")) (:dict-entry "six" (:variant (:array :byte 4 :byte 5 :byte 6)))) ... Do you mind to test both? > + (should-error ; Cannot set property with :read access > + (equal > + (dbus-set-property > + :session dbus--test-service dbus--test-path > + dbus--test-interface "StringArray" > + '(:array "seven" "eight" :string "nine")) > + nil)) The error happens in dbus-set-property. No need to test further for equal. So you could do (should-error ; Cannot set property with :read access (dbus-set-property :session dbus--test-service dbus--test-path dbus--test-interface "StringArray" '(:array "seven" "eight" :string "nine"))) Furthermore, you could test which error is raised (should-error allows this). Something like (should-error ; Cannot set property with :read access (dbus-set-property :session dbus--test-service dbus--test-path dbus--test-interface "StringArray" '(:array "seven" "eight" :string "nine")) :type 'dbus-error) Similar approach for your other should-error forms. > + ;; Test integer overflow I don't see any integer *overflow* in the following tests. > Thanks, > Hugh Best regards, Michael.