Fix tests for new ensuring under bridges

This commit is contained in:
PavelMikus 2023-05-09 16:46:48 +02:00 committed by Pavel Mikuš
parent 22f7fe3e21
commit 827230174f
2 changed files with 6 additions and 4 deletions

View File

@ -260,7 +260,7 @@ SCENARIO("Cooling integration tests", "[Cooling]") {
});
THEN("slowdown_below_layer_time is honored") {
// Account for some inaccuracies.
const double slowdown_below_layer_time = config.opt<ConfigOptionInts>("slowdown_below_layer_time")->values.front() - 0.2;
const double slowdown_below_layer_time = config.opt<ConfigOptionInts>("slowdown_below_layer_time")->values.front() - 0.5;
size_t minimum_time_honored = std::count_if(layer_times.begin(), layer_times.end(),
[slowdown_below_layer_time](double t){ return t > slowdown_below_layer_time; });
REQUIRE(minimum_time_honored == layer_times.size());

View File

@ -48,9 +48,11 @@ SCENARIO("Shells", "[Shells]") {
REQUIRE(! has_shells(i));
}
THEN("correct number of top solid layers") {
for (int i = 0; i < top_solid_layers; ++ i)
// NOTE: there is one additional layer with enusring line under the bridge layer, bridges would be otherwise anchored weakly to the perimeter.
size_t additional_ensuring_anchors = top_solid_layers > 0 ? 1 : 0;
for (int i = 0; i < top_solid_layers + additional_ensuring_anchors; ++ i)
REQUIRE(has_shells(int(zs.size()) - i - 1));
for (int i = top_solid_layers; i < int(zs.size() / 2); ++ i)
for (int i = top_solid_layers + additional_ensuring_anchors; i < int(zs.size() / 2); ++ i)
REQUIRE(! has_shells(int(zs.size()) - i - 1));
}
if (top_solid_layers > 0) {
@ -144,7 +146,7 @@ SCENARIO("Shells (from Perl)", "[Shells]") {
for (auto z : layers_with_speed(Slic3r::Test::slice({TestMesh::V}, config), solid_speed))
if (z <= 7.2)
++ n;
REQUIRE(n == 3);
REQUIRE(n == 3 + 1/*one additional layer with ensuring for bridge anchors*/);
}
}