Merge lp:~chipaca/ubuntu-push/coverage-on-bus-testing into lp:ubuntu-push/automatic

Proposed by John Lenton
Status: Merged
Approved by: John Lenton
Approved revision: 173
Merged at revision: 173
Proposed branch: lp:~chipaca/ubuntu-push/coverage-on-bus-testing
Merge into: lp:ubuntu-push/automatic
Diff against target: 28 lines (+18/-0)
1 file modified
bus/testing/testing_endpoint_test.go (+18/-0)
To merge this branch: bzr merge lp:~chipaca/ubuntu-push/coverage-on-bus-testing
Reviewer Review Type Date Requested Status
Samuele Pedroni Approve
Review via email: mp+221364@code.launchpad.net

This proposal supersedes a proposal from 2014-05-29.

Commit message

100% coverage on bus/testing

Description of the change

100% coverage on bus/testing, fwiw.

To post a comment you must log in.
Revision history for this message
Samuele Pedroni (pedronis) wrote :

see inline comment

review: Approve
173. By John Lenton

fixed comment on test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bus/testing/testing_endpoint_test.go'
2--- bus/testing/testing_endpoint_test.go 2014-05-15 12:27:32 +0000
3+++ bus/testing/testing_endpoint_test.go 2014-06-02 10:04:51 +0000
4@@ -76,6 +76,24 @@
5 []callArgs{{"what", []interface{}{"is", "this", "thing"}}})
6 }
7
8+// Test that Call() fails but does not explode when asked to return values
9+// that can't be packed into a dbus message.
10+func (s *TestingEndpointSuite) TestCallFailsOnBadRetval(c *C) {
11+ endp := NewTestingEndpoint(nil, condition.Work(true), Equals)
12+ var r uint32
13+ e := endp.Call("what", bus.Args(), &r)
14+ c.Check(e, NotNil)
15+}
16+
17+// Test that Call() fails but does not explode when given an improper result
18+// destination (one into which the dbus response can't be stuffed).
19+func (s *TestingEndpointSuite) TestCallFailsOnBadArg(c *C) {
20+ endp := NewTestingEndpoint(nil, condition.Work(true), 1)
21+ r := func() {}
22+ e := endp.Call("what", bus.Args(), &r)
23+ c.Check(e, NotNil)
24+}
25+
26 // Test that WatchSignal() with a positive condition sends the provided return
27 // values over the channel.
28 func (s *TestingEndpointSuite) TestWatch(c *C) {

Subscribers

People subscribed via source and target branches