Mir

Code review comment for lp:~mir-team/mir/add-dispatchable-interface

Revision history for this message
Robert Carr (robertcarr) wrote :

I think some of the tests could be made easier to read without much effort.

test_simple_dispatch_thread:

Since there are no expectations you can use a StubDispatchable and clean up the test body a little. Likewise you can move at least the dispatcher and the signal and uint64_t dummy to the fixture.

test_stream_transport:

+ // A valid fd is >= 0, and we know that stdin, stdout, and stderr aren't correct.

fnctl(fd, O_GETFD) is used elsewhere.

+ uint64_t dummy{0xdeadbeef};

Can be moved to fixture or

1084:
+ EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));

Perhaps move to fixture...write_to_fd()

1138: + std::this_thread::sleep_for(std::chrono::seconds{1});

:(

1095: + auto observer = std::make_shared<NiceMock<MockObserver>>();

Stub

review: Needs Fixing

« Back to merge proposal