[Bug 38206] Tp::StreamTubeChannel (and subclasses) don't have unit tests

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 1 07:50:09 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=38206

--- Comment #10 from Andre Moreira Magalhaes <andrunko at gmail.com> 2011-06-30 22:50:08 PDT ---
(In reply to comment #9)
> The offer tests and specifically the checks for the map contents look okay to
> me.
> 
> An API issue:
> 
> + * This method is only useful if TubeChannel::addressType() is either
> #SocketAddressTypeUnix or
> + * #SocketAddressTypeAbstractUnix and TubeChannel::accessControl() is
> + * #SocketAccessControlCredentials.
> + *
> 
> The user doesn't set the addressType() or accessControl(). The user passes true
> or false as the requiresCredentials param to offerUnixSocket() which they're
> using. Hence, you must refer to those concepts rather than the lower-level
> accessors - the user doesn't have any idea how to make this method "useful"
> otherwise!
> 
> The same goes for the warning messages.
> 
> For that reason, I don't think it's necessarily a great idea to have a
> accessControl() public accessor rather than e.g. some passesCredentials()
> accessor (with the logic that because you told offerUnixSocket() that your
> socket requires credentials, the CM will pass you credentials when connecting).
> 
> In a word, *consistency*.
> 
> The above method's description should also follow the general short descr -
> what it does - when can it be used pattern. Currently the long description
> begins with the quoted chapter, which I'd like moved together with the features
> it needs etc, after the actual description of the mapping.
Ok, moved the accessControl() accessor to be protected now as I believe it may
be useful for custom classes (if any). Tbh I don't see a point in adding a
passesCredentials() (or I would name it expectsCredentials() - expects
credentials from CM) as whoever called offerUnixSocket() already know if
credentials are to be expected or not (at least they should). Let me know if
you still think this should be added.

Branch updated again with more tests (channel invalidation while accepting,
connectionClosed, ...) + some more fixes/updates, I will finish the docs
updates next.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list