summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorClément David <clement.david@esi-group.com>2021-04-12 16:48:08 +0200
committerCedric Delamarre <cedric.delamarre@esi-group.com>2021-04-26 14:23:35 +0200
commit72e4c30a48aa2c4b2868b7ac5683210aa3c3359e (patch)
tree595ff688549f3e86ac83e0aff12c4a5cd4c30a69 /scilab/modules
parent35bb3727aa4d6a4dd3b04f942c7a7db3b30029ea (diff)
downloadscilab-72e4c30a48aa2c4b2868b7ac5683210aa3c3359e.zip
scilab-72e4c30a48aa2c4b2868b7ac5683210aa3c3359e.tar.gz
sparse: make tests pass
Change-Id: I6cea469b850c8f1e8bbb8ba4c236fe74b8cee457
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/sparse/sci_gateway/cpp/sci_spzeros.cpp2
-rw-r--r--scilab/modules/sparse/tests/nonreg_tests/bug_15647.tst2
-rw-r--r--scilab/modules/sparse/tests/nonreg_tests/bug_490.dia.ref19
-rw-r--r--scilab/modules/sparse/tests/nonreg_tests/bug_490.tst9
4 files changed, 7 insertions, 25 deletions
diff --git a/scilab/modules/sparse/sci_gateway/cpp/sci_spzeros.cpp b/scilab/modules/sparse/sci_gateway/cpp/sci_spzeros.cpp
index 3b914c4..e615934 100644
--- a/scilab/modules/sparse/sci_gateway/cpp/sci_spzeros.cpp
+++ b/scilab/modules/sparse/sci_gateway/cpp/sci_spzeros.cpp
@@ -92,7 +92,7 @@ types::Function::ReturnValue sci_spzeros(types::typed_list &in, int _iRetCount,
92 } 92 }
93 if (dblCols != (double) ((unsigned int) dblCols)) 93 if (dblCols != (double) ((unsigned int) dblCols))
94 { 94 {
95 Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "spzeros", 1); 95 Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "spzeros", 2);
96 return types::Function::Error; 96 return types::Function::Error;
97 } 97 }
98 98
diff --git a/scilab/modules/sparse/tests/nonreg_tests/bug_15647.tst b/scilab/modules/sparse/tests/nonreg_tests/bug_15647.tst
index d5ac3f3..e49f975 100644
--- a/scilab/modules/sparse/tests/nonreg_tests/bug_15647.tst
+++ b/scilab/modules/sparse/tests/nonreg_tests/bug_15647.tst
@@ -16,6 +16,6 @@
16// <-- Short Description --> 16// <-- Short Description -->
17// spzeros(-1,-1) yields a corrupted result 17// spzeros(-1,-1) yields a corrupted result
18 18
19errMsg = _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n") 19errMsg = _("%s: Wrong value for input argument #%d: Scalar positive integer expected.")
20assert_checkerror("spzeros(-1,-1)", msprintf(errMsg, "spzeros", 1)); 20assert_checkerror("spzeros(-1,-1)", msprintf(errMsg, "spzeros", 1));
21assert_checkerror("spzeros(1,-1)", msprintf(errMsg, "spzeros", 2)); 21assert_checkerror("spzeros(1,-1)", msprintf(errMsg, "spzeros", 2));
diff --git a/scilab/modules/sparse/tests/nonreg_tests/bug_490.dia.ref b/scilab/modules/sparse/tests/nonreg_tests/bug_490.dia.ref
deleted file mode 100644
index e83ea7f..0000000
--- a/scilab/modules/sparse/tests/nonreg_tests/bug_490.dia.ref
+++ /dev/null
@@ -1,19 +0,0 @@
1// ============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
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 490 -->
9// Please note that it is store under the request feature of Scilab
10//
11// <-- Bugzilla URL -->
12// http://requestzilla.scilab.org/show_bug.cgi?id=490
13//
14// <-- Short Description -->
15// Wrong size detection in sparse matrix
16toto = spzeros(2^16, 2^16);
17toto(1, 8) =toto(1, 8)+5;
18toto(1, 8) =toto(1, 8)+5;
19if toto(1, 8) == []; then bugmes();quit;end
diff --git a/scilab/modules/sparse/tests/nonreg_tests/bug_490.tst b/scilab/modules/sparse/tests/nonreg_tests/bug_490.tst
index c7e1ceb..995acc5 100644
--- a/scilab/modules/sparse/tests/nonreg_tests/bug_490.tst
+++ b/scilab/modules/sparse/tests/nonreg_tests/bug_490.tst
@@ -6,10 +6,11 @@
6// ============================================================================ 6// ============================================================================
7 7
8// <-- CLI SHELL MODE --> 8// <-- CLI SHELL MODE -->
9// <-- NO CHECK REF -->
9 10
10// <-- Non-regression test for bug 490 --> 11// <-- Non-regression test for bug 490 -->
11// Please note that it is store under the request feature of Scilab 12// Please note that it is store under the request feature of Scilab
12// 13//
13// <-- Bugzilla URL --> 14// <-- Bugzilla URL -->
14// http://requestzilla.scilab.org/show_bug.cgi?id=490 15// http://requestzilla.scilab.org/show_bug.cgi?id=490
15// 16//
@@ -17,7 +18,7 @@
17// Wrong size detection in sparse matrix 18// Wrong size detection in sparse matrix
18 19
19toto = spzeros(2^16, 2^16); 20toto = spzeros(2^16, 2^16);
20toto(1, 8) =toto(1, 8)+5; 21toto(1, 8) = toto(1, 8)+5;
21toto(1, 8) =toto(1, 8)+5; 22toto(1, 8) = toto(1, 8)+5;
22if toto(1, 8) == []; then pause, end 23assert_checkequal(toto(1, 8), sparse([1,1], 10));
23 24