From 043c4c5e90a02c5409a61e2ec8a0b7391fa3d3b9 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Thu, 15 Dec 2022 13:20:28 +0100 Subject: [PATCH] Fix for RPI build --- tests/libslic3r/test_emboss.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/libslic3r/test_emboss.cpp b/tests/libslic3r/test_emboss.cpp index ebb1a1792..a045d4990 100644 --- a/tests/libslic3r/test_emboss.cpp +++ b/tests/libslic3r/test_emboss.cpp @@ -377,7 +377,18 @@ TEST_CASE("triangle intersection", "[]") CHECK(abs(i.y() - 1.) < std::numeric_limits::epsilon()); } -#ifndef __APPLE__ + + +#if defined _WIN32 +#define FONT_DIR_PATH "C:/Windows/Fonts"; +#elif defined __linux__ +#define FONT_DIR_PATH "/usr/share/fonts"; +#endif +//#elif defined __APPLE__ +//#define FONT_DIR_PATH "//System/Library/Fonts"; +//#endif + +#ifdef FONT_DIR_PATH #include #include #include @@ -385,14 +396,9 @@ namespace fs = std::filesystem; // Check function Emboss::is_italic that exist some italic and some non-italic font. TEST_CASE("Italic check", "[Emboss]") { + std::string dir_path = FONT_DIR_PATH; std::queue dir_paths; -#ifdef _WIN32 - dir_paths.push("C:/Windows/Fonts"); -#elif defined(__linux__) - dir_paths.push("/usr/share/fonts"); -//#elif defined(__APPLE__) -// dir_paths.push("//System/Library/Fonts"); -#endif + dir_paths.push(dir_path); bool exist_italic = false; bool exist_non_italic = false; while (!dir_paths.empty()) { @@ -425,7 +431,7 @@ TEST_CASE("Italic check", "[Emboss]") CHECK(exist_italic); CHECK(exist_non_italic); } -#endif // not __APPLE__ +#endif // FONT_DIR_PATH #include "libslic3r/CutSurface.hpp" TEST_CASE("Cut surface", "[]")