71 + mtd::MockFrameDroppingPolicyFactory policy_factory; 72 + mc::BufferQueue queue{nbuffers, mt::fake_shared(server_buffer_factory), 73 + properties, policy_factory}; 74 + queue.allow_framedropping(false); 75 + 76 + mg::Buffer* client_buffer = nullptr; 77 + auto callback = [&](mg::Buffer* buffer) 78 + { 79 + client_buffer = buffer; 80 + }; 81 + 82 + auto client_try_acquire = [&]() -> bool 83 + { 84 + queue.client_acquire(callback); 85 + return client_buffer != nullptr; 86 + };
C++11 is shiny bit this is being too clever.
Why aren't queue, client_try_acquire etc. just members of a fixture?
« Back to merge proposal
71 + mtd::MockFrameD roppingPolicyFa ctory policy_factory; shared( server_ buffer_ factory) , framedropping( false); acquire( callback) ;
72 + mc::BufferQueue queue{nbuffers, mt::fake_
73 + properties, policy_factory};
74 + queue.allow_
75 +
76 + mg::Buffer* client_buffer = nullptr;
77 + auto callback = [&](mg::Buffer* buffer)
78 + {
79 + client_buffer = buffer;
80 + };
81 +
82 + auto client_try_acquire = [&]() -> bool
83 + {
84 + queue.client_
85 + return client_buffer != nullptr;
86 + };
C++11 is shiny bit this is being too clever.
Why aren't queue, client_try_acquire etc. just members of a fixture?