superslicerlibslic3r_tests.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "libslic3r/Utils.hpp"
  2. namespace {
  3. //
  4. //TEST_CASE("sort_remove_duplicates", "[utils]") {
  5. // std::vector<int> data_src = { 3, 0, 2, 1, 15, 3, 5, 6, 3, 1, 0 };
  6. // std::vector<int> data_dst = { 0, 1, 2, 3, 5, 6, 15 };
  7. // Slic3r::sort_remove_duplicates(data_src);
  8. // REQUIRE(data_src == data_dst);
  9. //}
  10. //
  11. //TEST_CASE("string_printf", "[utils]") {
  12. // SECTION("Empty format with empty data should return empty string") {
  13. // std::string outs = Slic3r::string_printf("");
  14. // REQUIRE(outs.empty());
  15. // }
  16. //
  17. // SECTION("String output length should be the same as input") {
  18. // std::string outs = Slic3r::string_printf("1234");
  19. // REQUIRE(outs.size() == 4);
  20. // }
  21. //
  22. // SECTION("String format should be interpreted as with sprintf") {
  23. // std::string outs = Slic3r::string_printf("%d %f %s", 10, 11.4, " This is a string");
  24. // char buffer[1024];
  25. //
  26. // sprintf(buffer, "%d %f %s", 10, 11.4, " This is a string");
  27. //
  28. // REQUIRE(outs.compare(buffer) == 0);
  29. // }
  30. //
  31. // SECTION("String format should survive large input data") {
  32. // std::string input(2048, 'A');
  33. // std::string outs = Slic3r::string_printf("%s", input.c_str());
  34. // REQUIRE(outs.compare(input) == 0);
  35. // }
  36. //}
  37. }