Update
ci / checks (push) Successful in 1h15m13s

This commit is contained in:
khodowany
2026-09-24 06:20:37 -05:00
parent da5640291a
commit 1be98e14aa
35 changed files with 191 additions and 184 deletions
+12 -11
View File
@@ -41,7 +41,7 @@
#include <vamp_zero/score.hpp>
#include <vamp_zero/types.hpp>
#include "catalogue_fixture.hpp"
#include "catalog_fixture.hpp"
namespace {
@@ -137,7 +137,7 @@ auto navigation_state() -> vamp_zero::app_state {
auto practice = vamp_zero::group_practice_exercises({exercise});
BOOST_REQUIRE(practice);
return vamp_zero::app_state{
.catalog = std::make_shared<vamp_zero::catalogue const>(vamp_zero::catalogue{
.catalog = std::make_shared<vamp_zero::catalog const>(vamp_zero::catalog{
.performance = vamp_zero::group_library_parts({part}),
.practice = std::move(*practice),
}),
@@ -157,6 +157,7 @@ BOOST_AUTO_TEST_CASE(runtime_config_uses_headless_and_ignores_unknown_fields) {
BOOST_REQUIRE(parsed);
BOOST_TEST(parsed->runtime.headless);
BOOST_TEST(!parsed->audio.enabled);
BOOST_TEST(parsed->database.path == "/usr/share/product-vamp/catalog.db");
auto invalid = vamp_zero::parse_config(boost::json::parse(R"json({"runtime":{"headless":"yes"}})json"));
BOOST_TEST(!invalid);
}
@@ -274,7 +275,7 @@ BOOST_AUTO_TEST_CASE(main_menu_metronome_setting_survives_score_selection) {
BOOST_TEST(!state.audio.tempo_editing);
}
BOOST_AUTO_TEST_CASE(score_parser_loads_the_generated_catalogue) {
BOOST_AUTO_TEST_CASE(score_parser_loads_the_generated_catalog) {
auto count = std::size_t{};
for (auto const &entry : std::filesystem::recursive_directory_iterator{VAMP_TEST_ASSETS_DIR}) {
if (entry.path().extension() != ".json") {
@@ -294,7 +295,7 @@ BOOST_AUTO_TEST_CASE(score_parser_loads_the_generated_catalogue) {
BOOST_AUTO_TEST_CASE(practice_part_navigation_and_remote_display) {
auto state = navigation_state();
auto catalog = std::make_shared<vamp_zero::catalogue>(*state.catalog);
auto catalog = std::make_shared<vamp_zero::catalog>(*state.catalog);
auto &practice_part = catalog->practice.exercises.front().parts[2];
practice_part.source_path = "exercise-vocal.json";
practice_part.total_pages = 3U;
@@ -350,9 +351,9 @@ BOOST_AUTO_TEST_CASE(practice_part_navigation_and_remote_display) {
BOOST_REQUIRE(vamp_zero::validate_app_state(state));
}
BOOST_AUTO_TEST_CASE(flat_practice_wraps_and_empty_catalogue_returns_to_main) {
BOOST_AUTO_TEST_CASE(flat_practice_wraps_and_empty_catalog_returns_to_main) {
auto state = navigation_state();
auto catalog = std::make_shared<vamp_zero::catalogue>(*state.catalog);
auto catalog = std::make_shared<vamp_zero::catalog>(*state.catalog);
auto first = catalog->practice.exercises.front();
for (auto index = std::uint32_t{2}; index <= 366U; ++index) {
auto exercise = first;
@@ -369,7 +370,7 @@ BOOST_AUTO_TEST_CASE(flat_practice_wraps_and_empty_catalogue_returns_to_main) {
state = vamp_zero::apply_app_command(std::move(state), vamp_protocol::page_command::PREVIOUS);
state = vamp_zero::apply_app_command(std::move(state), vamp_protocol::page_command::SELECT);
BOOST_CHECK(state.mode == vamp_zero::app_mode::PRACTICE_PART_MENU);
state.catalog = vamp_zero::empty_catalogue();
state.catalog = vamp_zero::empty_catalog();
state = vamp_zero::apply_app_command(std::move(state), vamp_protocol::page_command::NEXT);
BOOST_CHECK(state.mode == vamp_zero::app_mode::PRACTICE_EXERCISE_MENU);
BOOST_TEST(state.selected_practice_exercise_index == 0U);
@@ -389,7 +390,7 @@ BOOST_AUTO_TEST_CASE(database_reload_preserves_all_generated_practice_parts) {
}
BOOST_REQUIRE(expected_exercises > 0U);
for (auto iteration = std::uint32_t{}; iteration < 2U; ++iteration) {
config.path = (std::filesystem::path{VAMP_TEST_ASSETS_DIR} / "catalogue.db").string();
config.path = (std::filesystem::path{VAMP_TEST_ASSETS_DIR} / "catalog.db").string();
auto io = boost::asio::io_context{};
auto future = boost::asio::co_spawn(io, vamp_zero::async_load_practice_library(io.get_executor(), config, VAMP_TEST_ASSETS_DIR), boost::asio::use_future);
io.run();
@@ -434,7 +435,7 @@ BOOST_AUTO_TEST_CASE(numbered_practice_paths_keep_duplicate_titles_separate_and_
write_text(assets / "practice" / name / vamp_test::part_filename(part_name), score_asset_json("Shared Title", "C", std::string{part_name}));
}
}
BOOST_REQUIRE(vamp_test::build_catalogue(assets, config.path));
BOOST_REQUIRE(vamp_test::build_catalog(assets, config.path));
auto io = boost::asio::io_context{};
auto future = boost::asio::co_spawn(io, vamp_zero::async_load_practice_library(io.get_executor(), config, assets.string()), boost::asio::use_future);
io.run();
@@ -448,9 +449,9 @@ BOOST_AUTO_TEST_CASE(numbered_practice_paths_keep_duplicate_titles_separate_and_
for (auto const &exercise : library->exercises) {
BOOST_TEST(exercise.title == "Shared Title");
}
BOOST_REQUIRE(vamp_test::build_catalogue(assets, config.path));
BOOST_REQUIRE(vamp_test::build_catalog(assets, config.path));
std::filesystem::rename(assets / "practice/002", assets / "practice/099");
BOOST_REQUIRE(vamp_test::build_catalogue(assets, config.path));
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);