From: Adeline CARNIS Date: Fri, 20 Sep 2013 09:51:07 +0000 (+0200) Subject: Fix test in statistics module. X-Git-Tag: 5.5.0-beta-1~125 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=eee38b6a1f03075bbb20ccc61c4dec4d7c659293 Fix test in statistics module. * sum(hypermat, 3) always returned a row vector. That is no longer the case with https://codereview.scilab.org/#/c/11921/ * test_run('statistics', 'bug_3640') Change-Id: Ie41c22bb0adddcf0eef586e5e13460170e8e517d --- diff --git a/scilab/modules/statistics/tests/nonreg_tests/bug_3640.dia.ref b/scilab/modules/statistics/tests/nonreg_tests/bug_3640.dia.ref index 7e98d07..5656f36 100644 --- a/scilab/modules/statistics/tests/nonreg_tests/bug_3640.dia.ref +++ b/scilab/modules/statistics/tests/nonreg_tests/bug_3640.dia.ref @@ -12,26 +12,20 @@ // <-- Short Description --> // Calculating the mean value in the 3rd dimension "mean(A,3)", gives an error for input matrices of a certain size test = rand(150,1,165); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then bugmes();quit;end -if size(r) <> [1 150] then bugmes();quit;end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [150 1]); test = rand(150,1,166); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then bugmes();quit;end -if size(r) <> [1 150] then bugmes();quit;end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [150 1]); test = rand(1000,1,165); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then bugmes();quit;end -if size(r) <> [1 1000] then bugmes();quit;end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [1000 1]); test = rand(1000,1,166); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then bugmes();quit;end -if size(r) <> [1 1000] then bugmes();quit;end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [1000 1]); test = rand(250,1,165); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then bugmes();quit;end -if size(r) <> [1 250] then bugmes();quit;end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [250 1]); test = rand(250,1,166); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then bugmes();quit;end -if size(r) <> [1 250] then bugmes();quit;end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [250 1]); diff --git a/scilab/modules/statistics/tests/nonreg_tests/bug_3640.tst b/scilab/modules/statistics/tests/nonreg_tests/bug_3640.tst index ea6863e..cc0d5e2 100644 --- a/scilab/modules/statistics/tests/nonreg_tests/bug_3640.tst +++ b/scilab/modules/statistics/tests/nonreg_tests/bug_3640.tst @@ -15,31 +15,25 @@ test = rand(150,1,165); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then pause,end -if size(r) <> [1 150] then pause,end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [150 1]); test = rand(150,1,166); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then pause,end -if size(r) <> [1 150] then pause,end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [150 1]); test = rand(1000,1,165); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then pause,end -if size(r) <> [1 1000] then pause,end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [1000 1]); test = rand(1000,1,166); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then pause,end -if size(r) <> [1 1000] then pause,end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [1000 1]); test = rand(250,1,165); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then pause,end -if size(r) <> [1 250] then pause,end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [250 1]); test = rand(250,1,166); -ierr = execstr('r = mean(test,3);','errcatch'); -if ierr <> 0 then pause,end -if size(r) <> [1 250] then pause,end +assert_checkfalse(execstr("r = mean(test,3);" ,"errcatch") <> 0); +assert_checkequal(size(r), [250 1]);