summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel GOUGEON <sgougeon@free.fr>2019-07-18 18:16:42 +0200
committerClement DAVID <clement.david@esi-group.com>2019-07-19 15:06:02 +0200
commite46b3d4caa2a2ca9c06ed5046fabf3ee09779308 (patch)
tree9ac7b19cf02590b212cb47e56c75740ce461a8d3
parentc69421ba366f75283aab3dfd4eccf70b985a89a1 (diff)
downloadscilab-e46b3d4caa2a2ca9c06ed5046fabf3ee09779308.zip
scilab-e46b3d4caa2a2ca9c06ed5046fabf3ee09779308.tar.gz
* Bug 14498 fixed: size([],3) returned 1 instead of 0
http://bugzilla.scilab.org/14498 Change-Id: I2cfce9306d1a268a1374ec34f851c0fa71c21103
-rw-r--r--scilab/CHANGES.md1
-rw-r--r--scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp2
-rw-r--r--scilab/modules/elementary_functions/tests/nonreg_tests/bug_14498.tst19
3 files changed, 21 insertions, 1 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 0c823bb..fec4198 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -142,6 +142,7 @@ Bug Fixes
142* [#2694](http://bugzilla.scilab.org/show_bug.cgi?id=2694): `bitget` did not accept positive integers of types int8, int16 or int32. 142* [#2694](http://bugzilla.scilab.org/show_bug.cgi?id=2694): `bitget` did not accept positive integers of types int8, int16 or int32.
143* [#8784](http://bugzilla.scilab.org/show_bug.cgi?id=8784): Automatic self-adjusting blocks `SCALE_CSCOPE` & `SCALE_CMSCOPE` in Xcos. 143* [#8784](http://bugzilla.scilab.org/show_bug.cgi?id=8784): Automatic self-adjusting blocks `SCALE_CSCOPE` & `SCALE_CMSCOPE` in Xcos.
144* [#9673](http://bugzilla.scilab.org/show_bug.cgi?id=9673): Priority of colon `:` operator was too low 144* [#9673](http://bugzilla.scilab.org/show_bug.cgi?id=9673): Priority of colon `:` operator was too low
145* [#14498](http://bugzilla.scilab.org/show_bug.cgi?id=14498): `size([],3)` returned 1 instead of 0.
145* [#14604](http://bugzilla.scilab.org/show_bug.cgi?id=14604): `emptystr()` is 40x slower with 6.0.0 wrt 5.5.2 146* [#14604](http://bugzilla.scilab.org/show_bug.cgi?id=14604): `emptystr()` is 40x slower with 6.0.0 wrt 5.5.2
146* [#14605](http://bugzilla.scilab.org/show_bug.cgi?id=14605): fixed - `bench_run` was too strict about the specification of tests names. 147* [#14605](http://bugzilla.scilab.org/show_bug.cgi?id=14605): fixed - `bench_run` was too strict about the specification of tests names.
147* [#14606](http://bugzilla.scilab.org/show_bug.cgi?id=14606): Memory used by variables returned by `[names,mem]=who()` was always zero. 148* [#14606](http://bugzilla.scilab.org/show_bug.cgi?id=14606): Memory used by variables returned by `[names,mem]=who()` was always zero.
diff --git a/scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp b/scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp
index a220dd4..4588278 100644
--- a/scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp
+++ b/scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp
@@ -140,7 +140,7 @@ types::Function::ReturnValue sci_size(types::typed_list &in, int _iRetCount, typ
140 default : //"r" 140 default : //"r"
141 if (iMode > iDims) 141 if (iMode > iDims)
142 { 142 {
143 pdbl[0] = 1; 143 pdbl[0] = (piDims[0]==0)? 0 : 1;
144 out.push_back(pD); 144 out.push_back(pD);
145 return types::Function::OK; 145 return types::Function::OK;
146 } 146 }
diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_14498.tst b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_14498.tst
new file mode 100644
index 0000000..f259f25
--- /dev/null
+++ b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_14498.tst
@@ -0,0 +1,19 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2019 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- CLI SHELL MODE -->
9// <-- NO CHECK REF -->
10//
11// <-- Non-regression test for bug 14498 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/14498
15//
16// <-- Short Description -->
17// size([],3) returned 1 instead of 0
18
19assert_checkequal(size([],3), 0)