reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit d1fc26b4cc94d4a8a3cfa1b8fd5f766a5ec85aa3
parent eff92e193c55402a503a256affa0772b67599a3b
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun, 19 Jun 2016 16:03:45 -0400

add missing index reading tests

Diffstat:
Mtest/index_v1.cpp | 27+++++++++++++++++++++++++++
Atest/indexes/v1/ReaPack/src_platform.xml | 10++++++++++
Atest/indexes/v1/ReaPack/src_type.xml | 9+++++++++
3 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/test/index_v1.cpp b/test/index_v1.cpp @@ -232,3 +232,30 @@ TEST_CASE("read index name (from raw data only)") { REQUIRE(ri->name() == ""); } } + +TEST_CASE("read source platform", M) { + UseRootPath root(RIPATH); + + IndexPtr ri = Index::load("src_platform"); + + CHECK(ri->packages().size() == 1); + +#ifdef __APPLE__ + const auto expected = Platform::DarwinPlatform; +#elif _WIN32 + const auto expected = Platform::WindowsPlatform; +#endif + + REQUIRE(ri->category(0)->package(0)->version(0)->source(0)->platform() + == expected); +} + +TEST_CASE("read source type override", M) { + UseRootPath root(RIPATH); + + IndexPtr ri = Index::load("src_type"); + + CHECK(ri->packages().size() == 1); + REQUIRE(ri->category(0)->package(0)->version(0)->source(0)->typeOverride() + == Package::EffectType); +} diff --git a/test/indexes/v1/ReaPack/src_platform.xml b/test/indexes/v1/ReaPack/src_platform.xml @@ -0,0 +1,10 @@ +<index version="1"> + <category name="catname"> + <reapack name="packname" type="script"> + <version name="1.0"> + <source platform="windows" type="effect">https://google.com/</source> + <source platform="darwin" type="effect">https://google.com/</source> + </version> + </reapack> + </category> +</index> diff --git a/test/indexes/v1/ReaPack/src_type.xml b/test/indexes/v1/ReaPack/src_type.xml @@ -0,0 +1,9 @@ +<index version="1"> + <category name="catname"> + <reapack name="packname" type="script"> + <version name="1.0"> + <source platform="all" type="effect">https://google.com/</source> + </version> + </reapack> + </category> +</index>