summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdeline CARNIS <adeline.carnis@scilab-enterprises.com>2016-09-26 16:44:24 +0200
committerAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-04 15:23:55 +0200
commitde07a98f0ab0d4a9df431a0374fdf56c68634f91 (patch)
tree7105244b6993e048f0df45b8c854f30213c7e963
parentf16b16d5e345c7860d23b8b3d3404bb50006f6ea (diff)
downloadscilab-de07a98f0ab0d4a9df431a0374fdf56c68634f91.zip
scilab-de07a98f0ab0d4a9df431a0374fdf56c68634f91.tar.gz
* Bug #13878 fixed - tokens([]) returns [].
Change-Id: I749e712aa0e8ead374140c1533662e15a9e4910a
-rw-r--r--scilab/CHANGES.md2
-rw-r--r--scilab/modules/string/sci_gateway/cpp/sci_tokens.cpp6
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_13878.dia.ref17
-rw-r--r--scilab/modules/string/tests/nonreg_tests/bug_13878.tst19
4 files changed, 44 insertions, 0 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 5f59299..250a6f7 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -309,6 +309,7 @@ the [development mailing list](dev@lists.scilab.org) for a particular toolbox.
309Bug Fixes 309Bug Fixes
310--------- 310---------
311 311
312<<<<<<< HEAD
312### Bugs fixed in 6.0.0: 313### Bugs fixed in 6.0.0:
313* [#2919](http://bugzilla.scilab.org/show_bug.cgi?id=2919): The `fchamp` example and demo were unclear and badly rendered 314* [#2919](http://bugzilla.scilab.org/show_bug.cgi?id=2919): The `fchamp` example and demo were unclear and badly rendered
314* [#4327](http://bugzilla.scilab.org/show_bug.cgi?id=4327): Overloading did not support custom types names longer than 8 characters 315* [#4327](http://bugzilla.scilab.org/show_bug.cgi?id=4327): Overloading did not support custom types names longer than 8 characters
@@ -340,6 +341,7 @@ Bug Fixes
340* [#13597](http://bugzilla.scilab.org/show_bug.cgi?id=13597): `help format` claimed setting a number of digits instead of characters 341* [#13597](http://bugzilla.scilab.org/show_bug.cgi?id=13597): `help format` claimed setting a number of digits instead of characters
341* [#13613](http://bugzilla.scilab.org/show_bug.cgi?id=13613): `isdef(name, 'l')` produced wrong output. 342* [#13613](http://bugzilla.scilab.org/show_bug.cgi?id=13613): `isdef(name, 'l')` produced wrong output.
342* [#13757](http://bugzilla.scilab.org/show_bug.cgi?id=13757): The toolbox menu dit not load properly ATOMS modules not autoloaded. 343* [#13757](http://bugzilla.scilab.org/show_bug.cgi?id=13757): The toolbox menu dit not load properly ATOMS modules not autoloaded.
344* [#13878](http://bugzilla.scilab.org/show_bug.cgi?id=13878): tokens([]) returns [].
343* [#13895](http://bugzilla.scilab.org/show_bug.cgi?id=13895): p.a.h = 1; p.b.h = 3; p(:).h CRASH 345* [#13895](http://bugzilla.scilab.org/show_bug.cgi?id=13895): p.a.h = 1; p.b.h = 3; p(:).h CRASH
344* [#13990](http://bugzilla.scilab.org/show_bug.cgi?id=13990): `warning` with localization enabled some memory corruption 346* [#13990](http://bugzilla.scilab.org/show_bug.cgi?id=13990): `warning` with localization enabled some memory corruption
345* [#14192](http://bugzilla.scilab.org/show_bug.cgi?id=14192): `g_margin` error-ed for double integrator. 347* [#14192](http://bugzilla.scilab.org/show_bug.cgi?id=14192): `g_margin` error-ed for double integrator.
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_tokens.cpp b/scilab/modules/string/sci_gateway/cpp/sci_tokens.cpp
index 6f5fe0a..4523ca0 100644
--- a/scilab/modules/string/sci_gateway/cpp/sci_tokens.cpp
+++ b/scilab/modules/string/sci_gateway/cpp/sci_tokens.cpp
@@ -53,6 +53,12 @@ types::Function::ReturnValue sci_tokens(types::typed_list &in, int _iRetCount, t
53 } 53 }
54 54
55 // first arg 55 // first arg
56 if (in[0]->isDouble() && in[0]->getAs<types::Double>()->isEmpty())
57 {
58 out.push_back(types::Double::Empty());
59 return types::Function::OK;
60 }
61
56 if (in[0]->isString() == false) 62 if (in[0]->isString() == false)
57 { 63 {
58 Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), "tokens", 1); 64 Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), "tokens", 1);
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_13878.dia.ref b/scilab/modules/string/tests/nonreg_tests/bug_13878.dia.ref
new file mode 100644
index 0000000..570eb4b
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_13878.dia.ref
@@ -0,0 +1,17 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- CLI SHELL MODE -->
8// <-- Non-regression test for bug 13878 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=13878
12//
13// <-- Short Description -->
14// tokens([]) returns [].
15// =============================================================================
16assert_checkequal(tokens([]), []);
17assert_checkequal(tokens([], "a"), []);
diff --git a/scilab/modules/string/tests/nonreg_tests/bug_13878.tst b/scilab/modules/string/tests/nonreg_tests/bug_13878.tst
new file mode 100644
index 0000000..e06cc5e
--- /dev/null
+++ b/scilab/modules/string/tests/nonreg_tests/bug_13878.tst
@@ -0,0 +1,19 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- CLI SHELL MODE -->
9
10// <-- Non-regression test for bug 13878 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=13878
14//
15// <-- Short Description -->
16// tokens([]) returns [].
17// =============================================================================
18assert_checkequal(tokens([]), []);
19assert_checkequal(tokens([], "a"), []);