summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel GOUGEON <sgougeon@free.fr>2020-03-03 00:51:12 +0100
committerAdeline CARNIS <adeline.carnis@scilab-enterprises.com>2020-03-16 17:35:38 +0100
commitf82fcc6cdd15b1e9bd6df6f4c6573020381e1636 (patch)
tree2e6b03cd259eab9ae692c6a0f3011a065b118bae
parenta169d8dbc892823d2c3e1fc854bf481b53b53569 (diff)
downloadscilab-f82fcc6cdd15b1e9bd6df6f4c6573020381e1636.zip
scilab-f82fcc6cdd15b1e9bd6df6f4c6573020381e1636.tar.gz
14 missing NR test files added
http://bugzilla.scilab.org/2463 http://bugzilla.scilab.org/9349 http://bugzilla.scilab.org/4171 http://bugzilla.scilab.org/8301 http://bugzilla.scilab.org/8393 http://bugzilla.scilab.org/12341 http://bugzilla.scilab.org/14916 http://bugzilla.scilab.org/15158 http://bugzilla.scilab.org/14191 http://bugzilla.scilab.org/15421 http://bugzilla.scilab.org/7083 http://bugzilla.scilab.org/13537 http://bugzilla.scilab.org/8930 http://bugzilla.scilab.org/15607 test_run ast bug_2463 test_run ast bug_9349 test_run data_structures bug_4171 test_run data_structures bug_8301 test_run data_structures bug_8393 test_run fileio bug_12341 test_run fileio bug_14916 test_run functions bug_15158 test_run graphics bug_14191 test_run graphics bug_15421 test_run graphics bug_7083 test_run sound bug_13537 test_run sparse bug_8930 test_run tclsci bug_15607 Change-Id: If2def5d6731d228e1f315a408e12e13930f34ec8
-rw-r--r--scilab/modules/ast/tests/nonreg_tests/bug_2463.tst26
-rw-r--r--scilab/modules/ast/tests/nonreg_tests/bug_9349.tst39
-rw-r--r--scilab/modules/data_structures/tests/nonreg_tests/bug_4171.dia.ref63
-rw-r--r--scilab/modules/data_structures/tests/nonreg_tests/bug_4171.tst38
-rw-r--r--scilab/modules/data_structures/tests/nonreg_tests/bug_8301.tst23
-rw-r--r--scilab/modules/data_structures/tests/nonreg_tests/bug_8393.tst27
-rw-r--r--scilab/modules/fileio/tests/nonreg_tests/bug_12341.tst25
-rw-r--r--scilab/modules/fileio/tests/nonreg_tests/bug_14916.tst24
-rw-r--r--scilab/modules/functions/tests/nonreg_tests/bug_15158.tst23
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_14191.tst37
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_15421.tst22
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_7083.tst30
-rw-r--r--scilab/modules/sound/tests/nonreg_tests/bug_13537.tst23
-rw-r--r--scilab/modules/sparse/tests/nonreg_tests/bug_8930.tst30
-rw-r--r--scilab/modules/tclsci/tests/nonreg_tests/bug_15607.tst39
15 files changed, 469 insertions, 0 deletions
diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_2463.tst b/scilab/modules/ast/tests/nonreg_tests/bug_2463.tst
new file mode 100644
index 0000000..02f0c81
--- /dev/null
+++ b/scilab/modules/ast/tests/nonreg_tests/bug_2463.tst
@@ -0,0 +1,26 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - 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// <-- ENGLISH IMPOSED -->
11//
12// <-- Non-regression test for bug 2463 -->
13//
14// <-- Bugzilla URL -->
15// http://bugzilla.scilab.org/2463
16//
17// <-- Short Description -->
18// Named arguments were accepted in built-in functions
19
20a = 2;
21msg = "type: Wrong number of input arguments: 1 expected.";
22assert_checkerror("type(a=%t)", msg);
23
24a = 2;
25msg = "sin: Wrong number of input argument(s): 1 expected.";
26assert_checkerror("sin(a=0)", msg);
diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_9349.tst b/scilab/modules/ast/tests/nonreg_tests/bug_9349.tst
new file mode 100644
index 0000000..e6eb9f2
--- /dev/null
+++ b/scilab/modules/ast/tests/nonreg_tests/bug_9349.tst
@@ -0,0 +1,39 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - 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 9349 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/9349
15//
16// <-- Short Description -->
17// Empty parentheses after a field in a macro led to a recurence problem
18
19// No compilation error should occur:
20clear a
21function foo(), y = a.b(), endfunction
22clear foo
23function y=foo()
24 a = mlist(['V' 'b'], mlist(['V']))
25 y = a.b()
26endfunction
27
28obj = mlist(['A']);
29deff('y=foo()', 'y=123');
30deff('y=%A_e(b,a)', 'y=foo');
31obj.toto()
32
33function test()
34 obj = mlist(['A']);
35 deff('y=foo()','y=123');
36 deff('y=%A_e(b,a)', 'y=foo');
37 obj.toto()
38endfunction
39test()
diff --git a/scilab/modules/data_structures/tests/nonreg_tests/bug_4171.dia.ref b/scilab/modules/data_structures/tests/nonreg_tests/bug_4171.dia.ref
new file mode 100644
index 0000000..81994e9
--- /dev/null
+++ b/scilab/modules/data_structures/tests/nonreg_tests/bug_4171.dia.ref
@@ -0,0 +1,63 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
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 4171 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/4171
12//
13// <-- Short Description -->
14// A list including some structures was wrongly displayed
15// Bug 4171
16// --------
17stru.field = "value";
18// Add this struct in a tlist
19tl1 = tlist("X", stru);
20tl2 = tlist("X", tl1, tl1)
21 tl2 =
22 tl2(1)
23 "X"
24 tl2(2)
25 tl2(2)(1)
26 "X"
27 tl2(2)(2)
28 field = "value"
29 tl2(3)
30 tl2(3)(1)
31 "X"
32 tl2(3)(2)
33 field = "value"
34// Same beahviour with a list
35l1 = list(stru);
36l2 = list(l1, l1)
37 l2 =
38 l2(1)
39 l2(1)(1)
40 field = "value"
41 l2(2)
42 l2(2)(1)
43 field = "value"
44// Bug 11484 (duplicate)
45// ---------
46x = struct('a',4,'b',3);
47y = struct('a',5,'b',6);
48z = struct('a',7,'b',2);
49list_c = list();
50list_c(0) = list(x,y);
51list_c(0) = list(z)
52 list_c =
53 list_c(1)
54 list_c(1)(1)
55 a = 7
56 b = 2
57 list_c(2)
58 list_c(2)(1)
59 a = 4
60 b = 3
61 list_c(2)(2)
62 a = 5
63 b = 6
diff --git a/scilab/modules/data_structures/tests/nonreg_tests/bug_4171.tst b/scilab/modules/data_structures/tests/nonreg_tests/bug_4171.tst
new file mode 100644
index 0000000..ac83faa
--- /dev/null
+++ b/scilab/modules/data_structures/tests/nonreg_tests/bug_4171.tst
@@ -0,0 +1,38 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
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 4171 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/4171
14//
15// <-- Short Description -->
16// A list including some structures was wrongly displayed
17
18// Bug 4171
19// --------
20stru.field = "value";
21
22// Add this struct in a tlist
23tl1 = tlist("X", stru);
24tl2 = tlist("X", tl1, tl1)
25
26// Same beahviour with a list
27l1 = list(stru);
28l2 = list(l1, l1)
29
30// Bug 11484 (duplicate)
31// ---------
32x = struct('a',4,'b',3);
33y = struct('a',5,'b',6);
34z = struct('a',7,'b',2);
35
36list_c = list();
37list_c(0) = list(x,y);
38list_c(0) = list(z)
diff --git a/scilab/modules/data_structures/tests/nonreg_tests/bug_8301.tst b/scilab/modules/data_structures/tests/nonreg_tests/bug_8301.tst
new file mode 100644
index 0000000..e9da31c
--- /dev/null
+++ b/scilab/modules/data_structures/tests/nonreg_tests/bug_8301.tst
@@ -0,0 +1,23 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- CLI SHELL MODE -->
8// <-- NO CHECK REF -->
9//
10// <-- Non-regression test for bug 8301 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/8301
14
15//
16// <-- Short Description -->
17// definedfields() reported void fields in mlist or tlist, as defined
18
19T = tlist(["test" "txt" "real" "bool"],"Hi",,%T);
20assert_checkequal(definedfields(T), [1 2 4]);
21
22M = mlist(["test" "txt" "real" "bool"],"Hi",,%T);
23assert_checkequal(definedfields(M), [1 2 4]);
diff --git a/scilab/modules/data_structures/tests/nonreg_tests/bug_8393.tst b/scilab/modules/data_structures/tests/nonreg_tests/bug_8393.tst
new file mode 100644
index 0000000..48e8bf7
--- /dev/null
+++ b/scilab/modules/data_structures/tests/nonreg_tests/bug_8393.tst
@@ -0,0 +1,27 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- CLI SHELL MODE -->
8// <-- NO CHECK REF -->
9//
10// <-- Non-regression test for bug 8393 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/8393
14//
15// <-- Short Description -->
16// definedfields() reported void fields as existing
17
18L = list(%pi,,%z,);
19assert_checkequal(definedfields(L), [1 3])
20v = L(2);
21assert_checkfalse(isdef("v","local"));
22v = L(4);
23assert_checkfalse(isdef("v","local"));
24clear L
25L = list();
26L(10) = 4;
27assert_checkequal(definedfields(L), 10);
diff --git a/scilab/modules/fileio/tests/nonreg_tests/bug_12341.tst b/scilab/modules/fileio/tests/nonreg_tests/bug_12341.tst
new file mode 100644
index 0000000..29e0700
--- /dev/null
+++ b/scilab/modules/fileio/tests/nonreg_tests/bug_12341.tst
@@ -0,0 +1,25 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - 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 12341 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/12341
15//
16// <-- Short Description -->
17// rmdir() could delete a branch in which pwd() is
18
19mkdir(TMPDIR+"/foo");
20mkdir(TMPDIR+"/foo/bar");
21cd(TMPDIR+"/foo/bar");
22s = rmdir(TMPDIR+"/foo");
23assert_checkequal(s, 0);
24s = rmdir(TMPDIR+"/foo/bar");
25assert_checkequal(s, 0);
diff --git a/scilab/modules/fileio/tests/nonreg_tests/bug_14916.tst b/scilab/modules/fileio/tests/nonreg_tests/bug_14916.tst
new file mode 100644
index 0000000..48281cc
--- /dev/null
+++ b/scilab/modules/fileio/tests/nonreg_tests/bug_14916.tst
@@ -0,0 +1,24 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- INTERACTIVE TEST -->
9//
10// <-- Non-regression test for bug 14916 -->
11//
12// <-- Bugzilla URL -->
13// https://bugzilla.scilab.org/14916
14//
15// <-- Short Description -->
16// read(%io(1), 1, 1, '(a)') + keyboard input + enter crashed Scilab
17
18read(%io(1), 1, 1, '(a)')
19
20// Enter some input in the console, and validate by pressing <enter>
21// TEST:
22// - Scilab should not have crashed
23// - Your input should be displayed in ans
24
diff --git a/scilab/modules/functions/tests/nonreg_tests/bug_15158.tst b/scilab/modules/functions/tests/nonreg_tests/bug_15158.tst
new file mode 100644
index 0000000..2264e36
--- /dev/null
+++ b/scilab/modules/functions/tests/nonreg_tests/bug_15158.tst
@@ -0,0 +1,23 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - 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 15158 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/15158
15//
16// <-- Short Description -->
17// ver()(1,2) in a macro made macr2tree() crashing on it.
18
19function test()
20 SCI_VER = ver()(1,2)
21endfunction
22
23assert_checkequal(execstr("macr2tree(test)", "errcatch"), 0);
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_14191.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_14191.tst
new file mode 100644
index 0000000..a180724
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_14191.tst
@@ -0,0 +1,37 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- TEST WITH GRAPHIC -->
9// <-- NO CHECK REF -->
10//
11// <-- Non-regression test for bug 14191 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/14191
15//
16// <-- Short Description -->
17// plot(logflag,..) new option
18
19clf
20plot([1 10],[1,10]);
21assert_checkequal(gca().log_flags, "nnn");
22
23clf
24plot("nn",[1 10],[1,10]);
25assert_checkequal(gca().log_flags, "nnn");
26
27clf
28plot("ln",[1 10],[1,10]);
29assert_checkequal(gca().log_flags, "lnn");
30
31clf
32plot("ll",[1 10],[1,10]);
33assert_checkequal(gca().log_flags, "lln");
34
35clf
36plot("nl",[1 10],[1,10]);
37assert_checkequal(gca().log_flags, "nln");
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_15421.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_15421.tst
new file mode 100644
index 0000000..1272141
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_15421.tst
@@ -0,0 +1,22 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- TEST WITH GRAPHIC -->
9// <-- NO CHECK REF -->
10//
11// <-- Non-regression test for bug 15421 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/15421
15//
16// <-- Short Description -->
17// The default grid_style value is now 7
18
19assert_checkequal(gda().grid_style, [7 7]);
20clf reset
21param3d([0 1],[0 1],[0 1]);
22assert_checkequal(gca().grid_style, [7 7 7]);
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_7083.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_7083.tst
new file mode 100644
index 0000000..530d110
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_7083.tst
@@ -0,0 +1,30 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- Non-regression test for bug 7083 -->
9//
10// <-- TEST WITH GRAPHIC -->
11// <-- NO CHECK REF -->
12// <-- ENGLISH IMPOSED -->
13//
14// <-- Bugzilla URL -->
15// http://bugzilla.scilab.org/7083
16//
17// <-- Short Description -->
18// Setting uicontrol.backgroundcolor=[10 10 10] with RGB values > 1
19// yielded a critical error and a stack problem.
20
21
22h = gcf();
23h_tb = uicontrol(h,'style','text', 'position', [10 10 20 200]);
24set(h_tb,'backgroundcolor',[1 1 1]);
25
26msg = "Wrong value for ''BackgroundColor'' property: Numbers between 0 and 1 expected.";
27assert_checkerror("set(h_tb,''backgroundcolor'',[10 10 10]);", msg);
28assert_checkequal(h_tb.backgroundcolor, [1 1 1]);
29assert_checkerror("h_tb; h_tb.backgroundcolor=[10 10 10];", msg);
30assert_checkequal(h_tb.backgroundcolor, [1 1 1]);
diff --git a/scilab/modules/sound/tests/nonreg_tests/bug_13537.tst b/scilab/modules/sound/tests/nonreg_tests/bug_13537.tst
new file mode 100644
index 0000000..cfdfaf8
--- /dev/null
+++ b/scilab/modules/sound/tests/nonreg_tests/bug_13537.tst
@@ -0,0 +1,23 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - 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 13537 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/13537
15//
16// <-- Short Description -->
17// wavwrite(..) yielded EXCEPTION_ACCESS_VIOLATION error
18//
19s = ones([1:12345678])/2;
20filename = TMPDIR+"/test.wav";
21assert_checkequal(execstr("wavwrite(s, 44100, 16, filename);","errcatch"), 0);
22sleep(100)
23mdelete(filename);
diff --git a/scilab/modules/sparse/tests/nonreg_tests/bug_8930.tst b/scilab/modules/sparse/tests/nonreg_tests/bug_8930.tst
new file mode 100644
index 0000000..441239f
--- /dev/null
+++ b/scilab/modules/sparse/tests/nonreg_tests/bug_8930.tst
@@ -0,0 +1,30 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - 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 8930 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/8930
15//
16// <-- Short Description -->
17// Some assignments in boolean sparse matrices failed
18
19
20A = sparse(%t);
21A(:) = %t;
22assert_checktrue(A);
23A = sparse(%t);
24A(:) = %f;
25assert_checkfalse(A);
26A = sparse([%t %f]);
27A(:) = %t;
28assert_checkequal(A, sparse([%T %T]));
29A(:) = %f;
30assert_checkequal(A, sparse([%F %F]));
diff --git a/scilab/modules/tclsci/tests/nonreg_tests/bug_15607.tst b/scilab/modules/tclsci/tests/nonreg_tests/bug_15607.tst
new file mode 100644
index 0000000..8db8b23
--- /dev/null
+++ b/scilab/modules/tclsci/tests/nonreg_tests/bug_15607.tst
@@ -0,0 +1,39 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - Samuel GOUGEON
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- NO CHECK REF -->
8//
9// <-- Non-regression test for bug 15607 -->
10//
11// <-- Bugzilla URL -->
12// http://bugzilla.scilab.org/15607
13//
14// <-- Short Description -->
15//
16// 1) TCL_GetVar no longer worked for arrays
17// 2) Running TCL_CreateSlave() froze Scilab
18// 3) In a function, TCL_EvalStr("ScilabEval h=5") created h at the top level.
19
20// 1)
21a = ["A","B","C" ; "D","E","F"];
22TCL_SetVar("A", a);
23assert_checkequal(TCL_GetVar("A"), a);
24
25// 2) Just run the following instructions.
26// If they freezes Scilab, the whole test will fail.
27TCL_CreateSlave('TCLSlave');
28b = [66,44,11 ; 22,33,55];
29TCL_SetVar("B_slave", b, 'TCLSlave');
30TCL_GetVar('B_slave','TCLSlave');
31TCL_DeleteInterp('TCLSlave');
32
33// 3)
34clear h
35function xyz()
36 TCL_EvalStr("ScilabEval h=5")
37endfunction
38xyz();
39assert_checkfalse(isdef("h","l"));