summaryrefslogtreecommitdiffstats
path: root/scilab/modules/spreadsheet
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-03-08 13:58:42 +0100
committerAllan CORNET <allan.cornet@scilab.org>2010-03-08 13:58:42 +0100
commit22b1531376e7948f7813116ecda72414a22d5bc6 (patch)
treec066de22587efe5fb802921d44291f1be4da1a99 /scilab/modules/spreadsheet
parent000dabd9ee403ed724a451eb13b1a8224d4a828e (diff)
parentfe49b3e745996112f8c0e0c5d130d8dc05204f18 (diff)
downloadscilab-22b1531376e7948f7813116ecda72414a22d5bc6.zip
scilab-22b1531376e7948f7813116ecda72414a22d5bc6.tar.gz
Merge remote branch 'refs/remotes/origin/5.2'
Diffstat (limited to 'scilab/modules/spreadsheet')
-rw-r--r--scilab/modules/spreadsheet/macros/read_csv.sci6
-rw-r--r--scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.dia.ref18
-rw-r--r--scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.tst21
3 files changed, 42 insertions, 3 deletions
diff --git a/scilab/modules/spreadsheet/macros/read_csv.sci b/scilab/modules/spreadsheet/macros/read_csv.sci
index 91f2611..bacdab9 100644
--- a/scilab/modules/spreadsheet/macros/read_csv.sci
+++ b/scilab/modules/spreadsheet/macros/read_csv.sci
@@ -14,11 +14,11 @@ function mat = read_csv(fname,sep)
14// read_csv(fname) returns the corresponding Scilab matrix of strings. 14// read_csv(fname) returns the corresponding Scilab matrix of strings.
15 15
16 if (type(fname) <> 10) then 16 if (type(fname) <> 10) then
17 error(msprintf(gettext("%s: Wrong type for input argument #%d: a string expected.\n"), 'write_csv', 1)); 17 error(msprintf(gettext("%s: Wrong type for input argument #%d: a string expected.\n"), 'read_csv', 1));
18 end 18 end
19 19
20 if (size(fname,'*')<> 1) then 20 if (size(fname,'*')<> 1) then
21 error(msprintf(gettext("%s: Wrong size for input argument #%d: a string expected.\n"), 'write_csv', 1)); 21 error(msprintf(gettext("%s: Wrong size for input argument #%d: a string expected.\n"), 'read_csv', 1));
22 end 22 end
23 23
24 if argn(2)<2 then 24 if argn(2)<2 then
@@ -26,7 +26,7 @@ function mat = read_csv(fname,sep)
26 end 26 end
27 27
28 if ~isfile(fname) then 28 if ~isfile(fname) then
29 error(msprintf(gettext("%s: file %s does not exist.\n"), 'write_csv', 1, fname)); 29 error(msprintf(gettext("%s: file %s does not exist.\n"), 'read_csv', fname));
30 end 30 end
31 31
32 v = mgetl(fname); 32 v = mgetl(fname);
diff --git a/scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.dia.ref b/scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.dia.ref
new file mode 100644
index 0000000..6e30064
--- /dev/null
+++ b/scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.dia.ref
@@ -0,0 +1,18 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2009 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 6734 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/show_bug.cgi?id=6734
11//
12// <-- Short Description -->
13//
14// read_csv function contains erroneous error message.
15ierr = execstr("M = read_csv(''blaat.txt'')", "errcatch");
16if ierr <> 10000 then bugmes();quit;end
17L = lasterror();
18if grep(L(1),"read_csv") == [] then bugmes();quit;end
diff --git a/scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.tst b/scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.tst
new file mode 100644
index 0000000..68a4f30
--- /dev/null
+++ b/scilab/modules/spreadsheet/tests/nonreg_tests/bug_6734.tst
@@ -0,0 +1,21 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2009 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- Non-regression test for bug 6734 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=6734
12//
13// <-- Short Description -->
14//
15// read_csv function contains erroneous error message.
16
17ierr = execstr("M = read_csv(''blaat.txt'')", "errcatch");
18if ierr <> 10000 then pause,end
19L = lasterror();
20if grep(L(1),"read_csv") == [] then pause,end
21