Merge branch 'master' into fs_emboss

# Conflicts:
#	src/libslic3r/Geometry.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoBase.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoMove.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoMove.hpp
#	src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp
#	src/slic3r/GUI/Gizmos/GLGizmoScale.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoScale.hpp
#	src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp
#	src/slic3r/GUI/ImGuiWrapper.cpp
#	src/slic3r/GUI/ImGuiWrapper.hpp
#	src/slic3r/GUI/Selection.cpp
#	tests/slic3rutils/slic3r_jobs_tests.cpp
This commit is contained in:
Filip Sykala 2022-02-02 15:27:25 +01:00
commit a50d93cd66
327 changed files with 781602 additions and 153573 deletions

View file

@ -6,6 +6,7 @@ add_executable(${_TEST_NAME}_tests
test_aabbindirect.cpp
test_clipper_offset.cpp
test_clipper_utils.cpp
test_color.cpp
test_config.cpp
test_elephant_foot_compensation.cpp
test_geometry.cpp

View file

@ -0,0 +1,37 @@
#include <catch2/catch.hpp>
#include "libslic3r/libslic3r.h"
#include "libslic3r/Color.hpp"
using namespace Slic3r;
SCENARIO("Color encoding/decoding cycle", "[Color]") {
GIVEN("Color") {
const ColorRGB src_rgb(static_cast<unsigned char>(255), static_cast<unsigned char>(127), static_cast<unsigned char>(63));
WHEN("apply encode/decode cycle") {
const std::string encoded = encode_color(src_rgb);
ColorRGB res_rgb;
decode_color(encoded, res_rgb);
const bool ret = res_rgb.r_uchar() == src_rgb.r_uchar() && res_rgb.g_uchar() == src_rgb.g_uchar() && res_rgb.b_uchar() == src_rgb.b_uchar();
THEN("result matches source") {
REQUIRE(ret);
}
}
}
}
SCENARIO("Color picking encoding/decoding cycle", "[Color]") {
GIVEN("Picking color") {
const ColorRGB src_rgb(static_cast<unsigned char>(255), static_cast<unsigned char>(127), static_cast<unsigned char>(63));
WHEN("apply encode/decode cycle") {
const unsigned int encoded = picking_encode(src_rgb.r_uchar(), src_rgb.g_uchar(), src_rgb.b_uchar());
const ColorRGBA res_rgba = picking_decode(encoded);
const bool ret = res_rgba.r_uchar() == src_rgb.r_uchar() && res_rgba.g_uchar() == src_rgb.g_uchar() && res_rgba.b_uchar() == src_rgb.b_uchar();
THEN("result matches source") {
REQUIRE(ret);
}
}
}
}