some test fixes (wip)

This commit is contained in:
supermerill 2020-03-27 01:07:03 +01:00
parent 90a8e61c18
commit 79890248a5
2 changed files with 13 additions and 7 deletions

View File

@ -289,8 +289,8 @@ TEST_CASE("Fill: extrude gcode and check it")
}
});
double perimeterRoundGapRemove = unscaled(print.objects()[0]->layers()[0]->slices[0].contour.length()) * 0.1*0.1 * (2 - (PI / 2));
double perimeterRoundGapAdd = unscaled(print.objects()[0]->layers()[0]->slices[0].contour.length()) * 0.1*0.1 * ((PI / 2));
double perimeterRoundGapRemove = unscaled(print.objects()[0]->layers()[0]->lslices[0].contour.length()) * 0.1*0.1 * (2 - (PI / 2));
double perimeterRoundGapAdd = unscaled(print.objects()[0]->layers()[0]->lslices[0].contour.length()) * 0.1*0.1 * ((PI / 2));
//for (Line &l : print.objects()[0]->layers()[0]->slices.expolygons[0].contour.lines()) {
//}
@ -397,8 +397,8 @@ TEST_CASE("Fill: extrude gcode and check it")
}
});
double perimeterRoundGapRemove = unscaled(print.objects()[0]->layers()[0]->slices[0].contour.length()) * 0.1*0.1 * (2 - (PI / 2));
double perimeterRoundGapAdd = unscaled(print.objects()[0]->layers()[0]->slices[0].contour.length()) * 0.1*0.1 * ((PI / 2));
double perimeterRoundGapRemove = unscaled(print.objects()[0]->layers()[0]->lslices[0].contour.length()) * 0.1*0.1 * (2 - (PI / 2));
double perimeterRoundGapAdd = unscaled(print.objects()[0]->layers()[0]->lslices[0].contour.length()) * 0.1*0.1 * ((PI / 2));
double volumeExtrPerimeter = ExtrusionGetVolume{}.get(print.objects()[0]->layers()[0]->regions()[0]->perimeters);
double volumeExtrInfill = ExtrusionGetVolume{}.get(print.objects()[0]->layers()[0]->regions()[0]->fills);

View File

@ -116,9 +116,15 @@ SCENARIO("set_speed emits values with fixed-point output.") {
GIVEN("GCodeWriter instance") {
GCodeWriter writer;
WHEN("set_speed is called to set speed to 1.09321e+06") {
THEN("Output string is G1 F1093210.000") {
REQUIRE_THAT(writer.set_speed(1.09321e+06), Catch::Equals("G1 F1093210.000\n"));
//max in assert is 100k
//WHEN("set_speed is called to set speed to 1.09321e+06") {
// THEN("Output string is G1 F1093210.000") {
// REQUIRE_THAT(writer.set_speed(1.09321e+06), Catch::Equals("G1 F1093210.000\n"));
// }
//}
WHEN("set_speed is called to set speed to 9.99321e+04") {
THEN("Output string is G1 F99932.100") {
REQUIRE_THAT(writer.set_speed(9.99321e+04), Catch::Equals("G1 F10932.100\n"));
}
}
WHEN("set_speed is called to set speed to 1") {