add drain hole 3mf export and import
This commit is contained in:
parent
3b0241c98b
commit
5be66a52c0
4 changed files with 210 additions and 2 deletions
tests/libslic3r
|
@ -11,4 +11,31 @@ TEST_CASE("sort_remove_duplicates", "[utils]") {
|
|||
REQUIRE(data_src == data_dst);
|
||||
}
|
||||
|
||||
TEST_CASE("string_printf", "[utils]") {
|
||||
SECTION("Empty format with empty data should return empty string") {
|
||||
std::string outs = Slic3r::string_printf("");
|
||||
REQUIRE(outs.empty());
|
||||
}
|
||||
|
||||
SECTION("String output length should be the same as input") {
|
||||
std::string outs = Slic3r::string_printf("1234");
|
||||
REQUIRE(outs.size() == 4);
|
||||
}
|
||||
|
||||
SECTION("String format should be interpreted as with sprintf") {
|
||||
std::string outs = Slic3r::string_printf("%d %f %s", 10, 11.4, " This is a string");
|
||||
char buffer[1024];
|
||||
|
||||
sprintf(buffer, "%d %f %s", 10, 11.4, " This is a string");
|
||||
|
||||
REQUIRE(outs.compare(buffer) == 0);
|
||||
}
|
||||
|
||||
SECTION("String format should survive large input data") {
|
||||
std::string input(2048, 'A');
|
||||
std::string outs = Slic3r::string_printf("%s", input.c_str());
|
||||
REQUIRE(outs.compare(input) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue