Fix test after https://codereview.scilab.org/#/c/13722/ (findobj can now take 1 or... 41/13741/1
Vincent COUVERT [Fri, 14 Feb 2014 10:32:13 +0000 (11:32 +0100)]
Change-Id: I76217625c9a7ad7bbe61e92b12167e41b655c735

scilab/modules/tclsci/tests/nonreg_tests/bug_790.dia.ref
scilab/modules/tclsci/tests/nonreg_tests/bug_790.tst

index fbf0af7..11f9cd5 100644 (file)
 // <-- Short Description -->
 //    Scilab crashes when you enter findobj().
 //    I know that it is not usefull but, the bug exists.
-ierr = execstr("findobj()","errcatch");
-msg = lasterror();
-if ierr==0 | msg<>msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"), "findobj", 2) then
-  pause
-end
-ierr = execstr("findobj(""test"")","errcatch");
-msg = lasterror();
-if ierr==0 | msg<>msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"), "findobj", 2) then
-  pause
-end
-if execstr("findobj(""Param1"",""Param2"") == []","errcatch") <> 0 then bugmes();quit;end
+refMsg = msprintf(gettext("%s: Wrong number of input arguments: %d or %d expected.\n"), "findobj", 1, 2);
+assert_checkerror("findobj()", refMsg)
+ ans  =
+  T  
+assert_checktrue(execstr("findobj(""test"") == []","errcatch")==0);
+assert_checktrue(execstr("findobj(""Param1"",""Param2"") == []","errcatch")==0);
index 0b3575a..95bf8d4 100644 (file)
 //    Scilab crashes when you enter findobj().
 //    I know that it is not usefull but, the bug exists.
 
-ierr = execstr("findobj()","errcatch");
-msg = lasterror();
-if ierr==0 | msg<>msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"), "findobj", 2) then
-  pause
-end
-ierr = execstr("findobj(""test"")","errcatch");
-msg = lasterror();
-if ierr==0 | msg<>msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"), "findobj", 2) then
-  pause
-end
-if execstr("findobj(""Param1"",""Param2"") == []","errcatch") <> 0 then pause,end
+refMsg = msprintf(gettext("%s: Wrong number of input arguments: %d or %d expected.\n"), "findobj", 1, 2);
+assert_checkerror("findobj()", refMsg)
+assert_checktrue(execstr("findobj(""test"") == []","errcatch")==0);
+assert_checktrue(execstr("findobj(""Param1"",""Param2"") == []","errcatch")==0);