Skip to content
Snippets Groups Projects
Commit 75da256e authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add missing tests for PartitionerOptions

parent daac0a5c
No related branches found
No related tags found
1 merge request!204Remove m_cell_global_index from Connectivity
......@@ -43,9 +43,7 @@ getPartitionerEnumFromName(const std::string& enum_name)
return PartitionerEnumType{enum_value};
}
}
// LCOV_EXCL_START
throw UnexpectedError(std::string{"could not find '"} + enum_name + "' associate type!");
// LCOV_EXCL_STOP
throw NormalError(std::string{"could not find '"} + enum_name + "' associate type!");
}
class PartitionerOptions
......
......@@ -13,7 +13,33 @@ TEST_CASE("PartitionerOptions", "[utils]")
REQUIRE(name(PartitionerLibrary::ptscotch) == "PTScotch");
REQUIRE_THROWS_WITH(name(PartitionerLibrary::PT__end),
"unexpected error: Partitioner library name is not defined!");
}
SECTION("type from name")
{
REQUIRE(getPartitionerEnumFromName<PartitionerLibrary>("ParMETIS") == PartitionerLibrary::parmetis);
REQUIRE(getPartitionerEnumFromName<PartitionerLibrary>("PTScotch") == PartitionerLibrary::ptscotch);
REQUIRE_THROWS_WITH(getPartitionerEnumFromName<PartitionerLibrary>("foobar"),
"error: could not find 'foobar' associate type!");
}
SECTION("output")
{
{
PartitionerOptions options;
options.library() = PartitionerLibrary::parmetis;
std::stringstream os;
os << options;
REQUIRE(os.str() == " library: ParMETIS\n");
}
WARN("not finished");
{
PartitionerOptions options;
options.library() = PartitionerLibrary::ptscotch;
std::stringstream os;
os << options;
REQUIRE(os.str() == " library: PTScotch\n");
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment