Add a unitary test about bug 12220 12/10212/1
Sylvestre Ledru [Tue, 15 Jan 2013 08:02:02 +0000 (09:02 +0100)]
Change-Id: Icf1e9045dad2af6f3fdca0903ea4d33295394cf4

scilab/modules/spreadsheet/tests/nonreg_tests/bug_12220.dia.ref [new file with mode: 0644]
scilab/modules/spreadsheet/tests/nonreg_tests/bug_12220.tst [new file with mode: 0644]

diff --git a/scilab/modules/spreadsheet/tests/nonreg_tests/bug_12220.dia.ref b/scilab/modules/spreadsheet/tests/nonreg_tests/bug_12220.dia.ref
new file mode 100644 (file)
index 0000000..9ee6b7d
--- /dev/null
@@ -0,0 +1,27 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Sylvestre Ledru
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// 
+// <-- JAVA NOT MANDATORY -->
+//
+// <-- Non-regression test for bug 12220 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=12220
+//
+// <-- Short Description -->
+// csvTextScan unexpected behavior for missing data
+//
+content_ref = [ "26,12-10-2011 18:00,29.83,69.1,42,35.5,83,30.8,35.5,0,SSW,0,0,0" ..
+"27,12-10-2011 19:00,29.83,68.9,42,35.6,84,31.3,35.6,0,SSW,0,0,0" ..
+"28,12-10-2011 20:00,29.83,68.2,43,35.6,84,31.3,,,,,0,0" ..
+"29,12-10-2011 21:00,29.82,67.3,43,35.3,84,31,,,,,0,0" ];
+filename=TMPDIR+"/foo.csv";
+mputl(content_ref,filename);
+StrLines = mgetl(filename);
+StrMat1 = csvTextScan(StrLines(1), ',', '.', 'string');
+StrMat3 = csvTextScan(StrLines(3), ',', '.', 'string');
+assert_checkequal(size(StrMat1), size(StrMat3));
diff --git a/scilab/modules/spreadsheet/tests/nonreg_tests/bug_12220.tst b/scilab/modules/spreadsheet/tests/nonreg_tests/bug_12220.tst
new file mode 100644 (file)
index 0000000..c8a8e52
--- /dev/null
@@ -0,0 +1,31 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Sylvestre Ledru
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// 
+// <-- JAVA NOT MANDATORY -->
+//
+// <-- Non-regression test for bug 12220 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=12220
+//
+// <-- Short Description -->
+// csvTextScan unexpected behavior for missing data
+//
+
+content_ref = [ "26,12-10-2011 18:00,29.83,69.1,42,35.5,83,30.8,35.5,0,SSW,0,0,0" ..
+"27,12-10-2011 19:00,29.83,68.9,42,35.6,84,31.3,35.6,0,SSW,0,0,0" ..
+"28,12-10-2011 20:00,29.83,68.2,43,35.6,84,31.3,,,,,0,0" ..
+"29,12-10-2011 21:00,29.82,67.3,43,35.3,84,31,,,,,0,0" ];
+filename=TMPDIR+"/foo.csv";
+
+mputl(content_ref,filename);
+
+StrLines = mgetl(filename);
+StrMat1 = csvTextScan(StrLines(1), ',', '.', 'string');
+StrMat3 = csvTextScan(StrLines(3), ',', '.', 'string');
+
+assert_checkequal(size(StrMat1), size(StrMat3));