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

version» Context lines:

pike.git/src/modules/Image/testsuite.in:1:   START_MARKER - dnl $Id: testsuite.in,v 1.18 2004/05/02 18:44:54 nilsson Exp $ + dnl $Id: testsuite.in,v 1.19 2004/05/02 23:12:56 nilsson Exp $      test_eq([[ Image.PNM.decode("P1\n5 5\n0 1 1 1 1\n1 0 1 1 1\n"    "1 1 0 1 1\n1 1 1 0 1\n1 1 1 1 0") ]],   Image.PNM.decode("P4\n5 5\nx¸Øèð") )      test_eq([[ Image.GIF.decode(MIME.decode_base64(    "R0lGODlhBQAFAIAAAAAAAP///ywAAAAABQAFAAACCAxwEWrY8BwoADs=")) ]],   Image.PNM.decode("P4\n5 5\nx\00èØèð") )      test_true( objectp(Image.Image()) )
pike.git/src/modules/Image/testsuite.in:267:    }    return img;   ]],[[    Image.GIF.decode(MIME.decode_base64(    "R0lGODlhZABkALMAAAAAAAAyAAA8AAAoAP8oAP8yAAAo/wAy/wA8//88AP8o//8y//88/wAAAAAAAAAAACwAAAAAZABkAAME/xAAOWe1Fue8OVAKGIbhwjAniqKe17ouHMcznZEkbq7rats/IFA4nORypV6PVSw2nU4bErlb+qJRbDY7zVWtjO1WPKZ1SV9rubxmf86K9NLtpkfhcfC1XudL4XI9fX2DZoB6TISEijeHiIuLkBZ4gXuRkYSUiGGYmJmOep6efZqPo6NspaGoqGOqYK2tW69qsrJOtHO3t0O5gry8f2eVicHBHr6Wx8eToLDMzI3Dm9HRzdOm1tHJxdrB3Jzex+DizOTl38616Lfn7LLu76jx8p709ZH3+J/Yq/uY+v65CSiwDMGCs9TpYjZgQEOHDiFGjDiRIkWLFy9mJMbAgAGPH/8/hhQpkmTJkidRatS4kiVLly8HcESJkmbNmjdLxoy5kydPhzNx4hQ6dOjPn0eRUgxatGjTokqVRuXJ1KlTqyqlStWqserVq18NbN06dukmsGDRfiRLlq3Ms2nTgm3blqxXuXJr1q0r9W7evCIDBBA8eHBhw4YRJ068mDFjxwEOHJA8eXJly5YxZ868mTNnzgIEhBYtmnTp0qdRo1a9enXrAggQxJYtm3bt2rdx49a9e/du166BBw8+nLgA2L59J1eunLly48ahR48uGnnz5texY8dNnXp376itb98+njx38ODRGxdv3nz75unTxw/O3r17++fly9df/f59/77tt5/lgMf995+BtQ044H71HXggeQsumF6DDz7YnDYEEJChhhpqWEACCYAYYoghIrRIhx2i+CGJJJJoIiEppuhhiy2W+GIdMsq4Yo0u3uhGjinuyGMCPv4I5IxD2ljkGEcimeSSZTRJgJA8Qslkk1TWaOUWUmbZ4pZZdJmkkmAOIeaYZTpx5pNpmonlmES2CcSaQ8o555to2kkDnVXqGQOfWvrpAqBfCuoBoT0amgGiZCoKAKNxOjoBpJJaQGmlj+LJZqWXcqppnZh2KqmojpKqqKmGoiqoqn6yqqerdsIqp6xt0pqmrYtEAAA7"))   ]])      test_do( add_constant("img", Image.Image(100,100,0,0,0)) )   test_do( img->box(40,0,0,40) )   test_equal( img->max(), ({ 0, 0, 0 }) ) + test_equal( img->min(), ({ 0, 0, 0 }) ) + test_equal( img->sum(), ({ 0, 0, 0 }) ) + test_equal( img->sumf(), ({ 0.0, 0.0, 0.0 }) ) + test_equal( img->average(), ({ 0.0, 0.0, 0.0 }) )   test_do( img->box(10,10,20,20,128,13,42) )   test_equal( img->max(), ({ 128, 13, 42 }) ) -  + test_equal( img->min(), ({ 0, 0, 0 }) ) + test_equal( img->sum(), ({ 15488, 1573, 5082 }) ) + test_equal( (array(int))img->sumf(), ({ 15488, 1573, 5082 }) ) + test_equal( (array(int))img->average(), ({ 1, 0, 0}) )   test_do( img->setcolor(200,19,99) )   test_do( img->box(30,20,20,30) )   test_equal( img->max(), ({ 200, 19, 99 }) ) -  + test_equal( img->min(), ({ 0, 0, 0 }) ) + test_equal( img->sum(), ({ 39560, 3859, 17019 }) ) + test_equal( (array(int))img->sumf(), ({ 39560, 3859, 17019 }) ) + test_equal( (array(int))img->average(), ({ 3, 0, 1 }) )   test_do( add_constant("img") )      test_define(test_polygone,[[   test_any_equal([[    object img=Image.Image(100,100,0,0,0);    float x=0,y=0.2;    img->setcolor(255,254,253);    img->polygone(({10+x,15+y,15+x,10+y,15+x,15+y}),    ({20+x,15+y,25+x,15+y,20+x,10+y}),    ({10+x,20+y,15+x,20+y,15+x,25+y}),
pike.git/src/modules/Image/testsuite.in:331:       object img1=Image.GIF.decode(MIME.decode_base64(    "R0lGODlhZABkAMQAAAAAAAICAgUFBQoKChYWFigoKC0tLTAwMDIyMjMyMj8/P1lYWFFRUHJycXp5eYyLi6OioaWlpK2srLW0s8vLyszLytbV1Ojn5vTz8vn49/z7+v/+/QAAAAAAAAAAAAAAACwAAAAAZABkAAQF/yAAiONYmiaapivLuu8byzJd1zeO6/ve+z5gMDgkEo3HY1KpZDabTyhUOp1WrVZsNrvlcr3fb1gsJpfLZzRafWSw3Osd4bF7EOLtDCsDx6fmGBs7Gxh2fjgMGYIpG3yHAIAbG4s1k4SGjyaJkyyTjnGRlpQyopd3j5ucjJ59X6Glg6WmhwYICLYst7cGaAW6uro7wMAIBZmZx8jIysvLzc7O0GUOFBTVLNbWDmgKE9nZ1jvg4BMKhwISlp2TEgJrAw0XsrGiFw0DmeiqJuzuePDy1OGod8+Zvk7tMgHcR2qDPXzRAKBjkXAZwB0PI6bwZ4KjM4g1QGrUOJIkSZMnT+6mVKmSZcuWL2HClDlzZk2bNnHmzLmTJ0+fP38GFSqUaNGiR5EiVbp0aVOnTqFGjTqV6hdjKbBadRaBRdetywpoYKFBK9hDEUYB2PD1rB+xajeUdesnbVy2dOPAvTs3bxm7d/H6vapBIL9JfQdbARxYsOIpBxIkkMxi8uQDjx9n1qyZc+fOn0GDFj169CMI4LBlg2D6yAJR6yYtaE0kgAXDIyxZCECbyGuGa2X3rn377u7hvoELRx7EdtzjzIO87jQ7enMLLKBb91HdRPftO3inEA8efHnz5tGnT7+ePXv379/Hly+ffv369/HjPxQCADs="));    return $1;   ]],[[$2]])   ]])      test_polyfill(img-img1<16, 1)   test_polyfill(img->max(), ({255,254,253}) )    + // Image.Image operations +  + test_do([[ add_constant("img", lambda(void|int x,void|int y) { +  return Image.Image(x||50,y||50,0,0,0,)->test(); + }) ]]) +  + test_do( img()->apply_curve( enumerate(256,-1,255) ) ) + test_do( img()->apply_curve( "red", enumerate(256,-1,255) ) ) + test_do( img()->apply_curve( "green", enumerate(256,-1,255) ) ) + test_do( img()->apply_curve( "blue", enumerate(256,-1,255) ) ) + test_do( img()->apply_curve( "value", enumerate(256,-1,255) ) ) + test_do( img()->apply_curve( "saturation", enumerate(256,-1,255) ) ) + test_do( img()->apply_curve( "hue", enumerate(256,-1,255) ) ) + test_eval_error( img()->apply_curve( "bar", enumerate(256,-1,255) ) ) +  + test_do([[ img()->apply_matrix( ({ ({-1,-1,-1}), ({-1,16,-1}), +  ({-1,-1,-1}) }) ) ]]) + test_do([[ img()->apply_matrix( ({ ({1,1,1}), ({1,-8,1}), +  ({1,1,1}) }) ) ]]) + test_do([[ img()->apply_matrix( ({ ({0,0,0}), ({1,-2,1}), +  ({0,0,0}) }) ) ]]) + test_do([[ img()->apply_matrix( ({ ({2,1,0}), ({1,0,-1}), +  ({0,-1,-2}) }), 128, 128, 128, 3.0 ) ]]) +  + // MISSING_TEST: apply_max +  + // autocrop tests above +  + // average tests above +  + test_do( img()->bitscale(0.75) ) + test_do( img()->bitscale(1.3, 0.6) ) + test_do( img()->bitscale(47, 11) ) + test_do( img()->bitscale(99, 0) ) + test_do( img()->bitscale(0, 99) ) +  + test_do( img()->blur(0) ) + test_do( img()->blur(1) ) + test_do( img()->blur(5) ) +  + test_do( img(100,100)->box(40,10,10,80) ) + test_do( img(100,100)->box(40,10,10,80,0,255,0) ) + test_do( img(100,100)->box(40,10,10,80,255,0,0,75) ) +  + test_do( (string)img() ) + test_do( (array)img() ) +  + test_do( img()->change_color(255,255,255) ) + test_do( img()->change_color(1,2,3,10,20,30) ) +  + test_do( img(100,100)->circle(50,50,30,50) ) + test_do( img(100,100)->circle(50,50,30,50,0,255,255) ) + test_do( img(100,100)->circle(50,50,30,50,0,255,255,75) ) +  + test_do( img()->clear() ) + test_do( img()->clear(0,128,255) ) + test_do( img()->clear(0,128,255,66) ) +  + test_do( img()->clone() ) + test_do( img()->clone(20,20) ) + test_do( img()->clone(100,100) ) + test_do( img()->clone(100,100,27,55,111) ) + test_do( img()->clone(99,99,66,33,22,11) ) +  + test_do( img()->color() ) + test_do( img()->color(69) ) + test_do( img()->color(128,128,255) ) +  + test_do( img()->copy() ) + test_do( img()->copy(5,5,45,45) ) + test_do( img()->copy(-5,-5,55,55) ) + test_do( img()->copy(-5,-5,55,55,255,0,0) ) + test_do( img()->copy(-5,-5,55,55,255,0,0,99) ) +  + test_do( Image.Image() ) + test_do( Image.Image(100,100) ) + test_do( Image.Image(100,100, Image.Color("red")) ) + test_do( Image.Image(100,100, "red") ) + test_do( Image.Image(100,100, "grey", 128) ) + test_do( Image.Image(100,100, "rgb", 11,22,33) ) + test_do( Image.Image(100,100, "cmyk", 10,20,30,40) ) + test_do( Image.Image(100,100, "test") ) + test_do( Image.Image(100,100, "gradients") ) + test_do( Image.Image(100,100, "noise", +  ({0, ({0,0,0}), 0.8, ({255,255,255}) }) ) ) + test_do( Image.Image(100,100, "turbulence", +  ({0, ({0,0,0}), 0.8, ({255,255,255}) }) ) ) + test_do( Image.Image(100,100, "random") ) + test_do( Image.Image(100,100, "randomgrey") ) + test_do( Image.Image(100,100, "tuned_box", +  ({ Image.Color.black, Image.Color.black, +  Image.Color.white, Image.Color.white}) ) ) + test_eval_error( Image.Image(100,100, "bacon") ) + test_do( Image.Image(100,100, 255,255,0) ) + dnl test_do( Image.Image(100,100, 255,255,0,40) ) +  + test_do( img()->dct(100,100) ) +  + test_do( img()->distancesq() ) + test_do( img()->distancesq(0,255,255) ) +  + // find_autocrp above +  + // MISSING TEST: find_max + // MISSING TEST: find_min +  + test_do( img()->gamma(0.8) ) + test_do( img()->gamma(0.9, 0.8, 1.1) ) +  + // MISSING TEST: get_pixel +  +  +  + // max tests above + // min tests above + // sum tests above + // sumf tests above +  + test_do( add_constant("img") ) +  +  +    test_true( objectp(Image.Font()) )   test_eq( Image.Font()->write("hej"),    Image.PNM.decode(MIME.decode_base64("UDQKMTkgMTEK///gv/7gv//grzjglt7gth7gtv7gtv7gtx7g//7g//Hg")) )   test_eq( Image.Font()->write("h","o"),    Image.PNM.decode(MIME.decode_base64("UDQKNyAyMwr+vr6ulra2trb+/v7+/s62tra2zv7+/g==")) )      define(test_blackwhite,[[    test_equal_any($1,[[ (< Image.Color.white, Image.Color.black >) ]])   ]])   test_blackwhite([[