[test] add .test.cpp suffix to test case files
This commit is contained in:
52
test/util/run_loop.test.cpp
Normal file
52
test/util/run_loop.test.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
#include <mbgl/util/timer.hpp>
|
||||
|
||||
#include <mbgl/test/util.hpp>
|
||||
|
||||
using namespace mbgl::util;
|
||||
|
||||
TEST(RunLoop, Stop) {
|
||||
RunLoop loop(RunLoop::Type::New);
|
||||
|
||||
Timer timer;
|
||||
timer.start(mbgl::Duration::zero(), mbgl::Duration::zero(), [&] {
|
||||
loop.stop();
|
||||
});
|
||||
|
||||
loop.run();
|
||||
}
|
||||
|
||||
TEST(RunLoop, MultipleStop) {
|
||||
RunLoop loop(RunLoop::Type::New);
|
||||
|
||||
Timer timer;
|
||||
timer.start(mbgl::Duration::zero(), mbgl::Duration::zero(), [&] {
|
||||
loop.stop();
|
||||
loop.stop();
|
||||
loop.stop();
|
||||
loop.stop();
|
||||
});
|
||||
|
||||
loop.run();
|
||||
}
|
||||
|
||||
TEST(RunLoop, MultipleRun) {
|
||||
RunLoop loop(RunLoop::Type::New);
|
||||
|
||||
Timer timer;
|
||||
timer.start(mbgl::Duration::zero(), mbgl::Duration::zero(), [&] {
|
||||
loop.stop();
|
||||
});
|
||||
|
||||
loop.run();
|
||||
|
||||
bool secondTimeout = false;
|
||||
timer.start(mbgl::Duration::zero(), mbgl::Duration::zero(), [&] {
|
||||
secondTimeout = true;
|
||||
loop.stop();
|
||||
});
|
||||
|
||||
loop.run();
|
||||
|
||||
EXPECT_TRUE(secondTimeout);
|
||||
}
|
||||
Reference in New Issue
Block a user