From 6b6b0869485ab0c130b3a6cf9c03fa42e291c7d9 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 10 May 2021 12:18:30 +0200 Subject: [PATCH] Fixed tests and windows build --- src/libslic3r/LocalesUtils.cpp | 2 +- tests/libslic3r/test_config.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/LocalesUtils.cpp b/src/libslic3r/LocalesUtils.cpp index 116078a25..cb118f99c 100644 --- a/src/libslic3r/LocalesUtils.cpp +++ b/src/libslic3r/LocalesUtils.cpp @@ -24,7 +24,7 @@ CNumericLocalesSetter::CNumericLocalesSetter() CNumericLocalesSetter::~CNumericLocalesSetter() { #ifdef _WIN32 - std::setlocale(LC_NUMERIC, m_orig_numeric_locale) + std::setlocale(LC_NUMERIC, m_orig_numeric_locale.data()); #else uselocale(m_original_locale); freelocale(m_new_locale); diff --git a/tests/libslic3r/test_config.cpp b/tests/libslic3r/test_config.cpp index c3f17def2..417a29dca 100644 --- a/tests/libslic3r/test_config.cpp +++ b/tests/libslic3r/test_config.cpp @@ -1,6 +1,7 @@ #include #include "libslic3r/PrintConfig.hpp" +#include "libslic3r/LocalesUtils.hpp" using namespace Slic3r; @@ -112,7 +113,7 @@ SCENARIO("Config accessor functions perform as expected.", "[Config]") { WHEN("A string option is set through the double interface") { config.set("end_gcode", 100.5); THEN("The underlying value is set correctly.") { - REQUIRE(config.opt("end_gcode")->value == std::to_string(100.5)); + REQUIRE(config.opt("end_gcode")->value == float_to_string_decimal_point(100.5)); } } WHEN("A float or percent is set as a percent through the string interface.") {