summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Marchetto <simon.marchetto@scilab-enterprises.com>2016-06-02 16:23:07 +0200
committerSimon Marchetto <simon.marchetto@scilab-enterprises.com>2016-06-02 16:23:07 +0200
commit4fd166dfd977d1870dd3c91e8cc535813517b928 (patch)
tree1d0011deba019f33d9d52a950d54694c66c89852
parentc508b08be8dbb35c6ee03df325fe89479a0b07de (diff)
downloadscilab-5.5.zip
scilab-5.5.tar.gz
* Bug #14524 fixed - Numeric locales were not set to standard "C" by default at scilab startup5.5
Change-Id: I8a24b6745c89a15b1d0289d28145c5cb168dfccb
-rw-r--r--scilab/CHANGES_5.5.X2
-rw-r--r--scilab/modules/core/src/c/InitScilab.c4
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_14524.dia.ref23
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_14524.tst21
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_14568.dia.ref22
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_14568.tst21
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_14568_test.tst12
7 files changed, 105 insertions, 0 deletions
diff --git a/scilab/CHANGES_5.5.X b/scilab/CHANGES_5.5.X
index 750c76a..5dea934 100644
--- a/scilab/CHANGES_5.5.X
+++ b/scilab/CHANGES_5.5.X
@@ -28,6 +28,8 @@ Scilab Bug Fixes
28 28
29* Bug #13925 fixed - SciNotes used the wrong paired bracket highlight style. 29* Bug #13925 fixed - SciNotes used the wrong paired bracket highlight style.
30 30
31* Bug #14524 fixed - Numeric locales were not set to standard "C" by default at scilab startup
32
31 33
32 34
33 Changes between version 5.5.1 and 5.5.2 35 Changes between version 5.5.1 and 5.5.2
diff --git a/scilab/modules/core/src/c/InitScilab.c b/scilab/modules/core/src/c/InitScilab.c
index bc307ec..3c1a3e8 100644
--- a/scilab/modules/core/src/c/InitScilab.c
+++ b/scilab/modules/core/src/c/InitScilab.c
@@ -11,6 +11,7 @@
11 */ 11 */
12#include "InitScilab.h" 12#include "InitScilab.h"
13#include "InitializeCore.h" 13#include "InitializeCore.h"
14#include "locale.h"
14#include "../../../console/includes/InitializeConsole.h" 15#include "../../../console/includes/InitializeConsole.h"
15#include "../../../tclsci/includes/InitializeTclTk.h" 16#include "../../../tclsci/includes/InitializeTclTk.h"
16#include "../../../localization/includes/InitializeLocalization.h" 17#include "../../../localization/includes/InitializeLocalization.h"
@@ -49,6 +50,9 @@ int C2F(initscilab) (void)
49 loadGraphicModule(); 50 loadGraphicModule();
50 } 51 }
51 52
53 // set default (English) locale after JVM which may set its own locale
54 setlocale(LC_NUMERIC, "C");
55
52 /* Initialize console: lines... */ 56 /* Initialize console: lines... */
53 InitializeConsole(); 57 InitializeConsole();
54 58
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_14524.dia.ref b/scilab/modules/string/tests/nonreg_tests/bug_14524.dia.ref
new file mode 100644
index 0000000..01e357a
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_14524.dia.ref
@@ -0,0 +1,23 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises -
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 14524 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/14524
11//
12// <-- Short Description -->
13// Numeric locales were not set to standard "C" by default at scilab startup
14format('e',10)
15disp(1/2)
16 5.000D-01
17disp(0.5)
18 5.000D-01
19format('v',10)
20disp(1/2)
21 0.5
22disp(0.5)
23 0.5
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_14524.tst b/scilab/modules/string/tests/nonreg_tests/bug_14524.tst
new file mode 100644
index 0000000..845314e
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_14524.tst
@@ -0,0 +1,21 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises -
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 14524 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/14524
11//
12// <-- Short Description -->
13// Numeric locales were not set to standard "C" by default at scilab startup
14
15format('e',10)
16disp(1/2)
17disp(0.5)
18
19format('v',10)
20disp(1/2)
21disp(0.5)
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_14568.dia.ref b/scilab/modules/string/tests/nonreg_tests/bug_14568.dia.ref
new file mode 100644
index 0000000..9fb5c93
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_14568.dia.ref
@@ -0,0 +1,22 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises -
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 14568 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/14568
11//
12// <-- Short Description -->
13// strtod() fails in some locale conditions
14// No way to set locale for the current test => run another test with a modified locale
15setenv("LC_ALL", "fr_FR.UTF-8");
16status = test_run("string", "bug_14568_test", ["no_check_error_output", "no_check_ref", "short_summary"]);
17 001/001 - [string] bug_14568_test............................passed
18
19 --------------------------------------------------------------------------
20 Tests: 1, Passed: 1, Failed: 0, Skipped: 0
21 --------------------------------------------------------------------------
22assert_checktrue(status);
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_14568.tst b/scilab/modules/string/tests/nonreg_tests/bug_14568.tst
new file mode 100644
index 0000000..289574e
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_14568.tst
@@ -0,0 +1,21 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises -
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 14568 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/14568
11//
12// <-- Short Description -->
13// strtod() fails in some locale conditions
14
15// No way to set locale for the current test => run another test with a modified locale
16
17setenv("LC_ALL", "fr_FR.UTF-8");
18
19status = test_run("string", "bug_14568_test", ["no_check_error_output", "no_check_ref", "short_summary"]);
20
21assert_checktrue(status); \ No newline at end of file
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_14568_test.tst b/scilab/modules/string/tests/nonreg_tests/bug_14568_test.tst
new file mode 100644
index 0000000..82937c8
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_14568_test.tst
@@ -0,0 +1,12 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises -
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8
9// This test is run by 14568 test, with test_run() command with a modified locale
10
11assert_checkequal(strtod("0.5"), 0.5);
12