Skip to content
Snippets Groups Projects
Commit f2753ade authored by Jakub Janák's avatar Jakub Janák
Browse files

more sections added to test_TSInstance.cpp

parent c8562376
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ std::set<std::vector<Node> > convert_to_node_set(const std::vector<std::vector<N
}
// ------------------------------------------------ TESTS ------------------------------------------------
TEST_CASE("Solve Correctness", "[all]") {
TEST_CASE("Test Solve Correctness", "[all]") {
std::unique_ptr<TSInstance> instance;
SECTION("K(5)") {
instance = TSInstance::create_synthetic_instance(5);
......@@ -29,11 +29,32 @@ TEST_CASE("Solve Correctness", "[all]") {
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve(""));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
SECTION("K(7)") {
instance = TSInstance::create_synthetic_instance(7);
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve(""));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
SECTION("K(8)") {
instance = TSInstance::create_synthetic_instance(8);
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve(""));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
SECTION("K(9)") {
instance = TSInstance::create_synthetic_instance(9);
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve(""));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
}
TEST_CASE("Solve Parallel Correctness", "[all]") {
TEST_CASE("Test Solve Parallel Correctness", "[all]") {
std::unique_ptr<TSInstance> instance;
SECTION("K(5)") {
instance = TSInstance::create_synthetic_instance(5);
......@@ -47,6 +68,27 @@ TEST_CASE("Solve Parallel Correctness", "[all]") {
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve("p"));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
SECTION("K(7)") {
instance = TSInstance::create_synthetic_instance(7);
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve("p"));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
SECTION("K(8)") {
instance = TSInstance::create_synthetic_instance(8);
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve("p"));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
SECTION("K(9)") {
instance = TSInstance::create_synthetic_instance(9);
const std::set<std::vector<Node> > solveResult = convert_to_node_set(instance->solve("p"));
const std::set<std::vector<Node> > bruteForceResult = convert_to_node_set(instance->brute_force_solve());
REQUIRE(solveResult == bruteForceResult);
}
}
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