0.1 update, make the stop container code more robust and fix some bugs, update the about screen for version 0.1
This commit is contained in:
parent
91fa50370a
commit
e8e93d7b21
17 changed files with 449 additions and 43 deletions
22
tests/test_stop_sequence.cpp
Normal file
22
tests/test_stop_sequence.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "stop_waiter.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
int stop_requests = 0;
|
||||
int probes = 0;
|
||||
const auto first = [&] {
|
||||
++stop_requests;
|
||||
return stop_requests == 1 ? StopProbe::Unknown : StopProbe::Stopped;
|
||||
};
|
||||
const auto state = waitForStopped([&] {
|
||||
++probes;
|
||||
return probes < 2 ? StopProbe::Unknown : StopProbe::Stopped;
|
||||
}, std::chrono::milliseconds(10), std::chrono::milliseconds(1));
|
||||
assert(state == StopProbe::Stopped);
|
||||
assert(first() == StopProbe::Unknown);
|
||||
assert(first() == StopProbe::Stopped);
|
||||
assert(stop_requests == 2);
|
||||
std::cout << "Stop sequence tests passed\n";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue