Rhythm Time Signatures

This commit is contained in:
khodowany
2026-09-26 01:44:04 -05:00
parent 4485eb7413
commit 4d6348d354
3099 changed files with 203023 additions and 57 deletions
+15 -12
View File
@@ -375,13 +375,14 @@ BOOST_AUTO_TEST_CASE(flat_practice_wraps_and_empty_catalog_returns_to_main) {
for (auto index = std::uint32_t{2}; index <= 366U; ++index) {
auto exercise = first;
exercise.id = std::to_string(index);
exercise.id.insert(0U, 4U - exercise.id.size(), '0');
catalog->practice.exercises.push_back(std::move(exercise));
}
state.catalog = catalog;
state.mode = vamp_zero::app_mode::PRACTICE_EXERCISE_MENU;
state = vamp_zero::apply_app_command(std::move(state), vamp_protocol::page_command::PREVIOUS);
BOOST_TEST(state.selected_practice_exercise_index == 366U);
BOOST_TEST(vamp_zero::selected_practice_exercise(state)->id == "366");
BOOST_TEST(vamp_zero::selected_practice_exercise(state)->id == "0366");
state = vamp_zero::apply_app_command(std::move(state), vamp_protocol::page_command::NEXT);
BOOST_TEST(state.selected_practice_exercise_index == 0U);
state = vamp_zero::apply_app_command(std::move(state), vamp_protocol::page_command::PREVIOUS);
@@ -415,6 +416,8 @@ BOOST_AUTO_TEST_CASE(database_reload_preserves_all_generated_practice_parts) {
BOOST_REQUIRE_MESSAGE(library.has_value(), (library ? "" : library.error().describe()));
BOOST_TEST(library->exercises.size() == expected_exercises);
for (auto const &exercise : library->exercises) {
BOOST_TEST(exercise.id.size() == 4U);
BOOST_TEST(exercise.id.find_first_not_of("0123456789") == std::string::npos);
BOOST_REQUIRE_EQUAL(exercise.parts.size(), 3U);
auto parts = vamp_zero::practice_part_names();
for (auto index = std::size_t{}; index < parts.size(); ++index) {
@@ -447,7 +450,7 @@ BOOST_AUTO_TEST_CASE(numbered_practice_paths_keep_duplicate_titles_separate_and_
auto assets = root / "assets";
auto config = test_database_config(root / "vamp.db");
std::filesystem::create_directories(assets / "songs");
for (auto name : {"010", "002", "001", "127"}) {
for (auto name : {"0010", "0002", "0001", "0127"}) {
for (auto part_name : vamp_zero::practice_part_names()) {
write_text(assets / "practice" / name / vamp_test::part_filename(part_name), score_asset_json("Shared Title", "C", std::string{part_name}));
}
@@ -459,24 +462,24 @@ BOOST_AUTO_TEST_CASE(numbered_practice_paths_keep_duplicate_titles_separate_and_
auto library = future.get();
BOOST_REQUIRE(library);
BOOST_REQUIRE_EQUAL(library->exercises.size(), 4U);
BOOST_TEST(library->exercises[0].id == "001");
BOOST_TEST(library->exercises[1].id == "002");
BOOST_TEST(library->exercises[2].id == "010");
BOOST_TEST(library->exercises[3].id == "127");
BOOST_TEST(library->exercises[0].id == "0001");
BOOST_TEST(library->exercises[1].id == "0002");
BOOST_TEST(library->exercises[2].id == "0010");
BOOST_TEST(library->exercises[3].id == "0127");
for (auto const &exercise : library->exercises) {
BOOST_TEST(exercise.title == "Shared Title");
}
BOOST_REQUIRE(vamp_test::build_catalog(assets, config.path));
std::filesystem::rename(assets / "practice/002", assets / "practice/099");
std::filesystem::rename(assets / "practice/0002", assets / "practice/0099");
BOOST_REQUIRE(vamp_test::build_catalog(assets, config.path));
auto rows = query_database(root / "vamp.db", "SELECT id FROM practice_exercises ORDER BY id");
BOOST_REQUIRE(rows);
BOOST_REQUIRE_EQUAL(rows->rows.size(), 12U);
BOOST_TEST(!has_value(*rows, 0U, "002-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "099-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "010-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "001-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "127-acoustic"));
BOOST_TEST(!has_value(*rows, 0U, "0002-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "0099-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "0010-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "0001-acoustic"));
BOOST_TEST(has_value(*rows, 0U, "0127-acoustic"));
std::filesystem::remove_all(root);
}