// 53. 54. 55. 56.
//
z = ['1' '2' '3' '4'; '5' '6' '7' '8'];
-if or(asciimat(z)<>[49 50 51 52 ; 53 54 55 56]) then pause;end
+if or(asciimat(z)<>[49 50 51 52 ; 53 54 55 56]) then bugmes();quit;end
// Wrong error message in exists
execstr("exists(4)", "errcatch");
msg = lasterror();
-if msg<> msprintf(gettext("%s: Wrong type for argument %d: String matrix expected.\n"), "exists", 1) then pause; end
+if msg<> msprintf(gettext("%s: Wrong type for argument %d: String matrix expected.\n"), "exists", 1) then bugmes();quit;end
//
// <-- Short Description -->
// hypermatrix insertion problem
-if execstr("S=[];for k=1:5,S(1:2,1:3,k)=rand(2,3);end","errcatch")<>0 then pause; end
+if execstr("S=[];for k=1:5,S(1:2,1:3,k)=rand(2,3);end","errcatch")<>0 then bugmes();quit;end
// enable message
warning(warning_mode);
// check addinter add scifun1
- if ( funptr('scifun1') == 0 ) then pause;end
- if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then pause;end
+ if ( funptr('scifun1') == 0 ) then bugmes();quit;end
+ if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then bugmes();quit;end
// remove scifun1
- if clearfun('scifun1') <> %T then pause;end
+ if clearfun('scifun1') <> %T then bugmes();quit;end
// remove dynamic library link
ulink();
chdir(curPath);
// enable message
warning(warning_mode);
// check addinter add scifun1
- if ( funptr('scifun1') == 0 ) then pause;end
- if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then pause;end
+ if ( funptr('scifun1') == 0 ) then bugmes();quit;end
+ if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then bugmes();quit;end
// remove scifun1
- if clearfun('scifun1') <> %T then pause;end
+ if clearfun('scifun1') <> %T then bugmes();quit;end
// remove dynamic library link
ulink();
chdir(curPath);
a = list();
a(2) = 10;
save(TMPDIR+"/test.sav",a);
-if execstr("listvarinfile(TMPDIR+""/test.sav"");", "errcatch")<>0 then pause; end
+if execstr("listvarinfile(TMPDIR+""/test.sav"");", "errcatch")<>0 then bugmes();quit;end
Name Type Size Bytes
---------------------------------------------------------------
a list 2 43
// mprintf is broken
colors=["red";"green";"blue";"pink";"black"];
RGB=[1 0 0;0 1 0;0 0 1;1 0.75 0.75;0 0 0];
-if execstr("mprintf(""%d\t%s\t%f\t%f\t%f\n"",(1:5)'',colors,RGB);", "errcatch")<>0 then pause; end
+if execstr("mprintf(""%d\t%s\t%f\t%f\t%f\n"",(1:5)'',colors,RGB);", "errcatch")<>0 then bugmes();quit;end
1 red 1.000000 0.000000 0.000000
2 green 0.000000 1.000000 0.000000
3 blue 0.000000 0.000000 1.000000
F='%d';F=strcat(F(ones(1,n)),' ');
// all lines read as int we scan a 5x5 matrix
A2=msscanf(-1,A1,F);
-if norm(A2-A) > %eps then pause;end
+if norm(A2-A) > %eps then bugmes();quit;end
// read just 2 lines
A2=msscanf(2,A1,F);
-if norm(A2-A(1:2,:)) > %eps then pause;end
+if norm(A2-A(1:2,:)) > %eps then bugmes();quit;end
// explicit columns we scan five columns
[n,a,b,c,d,e]=msscanf(-1,A1,F);
-if n<>5 then pause;end
-if norm([a,b,c,d,e]-A) > %eps then pause;end
+if n<>5 then bugmes();quit;end
+if norm([a,b,c,d,e]-A) > %eps then bugmes();quit;end
// all lines read as int but we scan only 2 columns
A2=msscanf(-1,A1,'%d%d');
-if norm(A2-A(:,1:2)) > %eps then pause;end
+if norm(A2-A(:,1:2)) > %eps then bugmes();quit;end
// all lines read as string
F='%s';F=strcat(F(ones(1,n)),' ');
A2=msscanf(-1,A1,F);
-if A2<>string(A) then pause;end
+if A2<>string(A) then bugmes();quit;end
// read just 2 lines
A2=msscanf(2,A1,F);
-if A2<>string(A(1:2,:)) then pause;end
+if A2<>string(A(1:2,:)) then bugmes();quit;end
// mixed types read column 1 and 2 as string and others as int
Fs='%s';Fs=strcat(Fs(ones(1,2)),' ');
Fd='%d';Fd=strcat(Fd(ones(1,n-2)),' ');
[n,a,b,c,d,e]=msscanf(-1,A1,Fs+' '+Fd);
-if n<>5 then pause;end
-if norm([eval(a),eval(b),c,d,e]-A) > %eps then pause;end
+if n<>5 then bugmes();quit;end
+if norm([eval(a),eval(b),c,d,e]-A) > %eps then bugmes();quit;end
// same example but returned values are compacted in L
L=msscanf(-1,A1,Fs+' '+Fd);
-if length(L)<>3 then pause;end
-if norm(getfield(3,L)-A(:,3:n)) > %eps then pause;end
-if getfield(2,L)<>string(A(:,1:2)) then pause;end
+if length(L)<>3 then bugmes();quit;end
+if norm(getfield(3,L)-A(:,3:n)) > %eps then bugmes();quit;end
+if getfield(2,L)<>string(A(:,1:2)) then bugmes();quit;end
fileSize = fileinfo(TMPDIR+"/textExport.bmp");
// check that file size is greater than 10K
minimumSize = 10000;
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.bmp");
// same for other formats
xs2gif(figIndex, TMPDIR+"/textExport.gif")
fileSize = fileinfo(TMPDIR+"/textExport.gif");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.gif");
xs2jpg(figIndex, TMPDIR+"/textExport.jpg")
fileSize = fileinfo(TMPDIR+"/textExport.jpg");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.jpg");
xs2png(figIndex, TMPDIR+"/textExport.png")
fileSize = fileinfo(TMPDIR+"/textExport.png");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.png");
// vectorial export
// increase minimum size
minimumSize = 10000;
xs2ps(figIndex, TMPDIR+"/textExport.ps")
fileSize = fileinfo(TMPDIR+"/textExport.ps");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.ps");
xs2eps(figIndex, TMPDIR+"/textExport.eps")
fileSize = fileinfo(TMPDIR+"/textExport.eps");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.eps");
xs2svg(figIndex, TMPDIR+"/textExport.svg")
fileSize = fileinfo(TMPDIR+"/textExport.svg");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.svg");
xs2pdf(figIndex, TMPDIR+"/textExport.pdf")
fileSize = fileinfo(TMPDIR+"/textExport.pdf");
-if (fileSize(1) < minimumSize) then pause; end;
+if (fileSize(1) < minimumSize) then bugmes();quit;end;
mdelete(TMPDIR+"/textExport.pdf");
0.01 - 29.4651
100. 30.537043
// chack that the X bounds are [fmin, fmax]
-if (dataBounds1(1,1) <> fmin) then pause; end;
-if (dataBounds1(2,1) <> fmax) then pause; end;
+if (dataBounds1(1,1) <> fmin) then bugmes();quit;end;
+if (dataBounds1(2,1) <> fmax) then bugmes();quit;end;
// same for magnitude plot
dataBounds2 = curFig.children(3).data_bounds
dataBounds2 =
0.01 - 0.1723667
100. 9.4565594
// chack that the X bounds are [fmin, fmax]
-if (dataBounds2(1,1) <> fmin) then pause; end;
-if (dataBounds2(2,1) <> fmax) then pause; end;
+if (dataBounds2(1,1) <> fmin) then bugmes();quit;end;
+if (dataBounds2(2,1) <> fmax) then bugmes();quit;end;
axes1 = f.children(1);
axes2 = f.children(2);
axes1.rotation_angles = [20,30];
-if (axes2.rotation_angles <> axes1.rotation_angles) then pause; end
+if (axes2.rotation_angles <> axes1.rotation_angles) then bugmes();quit;end
sys=syslin("d",zaehler./nenner);
execstr("plzr(sys);", "errcatch");
[msg, num, x, y] = lasterror();
-if (msg<>gettext("plzr: The given transfer fuction is not proper.")) | (num<>10000) then pause; end
+if (msg<>gettext("plzr: The given transfer fuction is not proper.")) | (num<>10000) then bugmes();quit;end
v =
1.
-if (v <> 1) then pause; end
+if (v <> 1) then bugmes();quit;end
ha.line_mode = "off";
// should be off
v = xget ("line mode"),
v =
0.
-if (v <> 0) then pause; end;
+if (v <> 0) then bugmes();quit;end;
delete (hf);
// second program
hf = scf ();
ha = hf.children;
xset ("line mode", 1);
-if ( ha.line_mode <> "on") then pause; end;
+if ( ha.line_mode <> "on") then bugmes();quit;end;
xset ("line mode", 0);
-if (ha.line_mode <> "off") then pause; end;
+if (ha.line_mode <> "off") then bugmes();quit;end;
delete (hf);
WARNING : Function xclip is obsolete.
WARNING : Please use clip_state and clip_box instead.
-if (xget("clipping") <> rect) then pause; end
+if (xget("clipping") <> rect) then bugmes();quit;end
// check that final figure size is the one specified
hf = gcf();
xset ("wpdim", figureSize(1), figureSize(2));
-if (hf.figure_size <> figureSize) then pause; end;
+if (hf.figure_size <> figureSize) then bugmes();quit;end;
figureSize = [640, 480];
hf.figure_size = figureSize;
-if (hf.figure_size <> figureSize) then pause; end;
+if (hf.figure_size <> figureSize) then bugmes();quit;end;
mtlb_semilogx(x,y)
// check that current axes has log flags "ln";
axes = gca();
-if (axes.log_flags <> "lnn") then pause; end
+if (axes.log_flags <> "lnn") then bugmes();quit;end
// mtlb_semilogy
x=[1:0.1:10];y=2*x^2;
mtlb_semilogy(x,y)
// check that current axes has log flags "nl";
axes = gca();
-if (axes.log_flags <> "nln") then pause; end
+if (axes.log_flags <> "nln") then bugmes();quit;end
// mtlb_loglog
x=[1:0.1:10];y=2*x^2;
mtlb_loglog(x,y)
// check that current axes has log flags "ll";
axes = gca();
-if (axes.log_flags <> "lln") then pause; end
+if (axes.log_flags <> "lln") then bugmes();quit;end
2.
errorNum = execstr("e.color_flag=2", "errcatch"); //message d'erreur : bug
-if (errorNum <> 0) then pause; end;
+if (errorNum <> 0) then bugmes();quit;end;
e.cdata_mapping // valeur direct=ok
ans =
direct
errorNum = execstr("e.cdata_mapping=''direct''", "errcatch"); //message d'erreur : bug
-if (errorNum <> 0) then pause; end;
+if (errorNum <> 0) then bugmes();quit;end;
// Impossible to save Scilab variables when there are no more existing handles.
f = gcf();
delete(f);
-if execstr("save(TMPDIR+""/bug_2165.tst"");", "errcatch")<>0 then pause; end
+if execstr("save(TMPDIR+""/bug_2165.tst"");", "errcatch")<>0 then bugmes();quit;end
WARNING : save_graphichandle: handle no more valid ignored.
delete(f)
load(pathconvert(TMPDIR+"/bug_2250.scg",%f))
figureloaded = gcf();
-if figureloaded.background<>backgroundvariable then pause; end
-if figureloaded.user_data<>userdatavariable then pause;end
+if figureloaded.background<>backgroundvariable then bugmes();quit;end
+if figureloaded.user_data<>userdatavariable then bugmes();quit;end
// compute used memory during compuations
usedMemory = free(1) - free(nbComputation);
// 5 mega
-if (usedMemory > 5000) then pause; end
+if (usedMemory > 5000) then bugmes();quit;end
Type 'resume' or 'abort' to return to standard level prompt.
// a call to h should not open a window
if is_handle_valid(h)<>%f then bugmes();quit;end;
// no window should have been created
-if (winsid() <> []) then pause; end
+if (winsid() <> []) then bugmes();quit;end
drawaxis();
xsave(TMPDIR+"/bug_2597.scg");
delete(f);
-if execstr("load(TMPDIR+""/bug_2597.scg"");","errcatch")<>0 then pause;end
+if execstr("load(TMPDIR+""/bug_2597.scg"");","errcatch")<>0 then bugmes();quit;end
delete(gcf());
name = 'Something';
my_figure_handle = scf(10);
my_figure_handle.figure_name = name;
-if (my_figure_handle.figure_name <> name) then pause; end;
+if (my_figure_handle.figure_name <> name) then bugmes();quit;end;
plot2d(x,sin(x));
axes = gca();
// axes box should be off
-if (axes.box <> "off") then pause; end;
+if (axes.box <> "off") then bugmes();quit;end;
// reset default model axes
sda();
clf();
x=linspace(-%pi,%pi,100);
plot2d(x,sin(x));
// axes box should be off
-if (axes.box <> "off") then pause; end
+if (axes.box <> "off") then bugmes();quit;end
// for plot
sda();
dAxes = gda();
plot(1:10);
axes = gca();
// box should be "off" since axes at at origin
-if (axes.box <> "off") then pause; end
+if (axes.box <> "off") then bugmes();quit;end
// for plot
sda();
clf();
plot(1:10);
axes = gca();
// box should be "on"
-if (axes.box <> "on") then pause; end
+if (axes.box <> "on") then bugmes();quit;end
// user complained that it use to use 20Mb of memory
endFreeMemory = getmemory();
// give 4 meg
-if ((initFreeMemory - endFreeMemory) > 4096) then pause; end
+if ((initFreeMemory - endFreeMemory) > 4096) then bugmes();quit;end
Error 27 at line 0 : Division by zero...
plot(x,x)
// check we are not in drawlater mode anymore
-if (curFig.immediate_drawing <> "on") then pause; end
+if (curFig.immediate_drawing <> "on") then bugmes();quit;end
clf();
axes = gca();
// no box should be present
-if (axes.box == "on") then pause; end;
+if (axes.box == "on") then bugmes();quit;end;
// When setting the property "auto_ticks" of the Axes, it is not set properly.
a=gca();
a.auto_ticks=["off" "off" "off"];
-if (a.auto_ticks <> ["off", "off", "off"]) then pause; end;
+if (a.auto_ticks <> ["off", "off", "off"]) then bugmes();quit;end;
a.auto_ticks=["on" "on" "off"];
-if (a.auto_ticks <> ["on", "on", "off"]) then pause; end;
+if (a.auto_ticks <> ["on", "on", "off"]) then bugmes();quit;end;
"Circle with radius 2";..
"Circle with radius 5"],..
[1,5,6],opt="below");
-if (ha.isoview <> "on") then pause; end
+if (ha.isoview <> "on") then bugmes();quit;end
// check that the axes are still in isoview mode
fig = gcf();
axesSize = fig.axes_size;
for i = 1:4
- if (pixPos(i,1) < 0 | pixPos(i,1) > axesSize(1)) then pause; end
- if (pixPos(i,2) < 0 | pixPos(i,2) > axesSize(2)) then pause; end
+ if (pixPos(i,1) < 0 | pixPos(i,1) > axesSize(1)) then bugmes();quit;end
+ if (pixPos(i,2) < 0 | pixPos(i,2) > axesSize(2)) then bugmes();quit;end
end
plot(x,x);
a=gca();a.log_flags='ll';
// check that there is ticks along X and Y axes
-if (a.x_ticks.labels == []) then pause;end;
-if (a.x_ticks.locations == []) then pause;end;
-if (a.y_ticks.labels == []) then pause;end;
-if (a.x_ticks.locations == []) then pause;end;
+if (a.x_ticks.labels == []) then bugmes();quit;end;
+if (a.x_ticks.locations == []) then bugmes();quit;end;
+if (a.y_ticks.labels == []) then bugmes();quit;end;
+if (a.x_ticks.locations == []) then bugmes();quit;end;
axesSize = fig.axes_size;
// check that the label is drawn on top of the canvas and visible
for i = 1:4
- if (pixPos(i,2) < 0 | pixPos(i,2) > axesSize(2) * 0.1) then pause; end
+ if (pixPos(i,2) < 0 | pixPos(i,2) > axesSize(2) * 0.1) then bugmes();quit;end
end
// second test
// create two plots
end
// check that the label is drawn on top of the canvas and visible
for i = 1:4
- if (pixPos(i,2) < 0 | pixPos(i,2) > axesSize(2) * 0.1) then pause; end
+ if (pixPos(i,2) < 0 | pixPos(i,2) > axesSize(2) * 0.1) then bugmes();quit;end
end
// check that title of a1 is in the middle of the canvas
subplot(212);
end
// check that the label is drawn on top of the canvas and visible
for i = 1:4
- if (pixPos(i,2) < axesSize(2) * 0.4 | pixPos(i,2) > axesSize(2) * 0.6) then pause; end
+ if (pixPos(i,2) < axesSize(2) * 0.4 | pixPos(i,2) > axesSize(2) * 0.6) then bugmes();quit;end
end
my_handle = scf();
my_handle.figure_size = [400,400] ; // OK
my_handle.figure_size = [400,600]; // used to failed
-if (my_handle.figure_size <> [400, 600]) then pause; end;
+if (my_handle.figure_size <> [400, 600]) then bugmes();quit;end;
for i = 1:100,
fig = gcf();
figSize2 = fig.figure_size;
- if (figSize2 <> figSize1) then pause;end
+ if (figSize2 <> figSize1) then bugmes();quit;end
end
delete(fig);
// same for axes_size
axesSize1 = fig.axes_size;
for i = 1:100,
axesSize2 = fig.axes_size;
- if (axesSize2 <> axesSize1) then pause;end
+ if (axesSize2 <> axesSize1) then bugmes();quit;end
end
delete(fig);
// same for figure_position
figPos1 = fig.figure_position;
for i = 1:100,
figPos2 = fig.figure_position;
- if (figPos2 <> figPos1) then pause;end
+ if (figPos2 <> figPos1) then bugmes();quit;end
end
clf(f4,'reset');
defaultFig = gdf();
// check that axes_size are set to default
-if (f4.axes_size <> defaultFig.axes_size) then pause; end;
+if (f4.axes_size <> defaultFig.axes_size) then bugmes();quit;end;
// check that figure is empty
-if (f4.children.children <> [] ) then pause; end;
+if (f4.children.children <> [] ) then bugmes();quit;end;
clf()
plot([0.01,100],[1,10]);a=gca();a.log_flags='lln';
// check that ticks loacations are right
-if ( a.x_ticks.locations <> [0.01;0.1;1;10;100] ) then pause; end
-if ( a.y_ticks.locations <> [1;10] ) then pause; end
+if ( a.x_ticks.locations <> [0.01;0.1;1;10;100] ) then bugmes();quit;end
+if ( a.y_ticks.locations <> [1;10] ) then bugmes();quit;end
xsegs(10*x1+200*ones(x1),10*y1+200*ones(y1));
// check that xsegs is clipped
segs = gce();
-if (segs.clip_state <> "on") then pause; end;
-if (segs.clip_box <> clipBox) then pause; end
+if (segs.clip_state <> "on") then bugmes();quit;end;
+if (segs.clip_box <> clipBox) then bugmes();quit;end
if my_axis.rotation_angles <> [70 70] then bugmes();quit;end;
// should not change info message
my_axe.rotation_angles = [70, 70];
-if (my_fig.info_message <> infoMessage) then pause; end
+if (my_fig.info_message <> infoMessage) then bugmes();quit;end
a.margins = [0,0,0,0];
// get user coordinates of the upper left point of the window
[x, y] = xchange(0, 0, "i2f");
-if ( abs(x - 0.5) > 0.01 | abs(y - 0.6) > 0.01) then pause;end
+if ( abs(x - 0.5) > 0.01 | abs(y - 0.6) > 0.01) then bugmes();quit;end
subplot(3,3,4);
plot2d(T,T);
// check that data bounds did not change for other plots
-if (axes1.data_bounds <> dataBounds1) then pause; end;
-if (axes2.data_bounds <> dataBounds2) then pause; end;
-if (axes3.data_bounds <> dataBounds3) then pause; end;
+if (axes1.data_bounds <> dataBounds1) then bugmes();quit;end;
+if (axes2.data_bounds <> dataBounds2) then bugmes();quit;end;
+if (axes3.data_bounds <> dataBounds3) then bugmes();quit;end;
// margins should not have change for any of plots
-if (axes1.margins <> margins1) then pause; end;
-if (axes2.margins <> margins2) then pause; end;
-if (axes3.margins <> margins3) then pause; end;
-if (axes4.margins <> margins4) then pause; end;
+if (axes1.margins <> margins1) then bugmes();quit;end;
+if (axes2.margins <> margins2) then bugmes();quit;end;
+if (axes3.margins <> margins3) then bugmes();quit;end;
+if (axes4.margins <> margins4) then bugmes();quit;end;
// axes_bounds also
-if (axes1.axes_bounds <> axesBounds1) then pause; end;
-if (axes2.axes_bounds <> axesBounds2) then pause; end;
-if (axes3.axes_bounds <> axesBounds3) then pause; end;
-if (axes4.axes_bounds <> axesBounds4) then pause; end;
+if (axes1.axes_bounds <> axesBounds1) then bugmes();quit;end;
+if (axes2.axes_bounds <> axesBounds2) then bugmes();quit;end;
+if (axes3.axes_bounds <> axesBounds3) then bugmes();quit;end;
+if (axes4.axes_bounds <> axesBounds4) then bugmes();quit;end;
xset('wpos', pos(1), pos(2));
pos = xget('wpos');
end
-if (pos <> initPos) then pause; end;
+if (pos <> initPos) then bugmes();quit;end;
// also
pos = initPos;
f=gcf();
f.figure_position=pos;
pos = f.figure_position;
end
-if (pos <> initPos) then pause; end;
+if (pos <> initPos) then bugmes();quit;end;
// auto_resize = "on"
my_figure.auto_resize = "on";
my_figure.axes_size = my_default_axes_size + 200;
-if or( my_figure.figure_size <> (my_default_figure_size + 200) ) then pause; end
-if or( my_figure.axes_size <> (my_default_axes_size + 200) ) then pause; end
+if or( my_figure.figure_size <> (my_default_figure_size + 200) ) then bugmes();quit;end
+if or( my_figure.axes_size <> (my_default_axes_size + 200) ) then bugmes();quit;end
// Delete
delete(my_figure);
// Test 2 : auto_resize = "off"
// auto_resize = "on"
my_figure.auto_resize = "off";
my_figure.axes_size = my_default_axes_size + 200;
-if or( my_figure.figure_size <> my_default_figure_size) then pause; end
-if or( my_figure.axes_size <> (my_default_axes_size + 200) ) then pause; end
+if or( my_figure.figure_size <> my_default_figure_size) then bugmes();quit;end
+if or( my_figure.axes_size <> (my_default_axes_size + 200) ) then bugmes();quit;end
// Delete
delete(my_figure);
// Create a default figure
my_figure = scf();
// check default values
-if (my_figure.event_handler <> "") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
// setEventhandler("mypersonnaleventhanlder") test
seteventhandler("mypersonnaleventhanlder");
-if (my_figure.event_handler <> "mypersonnaleventhanlder") then pause; end
-if (my_figure.event_handler_enable <> "on") then pause; end
+if (my_figure.event_handler <> "mypersonnaleventhanlder") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "on") then bugmes();quit;end
// setEventhandler("") test
seteventhandler("");
-if (my_figure.event_handler <> "") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
// my_figure.event_handler = "mypersonnaleventhanlder"
my_figure.event_handler = "mypersonnaleventhanlder";
-if (my_figure.event_handler <> "mypersonnaleventhanlder") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "mypersonnaleventhanlder") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
// my_figure.event_handler_enable = "on"
my_figure.event_handler_enable = "on";
-if (my_figure.event_handler <> "mypersonnaleventhanlder") then pause; end
-if (my_figure.event_handler_enable <> "on") then pause; end
+if (my_figure.event_handler <> "mypersonnaleventhanlder") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "on") then bugmes();quit;end
// my_figure.event_handler = ""
// Erasing event_handler make enable flag go 'off'
my_figure.event_handler = "";
-if (my_figure.event_handler <> "") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
// my_figure.event_handler_enable = "on";
// Forcing event handler enable without event handler raise a warning
-if (my_figure.event_handler <> "") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
// my_figure.event_handler = "mypersonnaleventhanlder"
// then enable
// then disable
my_figure.event_handler = "mypersonnaleventhanlder";
-if (my_figure.event_handler <> "mypersonnaleventhanlder") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "mypersonnaleventhanlder") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
my_figure.event_handler_enable = "on";
-if (my_figure.event_handler <> "mypersonnaleventhanlder") then pause; end
-if (my_figure.event_handler_enable <> "on") then pause; end
+if (my_figure.event_handler <> "mypersonnaleventhanlder") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "on") then bugmes();quit;end
my_figure.event_handler_enable = "off";
-if (my_figure.event_handler <> "mypersonnaleventhanlder") then pause; end
-if (my_figure.event_handler_enable <> "off") then pause; end
+if (my_figure.event_handler <> "mypersonnaleventhanlder") then bugmes();quit;end
+if (my_figure.event_handler_enable <> "off") then bugmes();quit;end
// Delete
delete(my_figure);
// Get default value
my_df_figure_position = my_figure.figure_position;
my_figure.figure_position = my_df_figure_position + 100;
-if or( my_figure.figure_position <> (my_df_figure_position + 100) ) then pause; end
+if or( my_figure.figure_position <> (my_df_figure_position + 100) ) then bugmes();quit;end
// Delete
delete(my_figure);
// auto_resize = "on"
my_figure.auto_resize = "on";
my_figure.figure_size = my_default_figure_size + 200;
-if or( my_figure.figure_size <> (my_default_figure_size + 200) ) then pause; end
-if or( my_figure.axes_size <> (my_default_axes_size + 200) ) then pause; end
+if or( my_figure.figure_size <> (my_default_figure_size + 200) ) then bugmes();quit;end
+if or( my_figure.axes_size <> (my_default_axes_size + 200) ) then bugmes();quit;end
// Delete
delete(my_figure);
// Test 2 : auto_resize = "off"
// auto_resize = "on"
my_figure.auto_resize = "off";
my_figure.figure_size = my_default_figure_size + 200;
-if or( my_figure.figure_size <> (my_default_figure_size + 200) ) then pause; end
-if or( my_figure.axes_size <> my_default_axes_size ) then pause; end
+if or( my_figure.figure_size <> (my_default_figure_size + 200) ) then bugmes();quit;end
+if or( my_figure.axes_size <> my_default_axes_size ) then bugmes();quit;end
// Delete
delete(my_figure);
// gcf is f200
f45bis = get_figure_handle(45);
// check that this is the same handle
-if (f45bis <> f45) then pause; end;
+if (f45bis <> f45) then bugmes();quit;end;
// check that gcf did not change
-if (gcf() <> f200) then pause; end;
+if (gcf() <> f200) then bugmes();quit;end;
// try to find a figure that does not exists
-if (get_figure_handle(12) <> []) then pause; end
+if (get_figure_handle(12) <> []) then bugmes();quit;end
// test is_handle_valid function
// check that current objects are valid
test = is_handle_valid([gcf(), gca(), gce()]);
-if (test <> [%t, %t, %t]) then pause; end;
+if (test <> [%t, %t, %t]) then bugmes();quit;end;
// create 11 polylines
plot([0:10; 0:10; 0:10], [0:10; 0:0.5:5; 0:2:20]);
// check polylines validity
Polyline
Polyline
test = is_handle_valid(polylines);
-if (test <> [%t; %t; %t; %t; %t; %t; %t; %t; %t; %t; %t]) then pause; end
+if (test <> [%t; %t; %t; %t; %t; %t; %t; %t; %t; %t; %t]) then bugmes();quit;end
// delete some polylines
delete(polylines(3:7));
// print validity
T
T
T
-if (test <> [%t; %t; %f; %f; %f; %f; %f; %t; %t; %t; %t]) then pause; end
+if (test <> [%t; %t; %f; %f; %f; %f; %f; %t; %t; %t; %t]) then bugmes();quit;end
// check some data
fig = gcf();
// check figure
-if fig.figure_id <> 0 then pause; end
-if fig.background <> 8 then pause; end
-if fig.pixel_drawing_mode <> "copy" then pause; end
-if size(fig.children, '*') <> 1 then pause; end
+if fig.figure_id <> 0 then bugmes();quit;end
+if fig.background <> 8 then bugmes();quit;end
+if fig.pixel_drawing_mode <> "copy" then bugmes();quit;end
+if size(fig.children, '*') <> 1 then bugmes();quit;end
// check axes
axes = f.children;
-if axes.type <> "Axes" then pause; end
-if size(axes.children, '*') <> 5 then pause; end
-if axes.axes_visible <> ["on", "on", "on"] then pause; end
-if axes.x_location <> "bottom" then pause; end
-if axes.grid <> [-1, -1] then pause; end
-if axes.font_style <> 6 then pause; end
-if axes.data_bounds <> [-10, 2; 10, 2] then pause; end
-if axes.margins <> [0.125, 0.125, 0.125, 0.125] then pause; end
-if axes.axes_bounds <> [0,0,1,1] then pause; end
-if axes.hiddencolor <> 4 then pause; end
-if axes.user_data <> [] then pause; end;
-if axes.clip_state <> "clipgrf" then pause; end
-if axes.view <> "2d" then pause; end
+if axes.type <> "Axes" then bugmes();quit;end
+if size(axes.children, '*') <> 5 then bugmes();quit;end
+if axes.axes_visible <> ["on", "on", "on"] then bugmes();quit;end
+if axes.x_location <> "bottom" then bugmes();quit;end
+if axes.grid <> [-1, -1] then bugmes();quit;end
+if axes.font_style <> 6 then bugmes();quit;end
+if axes.data_bounds <> [-10, 2; 10, 2] then bugmes();quit;end
+if axes.margins <> [0.125, 0.125, 0.125, 0.125] then bugmes();quit;end
+if axes.axes_bounds <> [0,0,1,1] then bugmes();quit;end
+if axes.hiddencolor <> 4 then bugmes();quit;end
+if axes.user_data <> [] then bugmes();quit;end;
+if axes.clip_state <> "clipgrf" then bugmes();quit;end
+if axes.view <> "2d" then bugmes();quit;end
// check first compound
comp1 = axes.children(1);
-if comp1.type <> "Compound" then pause; end
-if size(comp1.children, '*') <> 3 then pause; end
-if comp1.visible <> "on" then pause; end
+if comp1.type <> "Compound" then bugmes();quit;end
+if size(comp1.children, '*') <> 3 then bugmes();quit;end
+if comp1.visible <> "on" then bugmes();quit;end
// check compund children
-if comp1.children(1).type <> "Polyline" then pause; end
-if comp1.children(1).foreground <> 3 then pause; end
-if comp1.children(2).type <> "Polyline" then pause; end
-if comp1.children(2).foreground <> 2 then pause; end
-if comp1.children(3).type <> "Polyline" then pause; end
-if comp1.children(3).foreground <> 1 then pause; end
+if comp1.children(1).type <> "Polyline" then bugmes();quit;end
+if comp1.children(1).foreground <> 3 then bugmes();quit;end
+if comp1.children(2).type <> "Polyline" then bugmes();quit;end
+if comp1.children(2).foreground <> 2 then bugmes();quit;end
+if comp1.children(3).type <> "Polyline" then bugmes();quit;end
+if comp1.children(3).foreground <> 1 then bugmes();quit;end
// check segs
segs = axes.children(2);
-if segs.type <> "Segs" then pause; end
-if segs.segs_color <> [5,5,5,5,5,5,5,5] then pause; end
-if segs.arrow_size <> 1 then pause; end
-if segs.line_style <> 0 then pause; end
-if size(segs.data) <> [16, 2] then pause; end
+if segs.type <> "Segs" then bugmes();quit;end
+if segs.segs_color <> [5,5,5,5,5,5,5,5] then bugmes();quit;end
+if segs.arrow_size <> 1 then bugmes();quit;end
+if segs.line_style <> 0 then bugmes();quit;end
+if size(segs.data) <> [16, 2] then bugmes();quit;end
// check first rectangle
rect1 = axes.children(3);
-if rect1.type <> "Rectangle" then pause; end
-if rect1.mark_size <> 0 then pause; end
-if rect1.data <> [-2, 0.25, 4, 0.5]; then pause; end
-if rect1.background <> -2; then pause; end
-if rect1.fill_mode <> "on" then pause; end
-if rect1.line_mode <> "on" then pause; end
-if rect1.clip_state <> "clipgrf" then pause; end
-if rect1.user_data <> [] then pause; end
+if rect1.type <> "Rectangle" then bugmes();quit;end
+if rect1.mark_size <> 0 then bugmes();quit;end
+if rect1.data <> [-2, 0.25, 4, 0.5]; then bugmes();quit;end
+if rect1.background <> -2; then bugmes();quit;end
+if rect1.fill_mode <> "on" then bugmes();quit;end
+if rect1.line_mode <> "on" then bugmes();quit;end
+if rect1.clip_state <> "clipgrf" then bugmes();quit;end
+if rect1.user_data <> [] then bugmes();quit;end
// check second rectangle
rect2 = axes.children(4);
-if rect2.type <> "Rectangle" then pause; end
-if rect2.mark_size <> 0 then pause; end
-if rect2.data <> [-4, 0.5, 8, 1]; then pause; end
-if rect2.background <> -2; then pause; end
-if rect2.fill_mode <> "off" then pause; end
-if rect2.line_mode <> "on" then pause; end
-if rect2.clip_state <> "clipgrf" then pause; end
-if rect2.user_data <> [] then pause; end
+if rect2.type <> "Rectangle" then bugmes();quit;end
+if rect2.mark_size <> 0 then bugmes();quit;end
+if rect2.data <> [-4, 0.5, 8, 1]; then bugmes();quit;end
+if rect2.background <> -2; then bugmes();quit;end
+if rect2.fill_mode <> "off" then bugmes();quit;end
+if rect2.line_mode <> "on" then bugmes();quit;end
+if rect2.clip_state <> "clipgrf" then bugmes();quit;end
+if rect2.user_data <> [] then bugmes();quit;end
// check second compound
comp2 = axes.children(5);
-if comp2.type <> "Compound" then pause; end
-if size(comp2.children, '*') <> 1 then pause; end
-if comp2.visible <> "on" then pause; end
-if comp2.user_data <> [] then pause; end
+if comp2.type <> "Compound" then bugmes();quit;end
+if size(comp2.children, '*') <> 1 then bugmes();quit;end
+if comp2.visible <> "on" then bugmes();quit;end
+if comp2.user_data <> [] then bugmes();quit;end
// check polyline
-if comp2.children(1).type <> "Polyline" then pause; end
-if comp2.children(1).foreground <> 1 then pause; end
-if size(comp2.children(1).data) <> [79, 2] then pause; end
-if comp2.children(1).interp_color_mode <> "off" then pause; end
-if comp2.children(1).fill_mode <> "off" then pause; end
+if comp2.children(1).type <> "Polyline" then bugmes();quit;end
+if comp2.children(1).foreground <> 1 then bugmes();quit;end
+if size(comp2.children(1).data) <> [79, 2] then bugmes();quit;end
+if comp2.children(1).interp_color_mode <> "off" then bugmes();quit;end
+if comp2.children(1).fill_mode <> "off" then bugmes();quit;end
// not much should have been allocated.
memoryIncrease = beginFreeMemory - endFreeMemory;
// let say that the rotation should not use more than 10 Meg
-if (memoryIncrease > 10000) then pause; end
+if (memoryIncrease > 10000) then bugmes();quit;end
axes = gca();
// check axes properties
surf1 = axes.children(1);
-if (surf1.clip_box <> [1, 2, 3, 4]) then pause; end
-if (surf1.clip_state <> "on") then pause; end
+if (surf1.clip_box <> [1, 2, 3, 4]) then bugmes();quit;end
+if (surf1.clip_state <> "on") then bugmes();quit;end
surf2 = axes.children(2);
-if (surf2.clip_box <> []) then pause; end
-if (surf2.clip_state <> "clipgrf") then pause; end
+if (surf2.clip_box <> []) then bugmes();quit;end
+if (surf2.clip_state <> "clipgrf") then bugmes();quit;end
// same for grayplot
clf();
x = 0:10;
axes = gca();
// check axes properties
surf1 = axes.children(1);
-if (surf1.clip_box <> [1, 2, 3, 4]) then pause; end
-if (surf1.clip_state <> "on") then pause; end
+if (surf1.clip_box <> [1, 2, 3, 4]) then bugmes();quit;end
+if (surf1.clip_state <> "on") then bugmes();quit;end
surf2 = axes.children(2);
-if (surf2.clip_box <> []) then pause; end
-if (surf2.clip_state <> "clipgrf") then pause; end
+if (surf2.clip_box <> []) then bugmes();quit;end
+if (surf2.clip_state <> "clipgrf") then bugmes();quit;end
// same for Matplot
clf();
x = 0:10;
axes = gca();
// check axes properties
surf1 = axes.children(1);
-if (surf1.clip_box <> [1, 2, 3, 4]) then pause; end
-if (surf1.clip_state <> "on") then pause; end
+if (surf1.clip_box <> [1, 2, 3, 4]) then bugmes();quit;end
+if (surf1.clip_state <> "on") then bugmes();quit;end
surf2 = axes.children(2);
-if (surf2.clip_box <> []) then pause; end
-if (surf2.clip_state <> "clipgrf") then pause; end
+if (surf2.clip_box <> []) then bugmes();quit;end
+if (surf2.clip_state <> "clipgrf") then bugmes();quit;end
// same for fec
clf();
x = 0:10;
axes = gca();
// check axes properties
surf1 = axes.children(1).children(1);
-if (surf1.clip_box <> [1, 2, 3, 4]) then pause; end
-if (surf1.clip_state <> "on") then pause; end
+if (surf1.clip_box <> [1, 2, 3, 4]) then bugmes();quit;end
+if (surf1.clip_state <> "on") then bugmes();quit;end
surf2 = axes.children(2).children(1);
-if (surf2.clip_box <> []) then pause; end
-if (surf2.clip_state <> "clipgrf") then pause; end
+if (surf2.clip_box <> []) then bugmes();quit;end
+if (surf2.clip_state <> "clipgrf") then bugmes();quit;end
srf = gce();
// set hidden color to some value and check them
srf.hiddencolor = 0;
-if (srf.hiddencolor <> 0) then pause; end
+if (srf.hiddencolor <> 0) then bugmes();quit;end
srf.hiddencolor = -1;
-if (srf.hiddencolor <> -1) then pause; end
+if (srf.hiddencolor <> -1) then bugmes();quit;end
srf.hiddencolor = -2;
-if (srf.hiddencolor <> -2) then pause; end
+if (srf.hiddencolor <> -2) then bugmes();quit;end
// get colormap size
fig = gcf();
cmapSize = size(fig.color_map);
cmapSize = cmapSize(1);
srf.hiddencolor = cmapSize;
-if (srf.hiddencolor <> cmapSize) then pause; end
+if (srf.hiddencolor <> cmapSize) then bugmes();quit;end
// <-- Short Description -->
// objfigure "position" initially undefined
f = figure(123);
-if isempty(get(f,"position")) then pause; end
+if isempty(get(f,"position")) then bugmes();quit;end
set(f,"position",[100 400 100 800]);
-if or(get(f,"position")<>[100 400 100 800]) then pause;end
+if or(get(f,"position")<>[100 400 100 800]) then bugmes();quit;end
Userdata = []
Tag =
// Now type something in the entry box
-if execstr("get(h,""string"")", "errcatch")<>0 then pause; end
+if execstr("get(h,""string"")", "errcatch")<>0 then bugmes();quit;end
// Reset previous parent
set(h1,"parent",f1);
pos = get(h1, "position");
-if pos(3) < pos(4) then pause; end
+if pos(3) < pos(4) then bugmes();quit;end
// Change parent
set(h1,"parent",f2);
pos = get(h1, "position");
-if pos(3) < pos(4) then pause; end
+if pos(3) < pos(4) then bugmes();quit;end
// --- Pushbuttons ---
h2 = uicontrol(f1,"style","pushbutton","position",[10 10 100 100])
h2 =
relief = get(h2, "relief");
// Reset previous parent
set(h2,"parent",f1);
-if or(get(h2, "backgroundcolor")<>bg) then pause; end
-if or(get(h2, "relief")<>relief) then pause; end
+if or(get(h2, "backgroundcolor")<>bg) then bugmes();quit;end
+if or(get(h2, "relief")<>relief) then bugmes();quit;end
// Change parent
set(h2,"parent",f2);
-if or(get(h2, "backgroundcolor")<>bg) then pause; end
-if or(get(h2, "relief")<>relief) then pause; end
+if or(get(h2, "backgroundcolor")<>bg) then bugmes();quit;end
+if or(get(h2, "relief")<>relief) then bugmes();quit;end
// --- Edits ---
h3 = uicontrol(f1,"style","edit","position",[10 10 100 100],"string","aaaaa");
txt = get(h3, "string");
// Reset previous parent
set(h3,"parent",f1);
-if or(get(h3, "string")<>txt) then pause; end
+if or(get(h3, "string")<>txt) then bugmes();quit;end
// Change parent
set(h3,"parent",f2);
-if or(get(h3, "string")<>txt) then pause; end
+if or(get(h3, "string")<>txt) then bugmes();quit;end
// --- ListBoxes ---
h4 = uicontrol(f1,"style","listbox","position",[10 10 100 100],"string",["1","2","X"],"value",2);
bg = get(h4, "backgroundcolor");
val = get(h4, "value");
// Reset previous parent
set(h4,"parent",f1);
-if or(get(h4, "backgroundcolor")<>bg) then pause; end
-if or(get(h4, "value")<>val) then pause; end
+if or(get(h4, "backgroundcolor")<>bg) then bugmes();quit;end
+if or(get(h4, "value")<>val) then bugmes();quit;end
// Change parent
set(h4,"parent",f2);
-if or(get(h4, "backgroundcolor")<>bg) then pause; end
-if or(get(h4, "value")<>val) then pause; end
+if or(get(h4, "backgroundcolor")<>bg) then bugmes();quit;end
+if or(get(h4, "value")<>val) then bugmes();quit;end
// <-- Short Description -->
// "position" property format "x|y|w|h" not accepted by figure(), despite what said in help
f = figure(1,"position","0|0|300|500");
-if or(get(f,"position")<>[0 0 300 500]) then pause; end
+if or(get(f,"position")<>[0 0 300 500]) then bugmes();quit;end
// <-- Short Description -->
// uicontrol property names could be abbreviated in scilab 4.1.2, need to be extended in scilab 5
figure();
-if execstr("uicontrol(""posi"",[10 10 100 100])", "errcatch")<>0 then pause; end
+if execstr("uicontrol(""posi"",[10 10 100 100])", "errcatch")<>0 then bugmes();quit;end
// not give the result 1 as desired
f = figure(1);
h = uicontrol("tag","F");
-if isempty(findobj("tag","F")) then pause; end
-if findobj("tag","F")<>h then pause; end
+if isempty(findobj("tag","F")) then bugmes();quit;end
+if findobj("tag","F")<>h then bugmes();quit;end
// <-- Short Description -->
// sprintf error
if MSDOS then
- if sprintf("%e", 1e-10) <> "1.000000e-010" then pause; end
+ if sprintf("%e", 1e-10) <> "1.000000e-010" then bugmes();quit;end
else
- if sprintf("%e", 1e-10) <> "1.000000e-10" then pause; end
+ if sprintf("%e", 1e-10) <> "1.000000e-10" then bugmes();quit;end
end
// TESTS FOR CELL ARRAYS
//
if binFormats(formatIndex) <> "-v4" then // Cell arrays can not be stored in Matlab 4 binary files
- if or(emptycell <> cell()) then pause; end
- if or(scalarcell <> makecell([1 1], 1.23)) then pause; end
- if or(rowcell <> makecell([1 3], "abc", [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i], 1.23)) then pause; end
- if or(colcell <> makecell([3 1], [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i], "abc", 1.23)) then pause; end
- if or(arraycell <> makecell([2 3], "a", [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i], int8(1), "abc", 1.23, eye(100,100))) then pause; end
- if or(stringcell <> makecell([2 3], "abc", "def", "ghi", "jkl", "mno", "pqr")) then pause; end
+ if or(emptycell <> cell()) then bugmes();quit;end
+ if or(scalarcell <> makecell([1 1], 1.23)) then bugmes();quit;end
+ if or(rowcell <> makecell([1 3], "abc", [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i], 1.23)) then bugmes();quit;end
+ if or(colcell <> makecell([3 1], [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i], "abc", 1.23)) then bugmes();quit;end
+ if or(arraycell <> makecell([2 3], "a", [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i], int8(1), "abc", 1.23, eye(100,100))) then bugmes();quit;end
+ if or(stringcell <> makecell([2 3], "abc", "def", "ghi", "jkl", "mno", "pqr")) then bugmes();quit;end
clear emptycell scalarcell rowcell colcell arraycell stringcell
end
//
//
if binFormats(formatIndex) <> "-v4" then // Struct arrays can not be stored in Matlab 4 binary files
sciemptystruct = struct();
- if or(emptystruct <> sciemptystruct) then pause; end
+ if or(emptystruct <> sciemptystruct) then bugmes();quit;end
sciscalarstruct = struct("f1", 10, "ftwo", "Hello", "field3", int8(12));
- if or(scalarstruct <> sciscalarstruct) then pause; end
+ if or(scalarstruct <> sciscalarstruct) then bugmes();quit;end
scirowstruct = struct("field1", 10, "field2", "Hello", "field3", int8(12));
scirowstruct(1,2).field1 = "test";
scirowstruct(1,2).field2 = eye(10, 10);
scirowstruct(1,3).field2 = "a field contents";
scirowstruct(1,3).field3 = 1.23+4.56*%i;
- if or(rowstruct <> scirowstruct) then pause; end
+ if or(rowstruct <> scirowstruct) then bugmes();quit;end
scicolstruct = struct("name", 10, "phone", "Hello", "address", int8(12));
scicolstruct(2,1).name = "test";
scicolstruct(2,1).phone = eye(10, 10);
scicolstruct(3,1).phone = "a field contents";
scicolstruct(3,1).address = 1.23+4.56*%i;
- if or(colstruct <> scicolstruct) then pause; end
+ if or(colstruct <> scicolstruct) then bugmes();quit;end
sciarraystruct = struct("field1", 10, "field2", "Hello", "field3", int8(12));
sciarraystruct(1,2).field1 = "test";
sciarraystruct(1,2).field2 = eye(10, 10);
sciarraystruct(2,1).phone = eye(10, 10);
sciarraystruct(3,1).phone = "a field contents";
sciarraystruct(3,1).address = 1.23+4.56*%i;
- if or(arraystruct <> sciarraystruct) then pause; end
+ if or(arraystruct <> sciarraystruct) then bugmes();quit;end
clear emptystruct scalarstruct rowstruct colstruct arraystruct
clear sciemptystruct sciscalarstruct scirowstruct scicolstruct sciarraystruct
end
//
// TESTS FOR CHARACTER ARRAYS
//
- if or(emptystringmatrix <> "") then pause; end
- if or(stringscalar <> "a") then pause; end
- if or(stringrowvector <> ["abc"]) then pause; end
- if or(stringcolvector <> ["a";"b";"c"]) then pause; end
- if or(stringmatrix <> ["abc";"def"]) then pause; end
+ if or(emptystringmatrix <> "") then bugmes();quit;end
+ if or(stringscalar <> "a") then bugmes();quit;end
+ if or(stringrowvector <> ["abc"]) then bugmes();quit;end
+ if or(stringcolvector <> ["a";"b";"c"]) then bugmes();quit;end
+ if or(stringmatrix <> ["abc";"def"]) then bugmes();quit;end
clear emptystringmatrix stringscalar stringrowvector stringcolvector stringmatrix
//
// TESTS FOR DOUBLE PRECISION ARRAYS
//
- if or(emptydoublematrix <> []) then pause; end
- if or(realdoublescalar <> 1.23) then pause; end
- if or(cplxdoublescalar <> 1.23 + 4.56*%i) then pause; end
- if or(realdoublerowvector <> [1.23 -4.56 7.89]) then pause; end
- if or(cplxdoublerowvector <> [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i]) then pause; end
- if or(realdoublecolvector <> [1.23;-4.56;7.89]) then pause; end
- if or(cplxdoublecolvector <> [1.23+7.89*%i;4.56-1.23*%i;7.89+4.56*%i]) then pause; end
- if or(realdoublematrix <> [1.23 -4.56 7.89;9.87 6.54 -3.21]) then pause; end
- if or(cplxdoublematrix <> [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i;9.87+3.21*%i 6.54+9.87*%i 3.21-6.54*%i]) then pause; end
+ if or(emptydoublematrix <> []) then bugmes();quit;end
+ if or(realdoublescalar <> 1.23) then bugmes();quit;end
+ if or(cplxdoublescalar <> 1.23 + 4.56*%i) then bugmes();quit;end
+ if or(realdoublerowvector <> [1.23 -4.56 7.89]) then bugmes();quit;end
+ if or(cplxdoublerowvector <> [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i]) then bugmes();quit;end
+ if or(realdoublecolvector <> [1.23;-4.56;7.89]) then bugmes();quit;end
+ if or(cplxdoublecolvector <> [1.23+7.89*%i;4.56-1.23*%i;7.89+4.56*%i]) then bugmes();quit;end
+ if or(realdoublematrix <> [1.23 -4.56 7.89;9.87 6.54 -3.21]) then bugmes();quit;end
+ if or(cplxdoublematrix <> [1.23+7.89*%i 4.56-1.23*%i 7.89+4.56*%i;9.87+3.21*%i 6.54+9.87*%i 3.21-6.54*%i]) then bugmes();quit;end
clear emptydoublematrix realdoublescalar cplxdoublescalar realdoublerowvector cplxdoublerowvector realdoublecolvector cplxdoublecolvector realdoublematrix cplxdoublematrix
//
// TESTS FOR SINGLE PRECISION ARRAYS
// TESTS FOR SPARSE MATRICES
//
if binFormats(formatIndex) <> "-v4" then // Integers can not be stored in Matlab 4 binary files
- if or(emptysparse <> []) then pause; end
- if or(realscalarsparse <> sparse(1.23)) then pause; end
- //if or(cplxscalarsparse <> sparse(1.23 + 4.56i)) then pause; end
- if or(realrowvectorsparse <> sparse([1.23 0 7.89])) then pause; end
- //if or(cplxrowvectorsparse <> sparse([1.23+7.89i 0 7.89+4.56i])) then pause; end
- if or(realcolvectorsparse <> sparse([1.23;0;7.89])) then pause; end
- //if or(cplxcolvectorsparse <> sparse([1.23+7.89i;;7.89+4.56i])) then pause; end
- if or(realmatrixsparse <> sparse([1.23 0 7.89;0 6.54 -3.21])) then pause; end
- //if or(cplxmatrixsparse <> sparse([1.23+7.89i 0 7.89+4.56i;0 6.54+9.87i 3.21-6.54i])) then pause; end
+ if or(emptysparse <> []) then bugmes();quit;end
+ if or(realscalarsparse <> sparse(1.23)) then bugmes();quit;end
+ //if or(cplxscalarsparse <> sparse(1.23 + 4.56i)) then bugmes();quit;end
+ if or(realrowvectorsparse <> sparse([1.23 0 7.89])) then bugmes();quit;end
+ //if or(cplxrowvectorsparse <> sparse([1.23+7.89i 0 7.89+4.56i])) then bugmes();quit;end
+ if or(realcolvectorsparse <> sparse([1.23;0;7.89])) then bugmes();quit;end
+ //if or(cplxcolvectorsparse <> sparse([1.23+7.89i;;7.89+4.56i])) then bugmes();quit;end
+ if or(realmatrixsparse <> sparse([1.23 0 7.89;0 6.54 -3.21])) then bugmes();quit;end
+ //if or(cplxmatrixsparse <> sparse([1.23+7.89i 0 7.89+4.56i;0 6.54+9.87i 3.21-6.54i])) then bugmes();quit;end
end
if binFormats(formatIndex) <> "-v4" then // Integers can not be stored in Matlab 4 binary files
//
// TESTS FOR 8-BITS SIGNED INTEGERS
//
- if or(emptyint8matrix <> int8([])) then pause; end
- if or(int8scalar <> int8(1)) then pause; end
- if or(int8rowvector <> int8([1 -4 7])) then pause; end
- if or(int8colvector <> int8([1;-4;7])) then pause; end
- if or(int8matrix <> int8([1 -4 7;-9 6 -3])) then pause; end
+ if or(emptyint8matrix <> int8([])) then bugmes();quit;end
+ if or(int8scalar <> int8(1)) then bugmes();quit;end
+ if or(int8rowvector <> int8([1 -4 7])) then bugmes();quit;end
+ if or(int8colvector <> int8([1;-4;7])) then bugmes();quit;end
+ if or(int8matrix <> int8([1 -4 7;-9 6 -3])) then bugmes();quit;end
clear emptyint8matrix int8scalar int8rowvector int8colvector int8matrix
//
// TESTS FOR 16-BITS SIGNED INTEGERS
//
- if or(emptyint16matrix <> int16([])) then pause; end
- if or(int16scalar <> int16(1)) then pause; end
- if or(int16rowvector <> int16([1 -4 7])) then pause; end
- if or(int16colvector <> int16([1;-4;7])) then pause; end
- if or(int16matrix <> int16([1 -4 7;-9 6 -3])) then pause; end
+ if or(emptyint16matrix <> int16([])) then bugmes();quit;end
+ if or(int16scalar <> int16(1)) then bugmes();quit;end
+ if or(int16rowvector <> int16([1 -4 7])) then bugmes();quit;end
+ if or(int16colvector <> int16([1;-4;7])) then bugmes();quit;end
+ if or(int16matrix <> int16([1 -4 7;-9 6 -3])) then bugmes();quit;end
clear emptyint16matrix int16scalar int16rowvector int16colvector int16matrix
//
// TESTS FOR 32-BITS SIGNED INTEGERS
//
- if or(emptyint32matrix <> int32([])) then pause; end
- if or(int32scalar <> int32(1)) then pause; end
- if or(int32rowvector <> int32([1 -4 7])) then pause; end
- if or(int32colvector <> int32([1;-4;7])) then pause; end
- if or(int32matrix <> int32([1 -4 7;-9 6 -3])) then pause; end
+ if or(emptyint32matrix <> int32([])) then bugmes();quit;end
+ if or(int32scalar <> int32(1)) then bugmes();quit;end
+ if or(int32rowvector <> int32([1 -4 7])) then bugmes();quit;end
+ if or(int32colvector <> int32([1;-4;7])) then bugmes();quit;end
+ if or(int32matrix <> int32([1 -4 7;-9 6 -3])) then bugmes();quit;end
clear emptyint32matrix int32scalar int32rowvector int32colvector int32matrix
// TODO: int64 tests ?
//
// TESTS FOR 8-BITS UNSIGNED INTEGERS
//
- if or(emptyuint8matrix <> uint8([])) then pause; end
- if or(uint8scalar <> uint8(1)) then pause; end
- //if or(uint8rowvector <> uint8([1 -4 7])) then pause; end
- if or(uint8rowvector <> [1 0 7]) then pause; end
- //if or(uint8colvector <> uint8([1;-4;7])) then pause; end
- if or(uint8colvector <> [1;0;7]) then pause; end
- //if or(uint8matrix <> uint8([1 -4 7;-9 6 -3])) then pause; end
- if or(uint8matrix <> [1 0 7;0 6 0]) then pause; end
+ if or(emptyuint8matrix <> uint8([])) then bugmes();quit;end
+ if or(uint8scalar <> uint8(1)) then bugmes();quit;end
+ //if or(uint8rowvector <> uint8([1 -4 7])) then bugmes();quit;end
+ if or(uint8rowvector <> [1 0 7]) then bugmes();quit;end
+ //if or(uint8colvector <> uint8([1;-4;7])) then bugmes();quit;end
+ if or(uint8colvector <> [1;0;7]) then bugmes();quit;end
+ //if or(uint8matrix <> uint8([1 -4 7;-9 6 -3])) then bugmes();quit;end
+ if or(uint8matrix <> [1 0 7;0 6 0]) then bugmes();quit;end
clear emptyuint8matrix uint8scalar uint8rowvector uint8colvector uint8matrix
//
// TESTS FOR 16-BITS UNSIGNED INTEGERS
//
- if or(emptyuint16matrix <> uint16([])) then pause; end
- if or(uint16scalar <> uint16(1)) then pause; end
- //if or(uint16rowvector <> uint16([1 -4 7])) then pause; end
- if or(uint16rowvector <> [1 0 7]) then pause; end
- //if or(uint16colvector <> uint16([1;-4;7])) then pause; end
- if or(uint16colvector <> [1;0;7]) then pause; end
- //if or(uint16matrix <> uint16([1 -4 7;-9 6 -3])) then pause; end
- if or(uint16matrix <> [1 0 7;0 6 0]) then pause; end
+ if or(emptyuint16matrix <> uint16([])) then bugmes();quit;end
+ if or(uint16scalar <> uint16(1)) then bugmes();quit;end
+ //if or(uint16rowvector <> uint16([1 -4 7])) then bugmes();quit;end
+ if or(uint16rowvector <> [1 0 7]) then bugmes();quit;end
+ //if or(uint16colvector <> uint16([1;-4;7])) then bugmes();quit;end
+ if or(uint16colvector <> [1;0;7]) then bugmes();quit;end
+ //if or(uint16matrix <> uint16([1 -4 7;-9 6 -3])) then bugmes();quit;end
+ if or(uint16matrix <> [1 0 7;0 6 0]) then bugmes();quit;end
clear emptyuint16matrix uint16scalar uint16rowvector uint16colvector uint16matrix
//
// TESTS FOR 32-BITS UNSIGNED INTEGERS
//
- if or(emptyuint32matrix <> uint32([])) then pause; end
- if or(uint32scalar <> uint32(1)) then pause; end
- //if or(uint32rowvector <> uint32([1 -4 7])) then pause; end
- if or(uint32rowvector <> [1 0 7]) then pause; end
- //if or(uint32colvector <> uint32([1;-4;7])) then pause; end
- if or(uint32colvector <> [1;0;7]) then pause; end
- //if or(uint32matrix <> uint32([1 -4 7;-9 6 -3])) then pause; end
- if or(uint32matrix <> [1 0 7;0 6 0]) then pause; end
+ if or(emptyuint32matrix <> uint32([])) then bugmes();quit;end
+ if or(uint32scalar <> uint32(1)) then bugmes();quit;end
+ //if or(uint32rowvector <> uint32([1 -4 7])) then bugmes();quit;end
+ if or(uint32rowvector <> [1 0 7]) then bugmes();quit;end
+ //if or(uint32colvector <> uint32([1;-4;7])) then bugmes();quit;end
+ if or(uint32colvector <> [1;0;7]) then bugmes();quit;end
+ //if or(uint32matrix <> uint32([1 -4 7;-9 6 -3])) then bugmes();quit;end
+ if or(uint32matrix <> [1 0 7;0 6 0]) then bugmes();quit;end
clear emptyuint32matrix uint32scalar uint32rowvector uint32colvector uint32matrix
// TODO: uint64 tests ?
//
// TESTS FOR ND-ARRAYS
//
sciemptyNDarray = hypermat([0 0 0], []);
- if or(emptyNDarray.dims <> sciemptyNDarray.dims) | or(emptyNDarray.entries <> sciemptyNDarray.entries) then pause; end
- if or(realdoubleNDarray <> matrix(1:24, 2, 3, 4)) then pause; end
- if or(complexdoubleNDarray <> matrix((1:24) + (1:24)*%i, 2, 3, 4)) then pause; end
+ if or(emptyNDarray.dims <> sciemptyNDarray.dims) | or(emptyNDarray.entries <> sciemptyNDarray.entries) then bugmes();quit;end
+ if or(realdoubleNDarray <> matrix(1:24, 2, 3, 4)) then bugmes();quit;end
+ if or(complexdoubleNDarray <> matrix((1:24) + (1:24)*%i, 2, 3, 4)) then bugmes();quit;end
clear sciemptyNDarray emptyNDarray realdoubleNDarray complexdoubleNDarray
end
//
// MISC
//
- if or(eye100x100 <> eye(100,100)) then pause; end
+ if or(eye100x100 <> eye(100,100)) then bugmes();quit;end
end
SCI/modules/matio/tests/unit_tests/eye100x100-v4.mat
execstr("clear "+varNames(varIndex)); // Clear variable
execstr("loadmatfile "+filename); // Load file contaning variable
execstr("compareOK=and(sci"+varNames(varIndex)+"=="+varNames(varIndex)+")"); // Compare
- if ~compareOK then pause;end // Stop execution if necessary
+ if ~compareOK then bugmes();quit;end // Stop execution if necessary
clear compareOK
mdelete(filename)
end
// test fo perm
N=1000;
Mat=grand(N,'prm',[1:10]');
-if sum([1:10]')/10 - sum(Mat,'c')/N > 0 then pause;end
+if sum([1:10]')/10 - sum(Mat,'c')/N > 0 then bugmes();quit;end
// test for nbn
N=10000;A=5;B=0.7;
Rdev=grand(1,N,'nbn',A,B);
// test fo perm
N=1000;
Mat=grand(N,'prm',[1:10]');
-if sum([1:10]')/10 - sum(Mat,'c')/N > 0 then pause;end
+if sum([1:10]')/10 - sum(Mat,'c')/N > 0 then bugmes();quit;end
// test for nbn
N=10000;A=5;B=0.7;
Rdev=grand(1,N,'nbn',A,B);
//
// <-- Short Description -->
// savewave crashes my machine
-if execstr("savewave(TMPDIR+""/toto.WAV"", rand(1:10000), 11025);", "errcatch")<>0 then pause; end
+if execstr("savewave(TMPDIR+""/toto.WAV"", rand(1:10000), 11025);", "errcatch")<>0 then bugmes();quit;end
Writing Wave file: Microsoft PCM format, 1 channel, 11025 samp/sec
22050 byte/sec, 2 block align, 16 bits/samp
Finished writing Wave file, 20000 data bytes
function b=bobo(); a=7; if a>1 then; b=5; end; endfunction
txt = tree2code(macr2tree(bobo),%t);
txtref = ["function [b] = bobo()";" a = 7;";" if a>1 then";" b = 5;";" end;";"endfunction";""];
-if or(txt<>txtref) then pause; end
+if or(txt<>txtref) then bugmes();quit;end
// <-- Short Description -->
// Shambolic error management or parsing in slave Tcl interpreters
// First command executed in main interpreter
-if execstr("TCL_EvalStr(""wrongcommand"");", "errcatch")==0 then pause; end
+if execstr("TCL_EvalStr(""wrongcommand"");", "errcatch")==0 then bugmes();quit;end
msg = lasterror();
msg = strsubst(msg, ascii(9), "\n");
msg = sprintf("%s", msg);
msgref = ["TCL_EvalStr, at line 1";"invalid command name ""wrongcommand"" while executing""wrongcommand"""];
-if or(msg<>msgref) then pause; end
+if or(msg<>msgref) then bugmes();quit;end
TCL_CreateSlave("slave");
// Command executed in slave: error message returned must not depend on previous error in main
-if execstr("TCL_EvalStr(""wrongcommandinslave"",""slave"")", "errcatch")==0 then pause; end
+if execstr("TCL_EvalStr(""wrongcommandinslave"",""slave"")", "errcatch")==0 then bugmes();quit;end
msg = lasterror();
msg = strsubst(msg, ascii(9), "\n");
msg = sprintf("%s", msg);
msgref = ["TCL_EvalStr, invalid command name ""wrongcommandinslave"" at line 1";"invalid command name ""wrongcommandinslave"" while executing""wrongcommandinslave"""];
-if or(msg<>msgref) then pause; end
+if or(msg<>msgref) then bugmes();quit;end
// Second command executed in main interpreter
-if execstr("TCL_EvalStr(""wrongcommand2"");", "errcatch")==0 then pause; end
+if execstr("TCL_EvalStr(""wrongcommand2"");", "errcatch")==0 then bugmes();quit;end
msg = lasterror();
msg = strsubst(msg, ascii(9), "\n");
msg = sprintf("%s", msg);
msgref = ["TCL_EvalStr, at line 1";"invalid command name ""wrongcommand2"" while executing""wrongcommand2"""];
-if or(msg<>msgref) then pause; end
+if or(msg<>msgref) then bugmes();quit;end
// Command executed again in slave: must give the same error message
-if execstr("TCL_EvalStr(""wrongcommandinslave"",""slave"")", "errcatch")==0 then pause; end
+if execstr("TCL_EvalStr(""wrongcommandinslave"",""slave"")", "errcatch")==0 then bugmes();quit;end
msg = lasterror();
msg = strsubst(msg, ascii(9), "\n");
msg = sprintf("%s", msg);
msgref = ["TCL_EvalStr, invalid command name ""wrongcommandinslave"" at line 1";"invalid command name ""wrongcommandinslave"" while executing""wrongcommandinslave"""];
-if or(msg<>msgref) then pause; end
+if or(msg<>msgref) then bugmes();quit;end