diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-03-08 09:29:44 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-03-08 10:28:01 -0800 |
commit | 8fee0f33c081d339a143306a0c82baacdac5a74c (patch) | |
tree | 77988df39646afa76159333ef362a9a29eccd595 /test/util | |
parent | aaf9e8256fa5f9d5cc9f4acfebf28b28d8c543e8 (diff) | |
download | qtlocation-mapboxgl-8fee0f33c081d339a143306a0c82baacdac5a74c.tar.gz |
[core] Fix RunLoop::run() behavior when called a second time
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/run_loop.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/util/run_loop.cpp b/test/util/run_loop.cpp index b6e5acca09..565ce2c066 100644 --- a/test/util/run_loop.cpp +++ b/test/util/run_loop.cpp @@ -29,3 +29,24 @@ TEST(RunLoop, MultipleStop) { 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); +} |