From: Jukka Rissanen <jukka.rissanen@linux.intel.com>
To: ell@lists.01.org
Subject: Re: [PATCH v2 3/3] unit: dbus: Add test for disconnect watch API
Date: Fri, 13 Feb 2015 16:29:24 +0200 [thread overview]
Message-ID: <1423837764.4196.37.camel@linux.intel.com> (raw)
In-Reply-To: <54DE05F3.9000704@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]
On pe, 2015-02-13 at 08:10 -0600, Denis Kenzior wrote:
> Hi Jukka,
>
> On 02/13/2015 02:40 AM, Jukka Rissanen wrote:
> > On to, 2015-02-12 at 21:36 -0600, Denis Kenzior wrote:
> >> On 02/12/2015 05:48 AM, Jukka Rissanen wrote:
> >>> Test the dbus disconnect watch support.
> >>> ---
> >>> Makefile.am | 3 +
> >>> unit/test-dbus-watch.c | 388 +++++++++++++++++++++++++++++++++++++++++++++++++
> >>> 2 files changed, 391 insertions(+)
> >>> create mode 100644 unit/test-dbus-watch.c
> >>>
> >>
> >> That seems like an awful lot of copy-paste. Can we isolate the actual
> >> signal dispatcher and unit test it properly? For example, you can
> >> always make the message_filter function private (e.g. without
> >> LIB_EXPORT) instead of static and feed it signals created using e.g.
> >> l_dbus_message_new_signal or dbus_message_from_blob
> >
> > I did not quite understand your comment about signal dispatcher and
> > message_filter here, please elaborate a bit more?
> >
>
> Look at how unit/test-dbus-service.c is done. Almost every part of the
> dbus-service code can be tested standalone. You need to think about how
> to do the same.
>
> For example:
> static void message_filter(...) -> void _dbus_message_filter(...)
> static void format_rule(...) -> void _dbus1_format_rule()
>
> Or maybe even allow the entire handle_signal() path to be tested.
>
> Then test this functionality in the unit test. If you're relying on
> semi-manual tests for this stuff, your test coverage will be pretty small.
>
But don't we want to test this against dbus-daemon? Testing this watch
API without dbus-daemon interaction seems pointless to me.
> Regards,
> -Denis
>
> >>
> >> Alternatively, fold this into test-dbus.c if possible.
> >
> > I thought about that but test-dbus.c was already quite big. But if you
> > are ok with that I can certainly do that too.
> >
>
> This is the least preferred option. Only do this for stuff that can't
> be tested via the unit test.
>
> Regards,
> -Denis
>
Jukka
next prev parent reply other threads:[~2015-02-13 14:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 11:48 [PATCH v2 0/3] Add DBus disconnect watch support Jukka Rissanen
2015-02-12 11:48 ` [PATCH v2 1/3] dbus: Add AddMatch and RemoveMatch support Jukka Rissanen
2015-02-13 3:00 ` Denis Kenzior
2015-02-12 11:48 ` [PATCH v2 2/3] dbus: Add disconnect watch support Jukka Rissanen
2015-02-13 3:25 ` Denis Kenzior
2015-02-13 8:26 ` Jukka Rissanen
2015-02-13 14:01 ` Denis Kenzior
2015-02-13 14:23 ` Jukka Rissanen
2015-02-13 15:05 ` Denis Kenzior
2015-02-16 10:22 ` Jukka Rissanen
2015-02-12 11:48 ` [PATCH v2 3/3] unit: dbus: Add test for disconnect watch API Jukka Rissanen
2015-02-13 3:36 ` Denis Kenzior
2015-02-13 8:40 ` Jukka Rissanen
2015-02-13 14:10 ` Denis Kenzior
2015-02-13 14:29 ` Jukka Rissanen [this message]
2015-02-13 15:09 ` Denis Kenzior
2015-02-16 10:53 ` Jukka Rissanen
2015-02-16 15:58 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423837764.4196.37.camel@linux.intel.com \
--to=jukka.rissanen@linux.intel.com \
--cc=ell@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.