pike.git / src / modules / Image / testsuite.in.in

version» Context lines:

pike.git/src/modules/Image/testsuite.in.in:1:   // -*- pike -*- - // $Id: testsuite.in.in,v 1.22 1999/08/25 05:08:46 hubbe Exp $ + // $Id: testsuite.in.in,v 1.23 1999/10/16 08:10:00 mirar Exp $   #module Image.Image   {   //-----------------------------------------------------------------------   #chapter testsuite      #test Image.PNM.decode, ==    object img1=Image.PNM.decode("P1\n5 5\n0 1 1 1 1\n1 0 1 1 1\n1 1 0 1 1\n1 1 1 0 1\n1 1 1 1 0");    object img2=Image.PNM.decode("P4\n5 5\nx¸Øèð");    if (img1!=img2) fail("differ\n");    ok();
pike.git/src/modules/Image/testsuite.in.in:34:      #test Image.Image() image    object img=Image.Image(100,100);    if (!img ||    img->xsize()!=100 ||    img->ysize()!=100) fail("wrong size");    if (img!=0) fail("wrong color");    ok();      #test Image.Image() too big -  int x=1; while ((x<<1)>0) x=(x<<1)+1; -  if (!catch { Image.Image(x,2); }) fail(x+"x2 permitted"); +  foreach ( ({0x3fffffff,0x1fffffff,0x10000000,0x7fffffff,0x7ffffffff, +  0x7ffffffff,0x7fffffffff,0x7ffffffffff}), +  int x) +  if (x>0) +  { +  if (!catch { Image.Image(x,2); }) fail(x+"x2 permitted (This might be correct - do you have "+x+" *2*4 bytes of memory?)");    if (!catch { Image.Image(x/32768,65537); }) fail((x/32768)+"x65537 permitted");    if (!catch { Image.Image(x/(32768*3),65537); }) fail((x/(32768*3))+"x65537 permitted"); -  +  }    ok();      #test Image.Image() color    object img=Image.Image(1000,1000,17,42,96);    if (!img ||    img->xsize()!=1000 ||    img->ysize()!=1000) fail("wrong size");    if (img!=({17,42,96})) fail("wrong color");    ok();