You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/08/05 16:10:42 UTC
[arrow] branch master updated: ARROW-6108: [C++] Workaround Windows
CRT crash on invalid locale
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 134e9cf ARROW-6108: [C++] Workaround Windows CRT crash on invalid locale
134e9cf is described below
commit 134e9cf3dc4b55dfd183b22b6f5176a95ba9e7c5
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Mon Aug 5 11:10:28 2019 -0500
ARROW-6108: [C++] Workaround Windows CRT crash on invalid locale
Closes #5010 from pitrou/ARROW-6108-xxx and squashes the following commits:
ff497d9e6 <Antoine Pitrou> ARROW-6108: Workaround Windows CRT crash on invalid locale
Authored-by: Antoine Pitrou <an...@python.org>
Signed-off-by: Wes McKinney <we...@apache.org>
---
cpp/src/arrow/compute/kernels/cast-test.cc | 5 +++++
cpp/src/arrow/util/parsing-util-test.cc | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/cpp/src/arrow/compute/kernels/cast-test.cc b/cpp/src/arrow/compute/kernels/cast-test.cc
index 61f1500..523b0b8 100644
--- a/cpp/src/arrow/compute/kernels/cast-test.cc
+++ b/cpp/src/arrow/compute/kernels/cast-test.cc
@@ -224,7 +224,11 @@ class TestCast : public ComputeFixture, public TestBase {
CheckCase<SourceType, std::string, DoubleType, double>(src_type, v_float, is_valid,
float64(), e_double, options);
+#ifndef _WIN32
// Test that casting is locale-independent
+ // ARROW-6108: can't run this test on Windows. std::locale() will simply throw
+ // on release builds, but may crash with an assertion failure on debug builds.
+ // (similar issue here: https://gerrit.libreoffice.org/#/c/54110/)
auto global_locale = std::locale();
try {
// French locale uses the comma as decimal point
@@ -237,6 +241,7 @@ class TestCast : public ComputeFixture, public TestBase {
CheckCase<SourceType, std::string, DoubleType, double>(src_type, v_float, is_valid,
float64(), e_double, options);
std::locale::global(global_locale);
+#endif
}
template <typename SourceType>
diff --git a/cpp/src/arrow/util/parsing-util-test.cc b/cpp/src/arrow/util/parsing-util-test.cc
index ff0621a..5e2ed56 100644
--- a/cpp/src/arrow/util/parsing-util-test.cc
+++ b/cpp/src/arrow/util/parsing-util-test.cc
@@ -98,6 +98,12 @@ TEST(StringConversion, ToDouble) {
AssertConversionFails(converter, "e");
}
+#ifndef _WIN32
+// Test that casting is locale-independent
+// ARROW-6108: can't run these tests on Windows. std::locale() will simply throw
+// on release builds, but may crash with an assertion failure on debug builds.
+// (similar issue here: https://gerrit.libreoffice.org/#/c/54110/)
+
TEST(StringConversion, ToFloatLocale) {
// French locale uses the comma as decimal point
LocaleGuard locale_guard("fr_FR.UTF-8");
@@ -114,6 +120,8 @@ TEST(StringConversion, ToDoubleLocale) {
AssertConversion(converter, "1.5", 1.5f);
}
+#endif // _WIN32
+
TEST(StringConversion, ToInt8) {
StringConverter<Int8Type> converter;