changeset 24477:e8cb11de9383

test: Mark certain bugs as xtest when run on Mac platforms (bug #52627). Don't report as errors failing tests related to bug #47413. * dlmread.cc, str2double.cc, importdata.m, io.tst: For BIST tests that fail due to bug #47413, protect test with "testif ; ! ismac ()" so that it is not run on Mac platforms. Duplicate failing test code, but protect it with: %!xtest <47413> %! ## Same test code as above, but intended only for test statistics on Mac. %! if (! ismac ()), return; endif so that it is run only on Mac platforms and contributes to xtest statistics.
author Rik <rik@octave.org>
date Wed, 27 Dec 2017 12:41:45 -0800
parents bb8ae4e9e09d
children 59041be1994b
files libinterp/corefcn/dlmread.cc libinterp/corefcn/str2double.cc scripts/io/importdata.m test/io.tst
diffstat 4 files changed, 86 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/dlmread.cc	Wed Dec 27 15:40:14 2017 -0500
+++ b/libinterp/corefcn/dlmread.cc	Wed Dec 27 12:41:45 2017 -0800
@@ -533,7 +533,30 @@
 %!   unlink (file);
 %! end_unwind_protect
 
-%!test
+%!testif ; ! ismac () 
+%! file = tempname ();
+%! unwind_protect
+%!   fid = fopen (file, "wt");
+%!   fwrite (fid, "1, 2, 3\n4+4i, 5, 6\n7, 8, 9\n10, 11, 12");
+%!   fclose (fid);
+%!
+%!   assert (dlmread (file), [1, 2, 3; 4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]);
+%!   assert (dlmread (file, ","), [1,2,3; 4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]);
+%!   assert (dlmread (file, ",", [1, 0, 2, 1]), [4 + 4i, 5; 7, 8]);
+%!   assert (dlmread (file, ",", "A2..B3"), [4 + 4i, 5; 7, 8]);
+%!   assert (dlmread (file, ",", "A2:B3"), [4 + 4i, 5; 7, 8]);
+%!   assert (dlmread (file, ",", "..B3"), [1, 2; 4 + 4i, 5; 7, 8]);
+%!   assert (dlmread (file, ",", 1, 0), [4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]);
+%!   assert (dlmread (file, ",", "A2.."), [4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]);
+%!   assert (dlmread (file, ",", 10, 0), []);
+%!   assert (dlmread (file, ",", 0, 10), []);
+%! unwind_protect_cleanup
+%!   unlink (file);
+%! end_unwind_protect
+
+%!xtest <47413>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! if (! ismac ()), return; endif
 %! file = tempname ();
 %! unwind_protect
 %!   fid = fopen (file, "wt");
--- a/libinterp/corefcn/str2double.cc	Wed Dec 27 15:40:14 2017 -0500
+++ b/libinterp/corefcn/str2double.cc	Wed Dec 27 12:41:45 2017 -0800
@@ -381,7 +381,12 @@
 /*
 %!assert (str2double ("1"), 1)
 %!assert (str2double ("-.1e-5"), -1e-6)
-%!assert (str2double (char ("1", "2 3", "4i")), [1; NaN; 4i])
+%!testif ; ! ismac ()
+%! assert (str2double (char ("1", "2 3", "4i")), [1; NaN; 4i]);
+%!xtest <47413>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! if (! ismac ()), return; endif
+%! assert (str2double (char ("1", "2 3", "4i")), [1; NaN; 4i]);
 %!assert (str2double ("1,222.5"), 1222.5)
 %!assert (str2double ("i"), i)
 %!assert (str2double ("2j"), 2i)
@@ -404,8 +409,16 @@
 %!assert (str2double ("NaN + Inf*i"), complex (NaN, Inf))
 %!assert (str2double ("Inf - Inf*i"), complex (Inf, -Inf))
 %!assert (str2double ("-i*NaN - Inf"), complex (-Inf, -NaN))
-%!assert (str2double ({"abc", "4i"}), [NaN + 0i, 4i])
-%!assert (str2double ({2, "4i"}), [NaN + 0i, 4i])
+%!testif ; ! ismac ()
+%! assert (str2double ({"abc", "4i"}), [NaN + 0i, 4i]);
+%!xtest <47413>
+%! if (! ismac ()), return; endif
+%! assert (str2double ({"abc", "4i"}), [NaN + 0i, 4i]);
+%!testif ; ! ismac ()
+%! assert (str2double ({2, "4i"}), [NaN + 0i, 4i])
+%!xtest <47413>
+%! if (! ismac ()), return; endif
+%! assert (str2double ({2, "4i"}), [NaN + 0i, 4i])
 %!assert (str2double (zeros (3,1,2)), NaN)
 %!assert (str2double (''), NaN)
 %!assert (str2double ([]), NaN)
--- a/scripts/io/importdata.m	Wed Dec 27 15:40:14 2017 -0500
+++ b/scripts/io/importdata.m	Wed Dec 27 12:41:45 2017 -0800
@@ -462,7 +462,22 @@
 %! assert (d, "\t");
 %! assert (h, 0);
 
-%!test
+%!testif ; ! ismac ()
+%! ## Complex numbers
+%! A = [3.1 -7.2 0-3.4i; 0.012 -6.5+7.2i 128];
+%! fn  = tempname ();
+%! fid = fopen (fn, "w");
+%! fputs (fid, "3.1\t-7.2\t0-3.4i\n0.012\t-6.5+7.2i\t128");
+%! fclose (fid);
+%! [a,d,h] = importdata (fn, '\t');
+%! unlink (fn);
+%! assert (a, A);
+%! assert (d, "\t");
+%! assert (h, 0);
+
+%!xtest <47413>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! if (! ismac ()), return; endif
 %! ## Complex numbers
 %! A = [3.1 -7.2 0-3.4i; 0.012 -6.5+7.2i 128];
 %! fn  = tempname ();
--- a/test/io.tst	Wed Dec 27 15:40:14 2017 -0500
+++ b/test/io.tst	Wed Dec 27 12:41:45 2017 -0800
@@ -326,21 +326,48 @@
 %!assert (sscanf ('7777777777777777', '%lo', 'C'), 281474976710655)
 %!assert (sscanf ('ffffffffffff', '%lx', 'C'), 281474976710655)
 
-%!test
+%!testif ; ! ismac ()
+%! [val, count, msg, pos] = sscanf ("3I2", "%f");
+%! assert (val, 3);
+%! assert (count, 1);
+%! assert (msg, "");
+%! assert (pos, 2);
+
+%!xtest <47413>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! if (! ismac ()), return; endif
 %! [val, count, msg, pos] = sscanf ("3I2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
 %! assert (msg, "");
 %! assert (pos, 2);
 
-%!test
+%!testif ; ! ismac ()
 %! [val, count, msg, pos] = sscanf ("3In2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
 %! assert (msg, "");
 %! assert (pos, 2);
 
-%!test
+%!xtest <47413>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! if (! ismac ()), return; endif
+%! [val, count, msg, pos] = sscanf ("3In2", "%f");
+%! assert (val, 3);
+%! assert (count, 1);
+%! assert (msg, "");
+%! assert (pos, 2);
+
+%!testif ; ! ismac ()
+%! [val, count, msg, pos] = sscanf ("3Inf2", "%f");
+%! assert (val, [3; Inf; 2]);
+%! assert (count, 3);
+%! assert (msg, "");
+%! assert (pos, 6);
+
+%!xtest <47413>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! if (! ismac ()), return; endif
 %! [val, count, msg, pos] = sscanf ("3Inf2", "%f");
 %! assert (val, [3; Inf; 2]);
 %! assert (count, 3);