Text conflict in include/server/mir/asio_main_loop.h
Text conflict in include/server/mir/default_server_configuration.h
Text conflict in src/server/asio_main_loop.cpp
Text conflict in tests/mir_test/CMakeLists.txt
Text conflict in tests/unit-tests/test_asio_main_loop.cpp
~~~
2598 + auto first_swap = std::make_shared<mt::Signal>();
2599 + auto second_swap = std::make_shared<mt::Signal>();
2600 +
2601 + /* Queue up two pending swaps */
2602 + mg::Buffer* client_buf;
2603 + q.client_acquire([first_swap, &client_buf](mg::Buffer* buffer)
2604 + {
2605 + client_buf = buffer;
2606 + first_swap->raise();
2607 + });
2608 + q.client_acquire([second_swap](mg::Buffer*){ second_swap->raise(); });
2609 +
2610 + ASSERT_FALSE(first_swap->raised());
2611 + ASSERT_FALSE(second_swap->raised());
2612 +
2613 + q.compositor_acquire(nullptr);
2614 +
2615 + EXPECT_TRUE(first_swap->wait_for(std::chrono::milliseconds{100}));
2616 + EXPECT_FALSE(second_swap->raised());
2617 +
2618 + /* We have to release a client buffer here; framedropping or not,
2619 + * a client can't have 2 buffers outstanding in the nbuffers = 2 case.
2620 + */
2621 + q.client_release(client_buf);
2622 +
2623 + policy_factory.trigger_policies();
2624 + EXPECT_TRUE(second_swap->wait_for(std::chrono::milliseconds{100}));
~~~
This can be replaced with:
---
/* Queue up two pending swaps */
auto handle1 = client_acquire_async(q);
auto handle2 = client_acquire_async(q);
ASSERT_THAT(handle1->has_acquired_buffer(), Eq(false));
ASSERT_THAT(handle2->has_acquired_buffer(), Eq(false));
Conflicts with lp:~andreas-pokorny/mir/add-timer-to-main-loop
Text conflict in include/ server/ mir/asio_ main_loop. h server/ mir/default_ server_ configuration. h asio_main_ loop.cpp test/CMakeLists .txt tests/test_ asio_main_ loop.cpp
Text conflict in include/
Text conflict in src/server/
Text conflict in tests/mir_
Text conflict in tests/unit-
~~~ register_ time_change_ callback( [state_ copy](mt: :FakeClock: :time_point now) >threshold) >callback( );
2146 + clock->
2147 + {
2148 + if (state_copy->state == Pending)
2149 + {
2150 + if (now > state_copy-
2151 + {
2152 + state_copy->state = Triggered;
2153 + state_copy-
2154 + return false;
2155 + }
2156 + return true;
2157 + }
2158 + else
2159 + {
2160 + return false;
2161 + }
2162 + });
~~~
This indentation looks awkward. Maybe a private method for that multi-line lambda?
~~~ shared< mt::Signal> (); acquire( [buffers_ swapped] (mg::Buffer* ){ buffers_ swapped- >raise( ); }); FALSE(buffers_ swapped- >wait_for( std::chrono: :milliseconds{ 100})); factory. trigger_ policies( ); TRUE(buffers_ swapped- >wait_for( std::chrono: :milliseconds{ 100}));
2568 + auto buffers_swapped = std::make_
2569 +
2570 + q.client_
2571 +
2572 + EXPECT_
2573 +
2574 + policy_
2575 + EXPECT_
~~~
This can be replaced with:
--- acquire_ async(q) ; THAT(handle- >has_acquired_ buffer( ), Eq(false)); factory. trigger_ policies( ); THAT(handle- >has_acquired_ buffer( ), Eq(true));
auto handle = client_
EXPECT_
policy_
EXPECT_
---
~~~ shared< mt::Signal> (); shared< mt::Signal> (); acquire( [first_ swap, &client_ buf](mg: :Buffer* buffer) >raise( ); acquire( [second_ swap](mg: :Buffer* ){ second_ swap->raise( ); }); FALSE(first_ swap->raised( )); FALSE(second_ swap->raised( )); acquire( nullptr) ; TRUE(first_ swap->wait_ for(std: :chrono: :milliseconds{ 100})); FALSE(second_ swap->raised( )); release( client_ buf); factory. trigger_ policies( ); TRUE(second_ swap->wait_ for(std: :chrono: :milliseconds{ 100}));
2598 + auto first_swap = std::make_
2599 + auto second_swap = std::make_
2600 +
2601 + /* Queue up two pending swaps */
2602 + mg::Buffer* client_buf;
2603 + q.client_
2604 + {
2605 + client_buf = buffer;
2606 + first_swap-
2607 + });
2608 + q.client_
2609 +
2610 + ASSERT_
2611 + ASSERT_
2612 +
2613 + q.compositor_
2614 +
2615 + EXPECT_
2616 + EXPECT_
2617 +
2618 + /* We have to release a client buffer here; framedropping or not,
2619 + * a client can't have 2 buffers outstanding in the nbuffers = 2 case.
2620 + */
2621 + q.client_
2622 +
2623 + policy_
2624 + EXPECT_
~~~
This can be replaced with: acquire_ async(q) ; acquire_ async(q) ; THAT(handle1- >has_acquired_ buffer( ), Eq(false)); THAT(handle2- >has_acquired_ buffer( ), Eq(false));
---
/* Queue up two pending swaps */
auto handle1 = client_
auto handle2 = client_
ASSERT_
ASSERT_
q.compositor_ acquire( this);
EXPECT_ THAT(handle1- >has_acquired_ buffer( ), Eq(true)); THAT(handle2- >has_acquired_ buffer( ), Eq(false));
EXPECT_
handle1- >release_ buffer( ); factory. trigger_ policies( ); THAT(handle2- >has_acquired_ buffer( ), Eq(true));
policy_
EXPECT_
---
~~~ BufferQueueTest , compositor_ swapping_ at_min_ rate_gets_ oldest_ buffer)
2630 +TEST_F(
~~~
That test implementation still depends on the WatchDog class.