mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-02 18:00:38 +08:00
Add test_gcode.cpp
This commit is contained in:
parent
8cf8736516
commit
ac3f4f2d03
15
src/test/libslic3r/test_gcode.cpp
Normal file
15
src/test/libslic3r/test_gcode.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <catch.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
#include "GCode/CoolingBuffer.hpp"
|
||||||
|
#include "GCode.hpp"
|
||||||
|
|
||||||
|
SCENARIO("Cooling buffer speed factor rewrite enforces precision") {
|
||||||
|
GIVEN("GCode line of set speed") {
|
||||||
|
std::string gcode_string = "G1 F1000000.000";
|
||||||
|
WHEN("40% speed factor is applied to a speed of 1000000 with 3-digit precision") {
|
||||||
|
Slic3r::apply_speed_factor(gcode_string, (1.0f/3.0f), 30.0);
|
||||||
|
REQUIRE_THAT(gcode_string, Catch::Equals("G1 F333333.344"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user