~alan-griffiths/mir/fix-1654023

« back to all changes in this revision

Viewing changes to tests/unit-tests/client/test_client_buffer_stream.cpp

  • Committer: Daniel van Vugt
  • Date: 2016-07-18 07:38:38 UTC
  • mfrom: (3595 development-branch)
  • mto: This revision was merged to the branch mainline in revision 3748.
  • Revision ID: daniel.van.vugt@canonical.com-20160718073838-tclt9c441h505wck
Merge latest trunk.  No conflicts in 7+ weeks?!

Show diffs side-by-side

added added

removed removed

Lines of Context:
789
789
    EXPECT_THAT(stream.get_current_buffer_id(), Eq(10));
790
790
}
791
791
 
 
792
//LP: #1584784
 
793
TEST_P(ClientBufferStream, can_cycle_through_available_buffers_without_waiting)
 
794
{
 
795
    ON_CALL(mock_protobuf_server, submit_buffer(_,_,_))
 
796
        .WillByDefault(mtd::RunProtobufClosure());
 
797
    mcl::BufferStream bs{
 
798
        nullptr, wait_handle, mock_protobuf_server,
 
799
        std::make_shared<StubClientPlatform>(mt::fake_shared(stub_factory)),
 
800
        map, factory,
 
801
        response, perf_report, "", size, nbuffers};
 
802
    service_requests_for(bs, mock_protobuf_server.alloc_count);
 
803
 
 
804
    auto count = 0;
 
805
    for(auto i = 0u; i < mock_protobuf_server.alloc_count; i++)
 
806
    {
 
807
        bs.get_current_buffer();
 
808
        bs.next_buffer([&count]{ count++;});
 
809
    }
 
810
}
 
811
 
792
812
INSTANTIATE_TEST_CASE_P(BufferSemanticsMode, ClientBufferStream, Bool());