mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-11 00:48:59 +08:00
Fix narrowing conversion and memory leak in tests
This commit is contained in:
parent
f2868767ab
commit
6b0dcc658d
@ -280,8 +280,8 @@ TEST_CASE("M73s have correct percent values", "[GCode]") {
|
||||
Print print;
|
||||
Model model;
|
||||
TriangleMesh test_mesh{mesh(TestMesh::cube_20x20x20)};
|
||||
const double layer_height = config.opt_float("layer_height");
|
||||
test_mesh.scale(Vec3f{1, 1, layer_height/20});
|
||||
const auto layer_height = static_cast<float>(config.opt_float("layer_height"));
|
||||
test_mesh.scale(Vec3f{1.0F, 1.0F, layer_height/20.0F});
|
||||
Test::init_print({test_mesh}, print, model, config);
|
||||
check_m73s(print);
|
||||
|
||||
|
@ -110,6 +110,7 @@ TEST_CASE("Config apply dynamic to static", "[Config]") {
|
||||
config2->apply(config, true);
|
||||
|
||||
CHECK(config2->opt_int("perimeters") == 2);
|
||||
delete config2;
|
||||
}
|
||||
|
||||
TEST_CASE("Config apply static to dynamic", "[Config]") {
|
||||
@ -118,11 +119,13 @@ TEST_CASE("Config apply static to dynamic", "[Config]") {
|
||||
|
||||
DynamicPrintConfig config2;
|
||||
config2.apply(*config, true);
|
||||
delete config;
|
||||
|
||||
CHECK(
|
||||
config2.opt_int("perimeters") ==
|
||||
DynamicPrintConfig::full_print_config().opt_int("perimeters")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
TEST_CASE("Config apply dynamic to dynamic", "[Config]") {
|
||||
@ -144,6 +147,7 @@ TEST_CASE("Get abs value on percent", "[Config]") {
|
||||
config->set_deserialize_strict("solid_infill_speed", "60");
|
||||
config->set_deserialize_strict("top_solid_infill_speed", "10%");
|
||||
CHECK(config->get_abs_value("top_solid_infill_speed") == 6);
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_CASE("No interference between DynamicConfig objects", "[Config]") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user