changeset 50208:a20f2b3c321f

8202848: -XX:+ExecuteInternalVMTests asserts with "assert(cd.valid() == true) failed: failed on a valid DirectivesParser string" Summary: Use "C" locale for correct parsing of decimals in VM internal compiler directive tests. Reviewed-by: dholmes, coleenp, stuefe, dcubed
author thartmann
date Tue, 22 May 2018 09:10:16 +0200
parents 24b5f2e635f6
children 2fdce199fcb9
files src/hotspot/share/utilities/internalVMTests.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/utilities/internalVMTests.cpp	Tue May 22 09:04:15 2018 +0200
+++ b/src/hotspot/share/utilities/internalVMTests.cpp	Tue May 22 09:10:16 2018 +0200
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 
 #ifndef PRODUCT
+#include <locale.h>
 
 #include "utilities/internalVMTests.hpp"
 #include "utilities/macros.hpp"
@@ -47,7 +48,11 @@
   run_unit_test(TestMetaspaceUtils_test);
   run_unit_test(GCTimer_test);
   run_unit_test(ObjectMonitor_test);
+  // These tests require the "C" locale to correctly parse decimal values
+  const char* orig_locale = setlocale(LC_NUMERIC, NULL);
+  setlocale(LC_NUMERIC, "C");
   run_unit_test(DirectivesParser_test);
+  setlocale(LC_NUMERIC, orig_locale);
   tty->print_cr("All internal VM tests passed");
 }