333
Regression test for LP#1270964
334
In the original bug, SwitchingBundle::last_consumed would be used without ever being set
335
in the compositor_acquire() call, thus its initial value of zero would wrongly be used
336
and lead to the wrong buffer being given to the compositor
338
TEST_F(SwitchingBundleTest, compositor_client_interleaved)
341
mc::SwitchingBundle bundle(nbuffers, allocator, basic_properties);
342
mg::Buffer* client_buffer = nullptr;
343
std::shared_ptr<mg::Buffer> compositor_buffer = nullptr;
345
client_buffer = bundle.client_acquire();
346
mg::BufferID first_ready_buffer_id = client_buffer->id();
347
bundle.client_release(client_buffer);
349
client_buffer = bundle.client_acquire();
351
// in the original bug, compositor would be given the wrong buffer here
352
compositor_buffer = bundle.compositor_acquire(0 /*frameno*/);
354
ASSERT_EQ(first_ready_buffer_id, compositor_buffer->id());
357
bundle.client_release(client_buffer);
358
bundle.compositor_release(compositor_buffer);
359
compositor_buffer.reset();
332
362
TEST_F(SwitchingBundleTest, overlapping_compositors_get_different_frames)
334
364
// This test simulates bypass behaviour