Skip to content

Commit

Permalink
Check that converted files can be read
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Feb 14, 2023
1 parent cd1005d commit 1b3c897
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_reader_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,45 @@ TEST_CASE("conversions", "[loader_edge_cases]") {
auto mutable_morph =
morphio::mut::Morphology("data/edge_cases/bad_root_point.swc",
morphio::enums::Option::ALLOW_CUSTOM_ROOT_ID);

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_CUSTOM_ROOT_ID.asc");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_CUSTOM_ROOT_ID.asc");

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_CUSTOM_ROOT_ID.h5");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_CUSTOM_ROOT_ID.h5");

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_CUSTOM_ROOT_ID.swc");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_CUSTOM_ROOT_ID.swc");
}

SECTION("testing ALLOW_MULTIPLE_SOMATA option") {
auto mutable_morph =
morphio::mut::Morphology("data/multiple_soma.swc",
morphio::enums::Option::ALLOW_MULTIPLE_SOMATA);

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_MULTIPLE_SOMATA.asc");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_MULTIPLE_SOMATA.asc");

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_MULTIPLE_SOMATA.h5");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_MULTIPLE_SOMATA.h5");

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_MULTIPLE_SOMATA.swc");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_MULTIPLE_SOMATA.swc");
}

SECTION("testing ALLOW_SOMA_BIFURCATIONS option") {
auto mutable_morph =
morphio::mut::Morphology("data/edge_cases/soma_bifurcation.swc",
morphio::enums::Option::ALLOW_SOMA_BIFURCATIONS);

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_SOMA_BIFURCATIONS.asc");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_SOMA_BIFURCATIONS.asc");

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_SOMA_BIFURCATIONS.h5");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_SOMA_BIFURCATIONS.h5");

mutable_morph.write(tmpDirectory / "from_swc_ALLOW_SOMA_BIFURCATIONS.swc");
morphio::mut::Morphology(tmpDirectory / "from_swc_ALLOW_SOMA_BIFURCATIONS.swc");
}

SECTION("testing ALLOW_ROOT_BIFURCATIONS option") {
Expand All @@ -223,18 +241,30 @@ TEST_CASE("conversions", "[loader_edge_cases]") {
auto mutable_morph =
morphio::mut::Morphology("data/multiple_soma.asc",
morphio::enums::Option::ALLOW_MULTIPLE_SOMATA);

mutable_morph.write(tmpDirectory / "from_asc_ALLOW_MULTIPLE_SOMATA.asc");
morphio::mut::Morphology(tmpDirectory / "from_asc_ALLOW_MULTIPLE_SOMATA.asc");

mutable_morph.write(tmpDirectory / "from_asc_ALLOW_MULTIPLE_SOMATA.h5");
morphio::mut::Morphology(tmpDirectory / "from_asc_ALLOW_MULTIPLE_SOMATA.h5");

mutable_morph.write(tmpDirectory / "from_asc_ALLOW_MULTIPLE_SOMATA.swc");
morphio::mut::Morphology(tmpDirectory / "from_asc_ALLOW_MULTIPLE_SOMATA.swc");
}

SECTION("testing ALLOW_SOMA_BIFURCATIONS option") {
auto mutable_morph =
morphio::mut::Morphology("data/edge_cases/soma_bifurcation.asc",
morphio::enums::Option::ALLOW_SOMA_BIFURCATIONS);

mutable_morph.write(tmpDirectory / "from_asc_ALLOW_SOMA_BIFURCATIONS.asc");
morphio::mut::Morphology(tmpDirectory / "from_asc_ALLOW_SOMA_BIFURCATIONS.asc");

mutable_morph.write(tmpDirectory / "from_asc_ALLOW_SOMA_BIFURCATIONS.h5");
morphio::mut::Morphology(tmpDirectory / "from_asc_ALLOW_SOMA_BIFURCATIONS.h5");

mutable_morph.write(tmpDirectory / "from_asc_ALLOW_SOMA_BIFURCATIONS.swc");
morphio::mut::Morphology(tmpDirectory / "from_asc_ALLOW_SOMA_BIFURCATIONS.swc");
}

SECTION("testing ALLOW_ROOT_BIFURCATIONS option") {
Expand Down

0 comments on commit 1b3c897

Please sign in to comment.