This commit is contained in:
khodowany
2026-09-30 18:23:25 -05:00
parent 896de203b3
commit 2a1aa2c67a
40 changed files with 1197 additions and 610 deletions
+18
View File
@@ -150,3 +150,21 @@ BOOST_AUTO_TEST_CASE(zero_touch_stop_and_destruction_suppress_queued_commands) {
BOOST_TEST(commands.empty());
}
}
BOOST_AUTO_TEST_CASE(zero_touch_reset_discards_old_score_gestures_but_accepts_new_input) {
auto io = boost::asio::io_context{};
auto commands = std::vector<std::string>{};
auto touch = vamp_zero::touch_input{io.get_executor(), [&](auto command) { commands.emplace_back(vamp_protocol::page_command_name(command)); }};
auto base = std::chrono::steady_clock::now() - std::chrono::seconds{10};
touch.handle(touch_event(luma::touch_phase::DOWN, base));
touch.handle(touch_event(luma::touch_phase::UP, base + std::chrono::milliseconds{700}));
touch.reset();
io.run();
BOOST_TEST(commands.empty());
io.restart();
touch.handle(touch_event(luma::touch_phase::DOWN, base));
touch.handle(touch_event(luma::touch_phase::UP, base + std::chrono::milliseconds{30}));
io.run();
BOOST_REQUIRE_EQUAL(commands.size(), 1U);
BOOST_TEST(commands.front() == "next");
}