Fix test win64b: test_run('graphics', 'contour2d') 04/11404/2
Adeline CARNIS [Thu, 25 Apr 2013 15:12:45 +0000 (17:12 +0200)]
test_run('graphics', 'bug_10298')
test_run('graphics', 'bug_11331')
test_run('graphics', 'bug_2235')
test_run('graphics', 'bug_2951')
test_run('graphics', 'bug_3362')
test_run('graphics', 'bug_4108')
test_run('graphics', 'bug_4221')
test_run('graphics', 'bug_5637')

Change-Id: Ice598368ee9f2e30532f3e87c85792e71faa1d49

17 files changed:
scilab/modules/graphics/macros/contour.sci
scilab/modules/graphics/macros/graypolarplot.sci
scilab/modules/graphics/tests/nonreg_tests/bug_10298.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_10298.tst
scilab/modules/graphics/tests/nonreg_tests/bug_1689.tst
scilab/modules/graphics/tests/nonreg_tests/bug_2935.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_2935.tst
scilab/modules/graphics/tests/nonreg_tests/bug_2951.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_2951.tst
scilab/modules/graphics/tests/nonreg_tests/bug_3362.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_3362.tst
scilab/modules/graphics/tests/nonreg_tests/bug_4108.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_4108.tst
scilab/modules/graphics/tests/nonreg_tests/bug_4221.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_4221.tst
scilab/modules/graphics/tests/nonreg_tests/bug_5637.dia.ref
scilab/modules/graphics/tests/nonreg_tests/bug_5637.tst

index 1c7cd73..b1938c7 100644 (file)
@@ -12,11 +12,11 @@ function contour(x, y, z, nz, theta, alpha, leg, flag, ebox, zlev)
 
   function contour_demo()
     function z = Surf1(x, y)
-      z = x^2 + y^3;
+      z = x.^2 + y.^3;
     endfunction
 
     function z = Surf2(x, y)
-      z = x^2 + y^2;
+      z = x.^2 + y.^2;
     endfunction
 
     x = -1:0.1:1;
index 7a04cf1..f9cb21f 100644 (file)
@@ -11,7 +11,7 @@ function graypolarplot(theta,rho,z,varargin)
 [lhs,rhs]=argn(0)
 if rhs<=0 then
   rho=1:0.2:4;theta=(0:0.02:1)*2*%pi;
-  z=30+round(theta'*(1+rho^2));
+  z=30+round(theta'*(1+rho.^2));
   clf();
   f=gcf();
   f.color_map=hotcolormap(128);
index 7944a39..0032c3d 100644 (file)
@@ -14,7 +14,7 @@
 // Example of datatipSetDisplay generates an error
 x=linspace(-1,1,1000);
 clf()
-plot(x,sinc(20*x),x,1-x^2);
+plot(x,sinc(20*x),x,1-x.^2);
 e=gce();e=e.children;
 d21=datatipCreate(e(2),600);
 d22=datatipCreate(e(2),200);
index d7f09f5..a860b6d 100644 (file)
@@ -17,7 +17,7 @@
 
 x=linspace(-1,1,1000);
 clf()
-plot(x,sinc(20*x),x,1-x^2);
+plot(x,sinc(20*x),x,1-x.^2);
 e=gce();e=e.children;
 d21=datatipCreate(e(2),600);
 d22=datatipCreate(e(2),200);
index a3f6f57..2d90d6a 100644 (file)
@@ -27,5 +27,3 @@ if (hf.figure_size <> figureSize) then pause; end;
 figureSize = [640, 480];
 hf.figure_size = figureSize;
 if (hf.figure_size <> figureSize) then pause; end;
-
-
index 4648487..eef6041 100644 (file)
 // <-- Short Description -->
 // In the "Bezier surface test 2" demo, an axis is displayed, it should not.
 function [z]=dup(x,n)
-// utility
-// x is a vector this function returns [x,x,x,x...] or [x;x;x;x;..]
-// depending on x
-  [nr,nc]=size(x)
-  if nr==1 then
-    y=ones(n,1);
-    z= x.*.y ;
-  else
-    if nc<>1 then
-      error("dup : x must be a vector");
+    // utility 
+    // x is a vector this function returns [x,x,x,x...] or [x;x;x;x;..]
+    // depending on x
+    [nr,nc]=size(x)
+    if nr==1 then
+        y=ones(n,1);
+        z= x.*.y ; 
     else
-      y=ones(1,n);
-      z= x.*.y ;
+        if nc<>1 then
+            error("dup : x must be a vector");
+        else
+            y=ones(1,n);
+            z= x.*.y ;
+        end
     end
-  end
 endfunction
 function [X,Y,Z]=beziersurface (x,y,z,n)
-// Compute a Bezier surface. Return {bx,by,bz}.
-  [lhs,rhs]=argn(0);
-  if rhs <= 3 ; n=20;end
-  t=linspace(0,1,n);
-  n=size(x,'r')-1; // i=nonzeros(t~=1);
-  t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
-  T=dup(t./t1,n)';
-  b1=[((1-t')^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
-  b1=cumprod(b1,'c');
-  if (size(t1z,'c')>0);
-    b1(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
-  end
-  n=size(x,'c')-1; // i=nonzeros(t~=1);
-  t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
-  T=dup(t./t1,n)';
-  b2=[((1-t')^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
-  b2=cumprod(b2,'c');
-  if (size(t1z,'c')>0);
-    b2(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
-  end
-  X=b1*x*b2';Y=b1*y*b2';Z=b1*z*b2';
+    // Compute a Bezier surface. Return {bx,by,bz}.
+    [lhs,rhs]=argn(0);
+    if rhs <= 3 ; n=20;end
+    t=linspace(0,1,n);
+    n=size(x,'r')-1; // i=nonzeros(t~=1);
+    t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
+    T=dup(t./t1,n)';
+    b1=[((1-t').^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
+    b1=cumprod(b1,'c');
+    if (size(t1z,'c')>0); 
+        b1(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
+    end
+    n=size(x,'c')-1; // i=nonzeros(t~=1);
+    t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
+    T=dup(t./t1,n)';
+    b2=[((1-t').^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
+    b2=cumprod(b2,'c');
+    if (size(t1z,'c')>0); 
+        b2(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
+    end
+    X=b1*x*b2';Y=b1*y*b2';Z=b1*z*b2';
 endfunction
 function c1test
-       
-       // first surface'
-       x1=dup(-0.5:0.25:0.5,5);
-       y1=dup([0,0,0,0,1],5);
-       z1=dup(2:0.25:3,5)';
-       [xb1,yb1,zb1]=beziersurface(x1,y1,z1,10);
-       
-       // second surface
-       x2=dup(-0.5:0.25:0.5,5);
-       y2=[(ones(4,5));[0,0,0,0,0]];
-       z2=-dup(-1:0.25:0,5)';
-       [xb2,yb2,zb2]=beziersurface(x2,y2,z2,10);
-       
-       // a surface to link the two previous ones'
-       x=zeros(5,5); y=x; z=x;
-       x(1,:)=x1(1,:); x(2,:)=x(1,:)-(x1(2,:)-x1(1,:));
-       x(5,:)=x2(1,:); x(4,:)=x(5,:)-(x2(2,:)-x2(1,:));
-       x(3,:)=(x(4,:)+x(2,:))/2;
-       y(1,:)=y1(1,:); y(2,:)=y(1,:)-(y1(2,:)-y1(1,:));
-       y(5,:)=y2(1,:); y(4,:)=y(5,:)-(y2(2,:)-y2(1,:));
-       y(3,:)=(y(4,:)+y(2,:))/2;
-       z(1,:)=z1(1,:); z(2,:)=z(1,:)-(z1(2,:)-z1(1,:));
-       z(5,:)=z2(1,:); z(4,:)=z(5,:)-(z2(2,:)-z2(1,:));
-       z(3,:)=(z(4,:)+z(2,:))/2;
-       A=35,T=50,L=" ",EB=[4,2,0];
-       [xb,yb,zb]=beziersurface(x,y,z,10);
-       //drawing
-       my_handle = scf(100001);
-       clf(my_handle,"reset");
-       my_current_axis = gca();
-       drawlater();
-       subplot(2,1,1);
-       title("how two bezier surfaces can be joined","fontsize",3);
-       subplot(2,2,1);
-       plot3d2(xb1,yb1,zb1,-1,A,T,L,EB);
-       subplot(2,2,3);
-       plot3d2(xb2,yb2,zb2,-1,A,T,L,EB);
-       subplot(1,2,2);
-       [n1,p1]=size(xb1);
-       [n2,p2]=size(xb);
-       plot3d2([xb1;xb;xb2],[yb1;yb;yb2],[zb1;zb;zb2],-1,A,T,L,EB);
-       delete(my_current_axis);
-       drawnow();
-       
+    // first surface'
+    x1=dup(-0.5:0.25:0.5,5);
+    y1=dup([0,0,0,0,1],5);
+    z1=dup(2:0.25:3,5)';
+    [xb1,yb1,zb1]=beziersurface(x1,y1,z1,10);
+    // second surface
+    x2=dup(-0.5:0.25:0.5,5);
+    y2=[(ones(4,5));[0,0,0,0,0]];
+    z2=-dup(-1:0.25:0,5)';
+    [xb2,yb2,zb2]=beziersurface(x2,y2,z2,10);
+    // a surface to link the two previous ones'
+    x=zeros(5,5); y=x; z=x;
+    x(1,:)=x1(1,:); x(2,:)=x(1,:)-(x1(2,:)-x1(1,:));
+    x(5,:)=x2(1,:); x(4,:)=x(5,:)-(x2(2,:)-x2(1,:));
+    x(3,:)=(x(4,:)+x(2,:))/2;
+    y(1,:)=y1(1,:); y(2,:)=y(1,:)-(y1(2,:)-y1(1,:));
+    y(5,:)=y2(1,:); y(4,:)=y(5,:)-(y2(2,:)-y2(1,:));
+    y(3,:)=(y(4,:)+y(2,:))/2;
+    z(1,:)=z1(1,:); z(2,:)=z(1,:)-(z1(2,:)-z1(1,:));
+    z(5,:)=z2(1,:); z(4,:)=z(5,:)-(z2(2,:)-z2(1,:));
+    z(3,:)=(z(4,:)+z(2,:))/2;
+    A=35,T=50,L=" ",EB=[4,2,0];
+    [xb,yb,zb]=beziersurface(x,y,z,10);
+    //drawing
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    my_current_axis = gca();
+    drawlater();
+    subplot(2,1,1);
+    title("how two bezier surfaces can be joined","fontsize",3);
+    subplot(2,2,1);
+    plot3d2(xb1,yb1,zb1,-1,A,T,L,EB);
+    subplot(2,2,3);
+    plot3d2(xb2,yb2,zb2,-1,A,T,L,EB);
+    subplot(1,2,2);
+    [n1,p1]=size(xb1);
+    [n2,p2]=size(xb);
+    plot3d2([xb1;xb;xb2],[yb1;yb;yb2],[zb1;zb;zb2],-1,A,T,L,EB);
+    delete(my_current_axis);
+    drawnow();
 endfunction
 c1test();
 // there should be 3 subplots and not 4
index e7dd83e..e8edbd8 100644 (file)
 // In the "Bezier surface test 2" demo, an axis is displayed, it should not.
 
 function [z]=dup(x,n)
-// utility 
-// x is a vector this function returns [x,x,x,x...] or [x;x;x;x;..]
-// depending on x
-  [nr,nc]=size(x)
-  if nr==1 then
-    y=ones(n,1);
-    z= x.*.y ; 
-  else
-    if nc<>1 then
-      error("dup : x must be a vector");
+    // utility 
+    // x is a vector this function returns [x,x,x,x...] or [x;x;x;x;..]
+    // depending on x
+    [nr,nc]=size(x)
+    if nr==1 then
+        y=ones(n,1);
+        z= x.*.y ; 
     else
-      y=ones(1,n);
-      z= x.*.y ;
+        if nc<>1 then
+            error("dup : x must be a vector");
+        else
+            y=ones(1,n);
+            z= x.*.y ;
+        end
     end
-  end
 endfunction
 
 
 function [X,Y,Z]=beziersurface (x,y,z,n)
-// Compute a Bezier surface. Return {bx,by,bz}.
-  [lhs,rhs]=argn(0);
-  if rhs <= 3 ; n=20;end
-  t=linspace(0,1,n);
-  n=size(x,'r')-1; // i=nonzeros(t~=1);
-  t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
-  T=dup(t./t1,n)';
-  b1=[((1-t')^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
-  b1=cumprod(b1,'c');
-  if (size(t1z,'c')>0); 
-    b1(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
-  end
-  n=size(x,'c')-1; // i=nonzeros(t~=1);
-  t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
-  T=dup(t./t1,n)';
-  b2=[((1-t')^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
-  b2=cumprod(b2,'c');
-  if (size(t1z,'c')>0); 
-    b2(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
-  end
-  X=b1*x*b2';Y=b1*y*b2';Z=b1*z*b2';
+    // Compute a Bezier surface. Return {bx,by,bz}.
+    [lhs,rhs]=argn(0);
+    if rhs <= 3 ; n=20;end
+    t=linspace(0,1,n);
+    n=size(x,'r')-1; // i=nonzeros(t~=1);
+    t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
+    T=dup(t./t1,n)';
+    b1=[((1-t').^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
+    b1=cumprod(b1,'c');
+    if (size(t1z,'c')>0); 
+        b1(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
+    end
+    n=size(x,'c')-1; // i=nonzeros(t~=1);
+    t1=(1-t); t1z= find(t1==0.0); t1(t1z)= ones(t1z);
+    T=dup(t./t1,n)';
+    b2=[((1-t').^n),(T.*dup((n-(1:n)+1)./(1:n),size(t,'c')))];
+    b2=cumprod(b2,'c');
+    if (size(t1z,'c')>0); 
+        b2(t1z,:)= dup([ 0*ones(1,n),1],size(t1z,'c'));
+    end
+    X=b1*x*b2';Y=b1*y*b2';Z=b1*z*b2';
 endfunction
 
 function c1test
-       
-       // first surface'
-       x1=dup(-0.5:0.25:0.5,5);
-       y1=dup([0,0,0,0,1],5);
-       z1=dup(2:0.25:3,5)';
-       [xb1,yb1,zb1]=beziersurface(x1,y1,z1,10);
-       
-       // second surface
-       x2=dup(-0.5:0.25:0.5,5);
-       y2=[(ones(4,5));[0,0,0,0,0]];
-       z2=-dup(-1:0.25:0,5)';
-       [xb2,yb2,zb2]=beziersurface(x2,y2,z2,10);
-       
-       // a surface to link the two previous ones'
-       x=zeros(5,5); y=x; z=x;
-       x(1,:)=x1(1,:); x(2,:)=x(1,:)-(x1(2,:)-x1(1,:));
-       x(5,:)=x2(1,:); x(4,:)=x(5,:)-(x2(2,:)-x2(1,:));
-       x(3,:)=(x(4,:)+x(2,:))/2;
-       y(1,:)=y1(1,:); y(2,:)=y(1,:)-(y1(2,:)-y1(1,:));
-       y(5,:)=y2(1,:); y(4,:)=y(5,:)-(y2(2,:)-y2(1,:));
-       y(3,:)=(y(4,:)+y(2,:))/2;
-       z(1,:)=z1(1,:); z(2,:)=z(1,:)-(z1(2,:)-z1(1,:));
-       z(5,:)=z2(1,:); z(4,:)=z(5,:)-(z2(2,:)-z2(1,:));
-       z(3,:)=(z(4,:)+z(2,:))/2;
-       A=35,T=50,L=" ",EB=[4,2,0];
-       [xb,yb,zb]=beziersurface(x,y,z,10);
 
-       //drawing
-       my_handle = scf(100001);
-       clf(my_handle,"reset");
-       my_current_axis = gca();
-       drawlater();
-       subplot(2,1,1);
-       title("how two bezier surfaces can be joined","fontsize",3);
-       subplot(2,2,1);
-       plot3d2(xb1,yb1,zb1,-1,A,T,L,EB);
-       subplot(2,2,3);
-       plot3d2(xb2,yb2,zb2,-1,A,T,L,EB);
-       subplot(1,2,2);
-       [n1,p1]=size(xb1);
-       [n2,p2]=size(xb);
-       plot3d2([xb1;xb;xb2],[yb1;yb;yb2],[zb1;zb;zb2],-1,A,T,L,EB);
-       delete(my_current_axis);
-       drawnow();
-       
+    // first surface'
+    x1=dup(-0.5:0.25:0.5,5);
+    y1=dup([0,0,0,0,1],5);
+    z1=dup(2:0.25:3,5)';
+    [xb1,yb1,zb1]=beziersurface(x1,y1,z1,10);
+
+    // second surface
+    x2=dup(-0.5:0.25:0.5,5);
+    y2=[(ones(4,5));[0,0,0,0,0]];
+    z2=-dup(-1:0.25:0,5)';
+    [xb2,yb2,zb2]=beziersurface(x2,y2,z2,10);
+
+    // a surface to link the two previous ones'
+    x=zeros(5,5); y=x; z=x;
+    x(1,:)=x1(1,:); x(2,:)=x(1,:)-(x1(2,:)-x1(1,:));
+    x(5,:)=x2(1,:); x(4,:)=x(5,:)-(x2(2,:)-x2(1,:));
+    x(3,:)=(x(4,:)+x(2,:))/2;
+    y(1,:)=y1(1,:); y(2,:)=y(1,:)-(y1(2,:)-y1(1,:));
+    y(5,:)=y2(1,:); y(4,:)=y(5,:)-(y2(2,:)-y2(1,:));
+    y(3,:)=(y(4,:)+y(2,:))/2;
+    z(1,:)=z1(1,:); z(2,:)=z(1,:)-(z1(2,:)-z1(1,:));
+    z(5,:)=z2(1,:); z(4,:)=z(5,:)-(z2(2,:)-z2(1,:));
+    z(3,:)=(z(4,:)+z(2,:))/2;
+    A=35,T=50,L=" ",EB=[4,2,0];
+    [xb,yb,zb]=beziersurface(x,y,z,10);
+
+    //drawing
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    my_current_axis = gca();
+    drawlater();
+    subplot(2,1,1);
+    title("how two bezier surfaces can be joined","fontsize",3);
+    subplot(2,2,1);
+    plot3d2(xb1,yb1,zb1,-1,A,T,L,EB);
+    subplot(2,2,3);
+    plot3d2(xb2,yb2,zb2,-1,A,T,L,EB);
+    subplot(1,2,2);
+    [n1,p1]=size(xb1);
+    [n2,p2]=size(xb);
+    plot3d2([xb1;xb;xb2],[yb1;yb;yb2],[zb1;zb;zb2],-1,A,T,L,EB);
+    delete(my_current_axis);
+    drawnow();
+
 endfunction
 
 c1test();
index bf3765a..8156613 100644 (file)
@@ -13,7 +13,7 @@
 // <-- Short Description -->
 // problem to refresh display with example of graypolarplot
 rho=1:0.1:4;theta=(0:0.02:1)*2*%pi;
-z=30+round(theta'*(1+rho^2));
+z=30+round(theta'*(1+rho.^2));
 f=gcf();
 f.color_map= hotcolormap(128);
 clf();graypolarplot(theta,rho,z)
index 849f328..18443ea 100644 (file)
@@ -16,7 +16,7 @@
 // problem to refresh display with example of graypolarplot
 
 rho=1:0.1:4;theta=(0:0.02:1)*2*%pi;
-z=30+round(theta'*(1+rho^2));
+z=30+round(theta'*(1+rho.^2));
 f=gcf();
 f.color_map= hotcolormap(128);
 clf();graypolarplot(theta,rho,z)
index e9ffc95..fa2ba0c 100644 (file)
@@ -13,6 +13,6 @@
 // <-- Short Description -->
 //    problem with incorrect legend in plot2d
 t=(1:10)';
-if execstr("plot2d(t,t^2,leg=''s@'')",'errcatch')<>0 then bugmes();quit;end
-if execstr("plot2d(t,t^2,leg=''s@s1'')",'errcatch')<>0 then bugmes();quit;end
-if execstr("plot2d(t,[t^2 t^3],leg=''s'')",'errcatch')<>0 then bugmes();quit;end
+assert_checktrue(execstr("plot2d(t,t.^2,leg=''s@'')",'errcatch') == 0);
+assert_checktrue(execstr("plot2d(t,t.^2,leg=''s@s1'')",'errcatch') == 0);
+assert_checktrue(execstr("plot2d(t,[t.^2 t.^3],leg=''s'')",'errcatch') == 0);
index 2cd16e3..5ba4947 100644 (file)
@@ -16,6 +16,6 @@
 //    problem with incorrect legend in plot2d
 
 t=(1:10)';
-if execstr("plot2d(t,t^2,leg=''s@'')",'errcatch')<>0 then pause,end
-if execstr("plot2d(t,t^2,leg=''s@s1'')",'errcatch')<>0 then pause,end
-if execstr("plot2d(t,[t^2 t^3],leg=''s'')",'errcatch')<>0 then pause,end
+assert_checktrue(execstr("plot2d(t,t.^2,leg=''s@'')",'errcatch') == 0);
+assert_checktrue(execstr("plot2d(t,t.^2,leg=''s@s1'')",'errcatch') == 0);
+assert_checktrue(execstr("plot2d(t,[t.^2 t.^3],leg=''s'')",'errcatch') == 0);
index 700fc6d..afc8373 100644 (file)
 // Argument location of function caption has no effect.
 //
 legend_positions = ["in_upper_right", "in_upper_left", "in_lower_right",..
-                    "in_lower_left", "out_upper_right", "out_upper_left",..
-                                       "out_lower_right", "out_lower_left", "upper_caption",..
-                                       "lower_caption", "by_coordinates"];
+"in_lower_left", "out_upper_right", "out_upper_left",..
+"out_lower_right", "out_lower_left", "upper_caption",..
+"lower_caption", "by_coordinates"];
 x = 1:10;
-plot(x,[x;x^2]);
+plot(x,[x;x.^2]);
 curves = gce();
 // check all cases
 for loc = legend_positions,
-  captions(curves.children, ["x","x^2"], loc);
-  leg = gce();
-  if (leg.legend_location <> loc) then bugmes();quit;end
+    captions(curves.children, ["x","x.^2"], loc);
+    leg = gce();
+    assert_checktrue(leg.legend_location == loc);
 end
index d90b29f..dc08acb 100644 (file)
 // <-- Short Description -->
 // Argument location of function caption has no effect.
 //
+
 legend_positions = ["in_upper_right", "in_upper_left", "in_lower_right",..
-                    "in_lower_left", "out_upper_right", "out_upper_left",..
-                                       "out_lower_right", "out_lower_left", "upper_caption",..
-                                       "lower_caption", "by_coordinates"];
+"in_lower_left", "out_upper_right", "out_upper_left",..
+"out_lower_right", "out_lower_left", "upper_caption",..
+"lower_caption", "by_coordinates"];
 
 x = 1:10;
-plot(x,[x;x^2]);
+plot(x,[x;x.^2]);
 curves = gce();
 
 // check all cases
 for loc = legend_positions,
-  captions(curves.children, ["x","x^2"], loc);
-  leg = gce();
-  if (leg.legend_location <> loc) then pause; end
+    captions(curves.children, ["x","x.^2"], loc);
+    leg = gce();
+    assert_checktrue(leg.legend_location == loc);
 end
index 1a374cd..ce9e901 100644 (file)
@@ -16,7 +16,7 @@
 stacksize('max');
 rho=1:256;
 theta=(1:360)./180.*%pi;
-z=30+round(theta'*(1+rho^2));
+z=30+round(theta'*(1+rho.^2));
 f=gcf();
 f.color_map= hotcolormap(128);
 clf();
index b2bfc55..bc0a163 100644 (file)
@@ -20,7 +20,7 @@ stacksize('max');
 
 rho=1:256;
 theta=(1:360)./180.*%pi;
-z=30+round(theta'*(1+rho^2));
+z=30+round(theta'*(1+rho.^2));
 f=gcf();
 f.color_map= hotcolormap(128);
 clf();
index faa26f5..a1722b8 100644 (file)
@@ -14,9 +14,8 @@
 // The plot function does not work when the data variations are small.
 sigma = sqrt(2);
 function p = f( x , mu , sigma )
-  p = exp ( -0.5 * (log(x) - mu)^2/sigma^2 ) ./ ( sigma * x * sqrt(2*%pi) )
+  p = exp ( -0.5 * (log(x) - mu).^2/sigma.^2 ) ./ ( sigma * x * sqrt(2*%pi) )
 endfunction
 x = linspace ( 200 , 400 , 1000 );
 p = f( x , 300.0 , 30.0 );
-ierr = execstr('plot ( x , p );','errcatch');
-if ierr~=0 then bugmes();quit;end;
+assert_checkfalse(execstr('plot ( x , p );','errcatch') <> 0);
index 21edfe0..fcd71e1 100644 (file)
 sigma = sqrt(2);
 
 function p = f( x , mu , sigma )
-  p = exp ( -0.5 * (log(x) - mu)^2/sigma^2 ) ./ ( sigma * x * sqrt(2*%pi) )
+  p = exp ( -0.5 * (log(x) - mu).^2/sigma.^2 ) ./ ( sigma * x * sqrt(2*%pi) )
 endfunction
 
 x = linspace ( 200 , 400 , 1000 );
 
 p = f( x , 300.0 , 30.0 );
 
-ierr = execstr('plot ( x , p );','errcatch');
-
-if ierr~=0 then pause; end;
+assert_checkfalse(execstr('plot ( x , p );','errcatch') <> 0);