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

version» Context lines:

pike.git/src/modules/Image/testsuite.in:149:   Image.image(10,10,0,0,0)   ->setpixel(5,5,17,42,36)->max() ))   return ( "erranous (3)" );   if (!equal( ({17,42,36}),   Image.image(10,10,0,0,0)   ->setpixel(2,2,1,2,3)   ->setpixel(3,3,17,42,36)   ->setpixel(4,4,3,2,1)   ->max()))   return ( "erranous (4)" ); + if (!equal( ({17,42,36}), + Image.image(10,10,0,0,0) + ->setpixel(2,2,17,2,3) + ->setpixel(3,3,2,42,5) + ->setpixel(4,4,3,2,36) + ->max())) + return ( "erranous (5)" );   return "ok";         ]], "ok")   test_any([[# 1 "-"       - #127 "testsuite.in.in" + #134 "testsuite.in.in"   object img=Image.image(10,10,255,0,0);   if (!equal(img->getpixel(5,5),({255,0,0}))) return ( "getpixel erranous" );   img->setpixel(5,5,1,2,3);   if (!equal(img->getpixel(5,5),({1,2,3}))) return ( "failed" );   return "ok";      ]], "ok")   test_any([[# 1 "-"       - #134 "testsuite.in.in" + #141 "testsuite.in.in"   object img=Image.image(10,10,255,0,0);   img->setpixel(5,5,0,255,0,127);   if (!equal(img->getpixel(5,5),({127,128,0}))) return ( "failed" );   return "ok";      ]], "ok")   test_any([[# 1 "-"       - #140 "testsuite.in.in" + #147 "testsuite.in.in"   object img=Image.image(100,100,0,0,0);   foreach (({40,50,60}),int z)   {   img->line(50-z,0,50,50,255,255,255);   img->line(50-z,100,50,50,255,255,255); - img->line(0,50-z,50,50,255,255,255); + img->line(100,50+z,50,50,255,255,255);   img->line(100,50-z,50,50,255,255,255);   }   object img1=Image.GIF.decode(MIME.decode_base64( - "R0lGODlhZABkAIAAAAAAAP///ywAAAAAZABkAAAC/wxwCGaq/l6UktZ6Mdat9sdsmziOpWl6WPMp\r\nYZrCcTxLLfLdi07Tve9brFQeXjB4RIKGQ5tQqYRGccTN7TWdZlPXWNeo1Wq7zqoLLBYjyWZXUa1W\r\ns526Kzoeby5H2L37npfn5kcUEGDY1icoqEe10qL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ttTt3X561YqVmtVa0L2ezooxTDgM4sNVE2tZ/Njl25Ysh/zNF7SgzcsMP6qzzPkWxJEUQ4caHU4gWtQJVXM9+E7lPtOq6g38RxNhaJO0u7oeSFCn7mUc+07t1ft3zLTI23Fcfk0cZmXJg8cmTp02N5K5OEctN/3d33LVWXT3Rv0nbuM3a5XvmQv6r2+A47ME/35+zHmR8rdPj82eeM2ox45k/a1WoHwHrgWeLlYhwmCC31ni32cJWkYhYdM4yAqCEmboGDTdTBGiiPB1eNeGy1UIXHwrljjLNCxi9UYfMAZkiI034hhIAQA7"));   if (img!=img1) return ( "differ" );   return "ok";      ]], "ok")   test_any([[# 1 "-"       - #154 "testsuite.in.in" + #161 "testsuite.in.in"   object img=Image.image(100,100,0,0,0);   img->line(40,0,0,40);   if (!equal( ({0,0,0}), img->max() )) return ( "differ (reset)" );   img->line(10,10,20,20,128,13,42);   if (!equal( ({128,13,42}), img->max() )) return ( "differ (direct)" );   img->setcolor(200,19,99);   img->line(30,20,20,30);   if (!equal( ({200,19,99}), img->max() )) return ( "differ (setcolor)" );   return "ok";    -  + ]], "ok") + test_any([[# 1 "-"    -  +  + #172 "testsuite.in.in" + object img=Image.image(100,100,0,0,0); + foreach (({40,60,50}),int z) + { + img->box(z,0,50,50,255,z,255); + img->box(z,100,50,50,255,z,0); + img->box(100,z,50,50,0,z,255); + img->box(0,z,50,50,0,z,0); + } + object img1=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")); + if (img!=img1) return ( "differ" ); + return "ok"; +    ]], "ok") -  + test_any([[# 1 "-" +  +  + #186 "testsuite.in.in" + object img=Image.image(100,100,0,0,0); + img->box(40,0,0,40); + if (!equal( ({0,0,0}), img->max() )) return ( "differ (reset)" ); + img->box(10,10,20,20,128,13,42); + if (!equal( ({128,13,42}), img->max() )) return ( "differ (direct)" ); + img->setcolor(200,19,99); + img->box(30,20,20,30); + if (!equal( ({200,19,99}), img->max() )) return ( "differ (setcolor)" ); + return "ok"; +  +  + ]], "ok") + test_any([[# 1 "-" +  +  + #200 "testsuite.in.in" + 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}), + ({20+x,25+y,25+x,20+y,20+x,20+y}), +  + ({30+2*10+x,15+y,30+2*15+x,10+y,30+2*15+x,15+y}), + ({30+2*20+x,15+y,30+2*25+x,15+y,30+2*20+x,10+y}), + ({30+2*10+x,20+y,30+2*15+x,20+y,30+2*15+x,25+y}), + ({30+2*20+x,25+y,30+2*25+x,20+y,30+2*20+x,20+y}), +  + ({10+x,30+2*15+y,15+x,30+2*10+y,15+x,30+2*15+y}), + ({20+x,30+2*15+y,25+x,30+2*15+y,20+x,30+2*10+y}), + ({10+x,30+2*20+y,15+x,30+2*20+y,15+x,30+2*25+y}), + ({20+x,30+2*25+y,25+x,30+2*20+y,20+x,30+2*20+y})); +  + 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=")); + if (img-img1>16) return ( "differ too much" ); + if (!equal(img->max(),({255,254,253}))) return ( "wrong maxcolor" ); + return "ok"; +  + ]], "ok") + test_any([[# 1 "-" +  +  + #225 "testsuite.in.in" + object img=Image.image(100,100,0,0,0); + float x=-0.2,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}), + ({20+x,25+y,25+x,20+y,20+x,20+y}), +  + ({30+2*10+x,15+y,30+2*15+x,10+y,30+2*15+x,15+y}), + ({30+2*20+x,15+y,30+2*25+x,15+y,30+2*20+x,10+y}), + ({30+2*10+x,20+y,30+2*15+x,20+y,30+2*15+x,25+y}), + ({30+2*20+x,25+y,30+2*25+x,20+y,30+2*20+x,20+y}), +  + ({10+x,30+2*15+y,15+x,30+2*10+y,15+x,30+2*15+y}), + ({20+x,30+2*15+y,25+x,30+2*15+y,20+x,30+2*10+y}), + ({10+x,30+2*20+y,15+x,30+2*20+y,15+x,30+2*25+y}), + ({20+x,30+2*25+y,25+x,30+2*20+y,20+x,30+2*20+y})); +  + object img1=Image.GIF.decode(MIME.decode_base64( + "R0lGODlhZABkANUAAAAAAAICAgUFBQcHBwoKChQUFBYWFh4eHiMjIyYmJS0tLTAwMDMyMigoKFFRUFlYWHp5eX9+fnJycYyLi56dnDIyMqOioaWlpMHBwMvLyszLytHQz9bV1Orp6Ojn5vTz8vz7+v/+/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAZABkAAUG/0AAQDgcFo1GZDK5ZDKdz2dUKqVWq1csVrvddr1ecDg8JpPN53NarWa32284XD6f1+12fD6/5/P9f3+BgoKEhYVqAkmKiGQEWAMBjW0FFEkMEZNYBhMYWBUcD5KaWwUbGZchmaRGnB8hqFUVISGho6xJprCpqqyutLuywLWiuEO6wUMMwKuIv8OxUrPDxLeTAhQZGRkWSQ3b2w6FAQ8Y4ODcWN/o4BYNxsbw8fHz9PT29/f5ggIMDP7vjBD49w/BuAUECf4LKGWgQoUHWEUAFg3AMlodFCBqcAEEtWRPplHzIOGRRFoVL2bUxNEjxU8jS9KbmDLESlYtUcKkRdLkvf8IKW8aa1mRyaye+pKIM4JAo74GELAkkJk0aVWrVrFmzbqVK1evX7+GFSuWbNmyZ9GiVbt2bVu3buHGjTuXLl27d+/m1auXb9++fwEDFjx4cGHDhvlYs5b43oMkCxg2jmfAkxEGFybfm5AShGTNmgx8qJkZNKsJIJd5Nh36Vc0QpVkjQp2a1mrZgkTrvAwsNu48tGvb/vxbDQFz27oZWbctavHiz6FDlz59enXr1rFnz152QIUK3yUTAA8+AfczATi85A1MwvkzD9YrA+bB5/st6XfPp+X+Ppn4wtXnHxn5vdbfgGHEV5OACIaRXk0HNujFAykxKKEXASinTIQXbiEk2QH2ddihiCOOWKKJJqKYYoorssiiiy++GKOMMtJYY4034hYEADs=")); + if (img-img1>16) return ( "differ too much" ); + if (!equal(img->max(),({255,254,253}))) return ( "wrong maxcolor" ); + return "ok"; +  +  + ]], "ok") + test_any([[# 1 "-" +  +  + #251 "testsuite.in.in" + object img=Image.image(100,100,0,0,0); + int i; +  + array a=({}),b=({}); + foreach (({0,1,2,3,4}),i) + { + a+=({ 50+50*sin(i*2*3.1415926535/5+0.11), + 50+50*cos(i*2*3.1415926535/5+0.11) }); + a+=({ 50+19*sin((i+0.5)*2*3.1415926535/5+0.11), + 50+19*cos((i+0.5)*2*3.1415926535/5+0.11) }); + b+=({ 50+19*sin(i*2*3.1415926535/5+0.1), + 50+19*cos(i*2*3.1415926535/5+0.1) }); + b+=({ 50+0.5*5*sin((i+0.5)*2*3.1415926535/5+0.1), + 50+0.5*5*cos((i+0.5)*2*3.1415926535/5+0.1) }); + } +  + img->setcolor(128,0,16); + img->polyfill(a,b); +  + a=({}),b=({}); + foreach (({0,1,2,3,4,5,6}),i) + { + a+=({ 50+50*sin(i*2*3.1415926535/7+0.11), + 50+50*cos(i*2*3.1415926535/7+0.11) }); + a+=({ 50+19*sin((i+0.5)*2*3.1415926535/7+0.11), + 50+19*cos((i+0.5)*2*3.1415926535/7+0.11) }); + b+=({ 50+0.9*50*sin(i*2*3.1415926535/7+0.1), + 50+0.9*50*cos(i*2*3.1415926535/7+0.1) }); + b+=({ 50+0.5*19*sin((i+0.5)*2*3.1415926535/7+0.1), + 50+0.5*19*cos((i+0.5)*2*3.1415926535/7+0.1) }); + } +  + img->setcolor(255,128,0); + img->polyfill(a,b); +  + object img1=Image.GIF.decode(MIME.decode_base64( + "R0lGODlhZABkAPcAAAAAAAEAAAIAAAMAAAMBAAQAAAUAAAYAAAQCAAUCAAYDAAIBAAcAAAcDAAgEAAgAAQkAAQoAAQsAAQwAAAwAAQkDAAkEAAoFAAsFAAwGAA0AARAAAhEAAhIAAhQAAg8AARUAAhYAAhcAARcAAhgAAxoAAxsAAw0GAA4HAA8HABAIABEIABIJABMKABMJABYLABQKABgMABkMABkNABoNABsNAA4AARwAAx0AAx4AAyEABCIABB8AAyIIASAABCQABCUABCYABCcABCkABSgABSoABSsABSwABS0ABSwBBC4ABTAABi8ABTEABjIABjMABjYABjUABjgABzkABzoABzoBBjsABzwABz0ABz4ABx0PAB0OAB4PAB8PACEOACEQACIRACMRACAQACQSACUSACcMACgMASYTACgTACgUACk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j3R2EmhICMF4EhQSBtmxDwrQki9uYRaiEJA4USKbQCzvh5Mh4QF2EYNJgQDfAA5q8SNCSRJKAApKABjFkA1q0XFNiRGBoBWAQQf2AGrBcJUh8RGioQ1+ooxgKSWfsB82eJZp8gL44A+sx5Zp4gwoKZeBYgmzYZdpogD9qJdpEmYJExAAOw==")); +  + if (img-img1>16) return ( "differ too much" ); +  +  +  + return "ok"; +  +  + ]], "ok") + test_any([[# 1 "-" +  +  + #297 "testsuite.in.in" + int i; + array a=({}); + foreach (({0,1,2,3,4}),i) + { + a+=({ 50+50*sin(i*2*3.1415926535/5+0.11), + 50+50*cos(i*2*3.1415926535/5+0.11) }); + a+=({ 50+20*sin((i+0.5)*2*3.1415926535/5+0.11), + 50+20*cos((i+0.5)*2*3.1415926535/5+0.11) }); + } +  + object img=Image.image(100,100,0,0,0); + img->setcolor(128,0,16); + img->polyfill(a); +  + object img1=Image.GIF.decode(MIME.decode_base64( + "R0lGODlhZABkAOYAAAAAAAIAAAEAAAQAAAUAAAYAAAMAAAgAAQkAAQoAAQsAAQwAAQ0AAQ4AAQ8AAQcAABAAAhEAAhIAAhMAAhUAAhQAAhYAAhcAAhgAAxkAAxoAAxsAAxwAAx0AAx4AAx8AAyAABCEABCIABCMABCQABCUABCYABCcABCgABSkABSoABSsABSwABS0ABS4ABS8ABTAABjEABjIABjMABjQABjUABjYABjcABjgABzkABzoABzsABzwABz0ABz4ABz8AB0AACEMACEIACEYACEcACEgACUkACUoACUsACUwACU0ACU4ACU8ACVAAClIAClEAClMAClUAClgAC1cAClkAC1YAClsAC1wAC10AC14AC18AC2AADGEADGIADGMADGQADGUADGYADGcADGgADWkADWoADWsADWwADW0ADW4ADW8ADXAADnEADnMADnQADnUADnIADncADngAD3kAD3YADnoAD3sAD3wAD0EACH0AD38AD34AD4AAEAAAAAAAAAAAACwAAAAAZABkAAYH/4AAAIKDg4WGhoiJiYuMjI6Pj5GSkpSVlZeYmJqbm52enqChoaOkpKanp6mqqqytra+wsL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LBvVfpwUDVsEDRlxpcwxLdWE6EDQtMV9VgdisdnFkNBmu3ol1Mc9gadygj+ITF3a2AERMQfKuSQkwqBn6KGQjtQbDhpBi8zxiMnxLAUtUgEfkpJsPT1OWhrAzPkZyHEjMfbYROis3VVGE6KTzzkcPqoSAgJGywb0KEHTjWjgkDM+nuCQVzBQIAOw==")); +  + if (img-img1>16) return ( "differ too much" ); + if (!equal(img->max(),({128,0,16}))) + return ( "wrong maxcolor ("+img->max()[0]+","+img->max()[1]+","+img->max()[2]+")" ); + return "ok"; +  + ]], "ok")