diff --git a/test/unit/metrics.cpp b/test/unit/metrics.cpp index 6eb98d95..7dd39374 100644 --- a/test/unit/metrics.cpp +++ b/test/unit/metrics.cpp @@ -13,8 +13,8 @@ using namespace gapp; using namespace gapp::metrics; constexpr static size_t num_obj = 3; -constexpr static size_t num_gen = 10; -constexpr static size_t popsize = 100; +constexpr static size_t num_gen = 5; +constexpr static size_t popsize = 20; TEMPLATE_TEST_CASE("fitness_metrics", "[metrics]", FitnessMin, FitnessMax, FitnessMean, FitnessVariance, FitnessStdDev, NadirPoint) @@ -31,9 +31,9 @@ TEMPLATE_TEST_CASE("fitness_metrics", "[metrics]", FitnessMin, FitnessMax, Fitne REQUIRE(metric.data().size() == num_gen); REQUIRE(std::all_of(metric.begin(), metric.end(), detail::is_size(num_obj))); - REQUIRE(metric[4].size() == num_obj); + REQUIRE(metric[0].size() == num_obj); - const auto& val = metric[7]; + const auto& val = metric[1]; REQUIRE(std::all_of(val.begin(), val.end(), detail::equal_to(0.0))); } @@ -48,7 +48,7 @@ TEST_CASE("nadir_point_metric", "[metrics]") REQUIRE(metric.size() == num_gen); REQUIRE(std::all_of(metric.begin(), metric.end(), detail::is_size(num_obj))); - const auto& val = metric[5]; + const auto& val = metric[1]; REQUIRE(std::all_of(val.begin(), val.end(), detail::equal_to(0.0))); } diff --git a/test/unit/mutation.cpp b/test/unit/mutation.cpp index 9e6b8870..7c85d4fe 100644 --- a/test/unit/mutation.cpp +++ b/test/unit/mutation.cpp @@ -108,7 +108,7 @@ TEMPLATE_TEST_CASE("real_mutation", "[mutation]", real::Boundary, real::Gauss, r const Bounds bounds = { -1.0, 1.0 }; RCGA context; - context.solve(DummyFitnessFunction(10), bounds); + context.solve(DummyFitnessFunction(10), bounds, 1); Candidate candidate{ { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } }; candidate.fitness = { 0.0 }; candidate.is_evaluated = true;