From 5b5008e7c7759d67805f65c20ba3aef043e16b37 Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Sat, 2 Nov 2024 09:14:16 -0400 Subject: [PATCH] Add more shape visual tests --- test/unit/visual/cases/shapes.js | 52 ++++++++++++++++++ .../2D mode/Drawing with lines/000.png | Bin 0 -> 387 bytes .../2D mode/Drawing with lines/metadata.json | 3 + .../2D mode/Drawing with points/000.png | Bin 0 -> 491 bytes .../2D mode/Drawing with points/metadata.json | 3 + .../2D mode/Drawing with quads/000.png | Bin 0 -> 325 bytes .../2D mode/Drawing with quads/metadata.json | 3 + .../2D mode/Drawing with triangles/000.png | Bin 0 -> 671 bytes .../Drawing with triangles/metadata.json | 3 + .../WebGL mode/Drawing with lines/000.png | Bin 0 -> 425 bytes .../Drawing with lines/metadata.json | 3 + .../WebGL mode/Drawing with points/000.png | Bin 0 -> 280 bytes .../Drawing with points/metadata.json | 3 + .../WebGL mode/Drawing with quads/000.png | Bin 0 -> 315 bytes .../Drawing with quads/metadata.json | 3 + .../WebGL mode/Drawing with triangles/000.png | Bin 0 -> 687 bytes .../Drawing with triangles/metadata.json | 3 + 17 files changed, 76 insertions(+) create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with lines/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with lines/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with points/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with points/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with quads/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with quads/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with triangles/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with triangles/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with lines/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with lines/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with points/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with points/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with quads/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with quads/metadata.json create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with triangles/000.png create mode 100644 test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with triangles/metadata.json diff --git a/test/unit/visual/cases/shapes.js b/test/unit/visual/cases/shapes.js index c8b37c874b..208a9cbfe6 100644 --- a/test/unit/visual/cases/shapes.js +++ b/test/unit/visual/cases/shapes.js @@ -168,6 +168,58 @@ visualSuite('Shape drawing', function() { screenshot(); }); + visualTest('Drawing with points', function(p5, screenshot) { + setup(p5); + p5.strokeWeight(5); + p5.beginShape(p5.POINTS); + p5.vertex(10, 10); + p5.vertex(15, 40); + p5.vertex(40, 35); + p5.vertex(25, 15); + p5.vertex(15, 25); + p5.endShape(); + screenshot(); + }); + + visualTest('Drawing with lines', function(p5, screenshot) { + setup(p5); + p5.beginShape(p5.LINES); + p5.vertex(10, 10); + p5.vertex(15, 40); + p5.vertex(40, 35); + p5.vertex(25, 15); + p5.endShape(); + screenshot(); + }); + + visualTest('Drawing with triangles', function(p5, screenshot) { + setup(p5); + p5.beginShape(p5.TRIANGLES); + p5.vertex(10, 10); + p5.vertex(15, 40); + p5.vertex(40, 35); + p5.vertex(25, 15); + p5.vertex(15, 25); + p5.vertex(10, 10); + p5.endShape(); + screenshot(); + }); + + visualTest('Drawing with quads', function(p5, screenshot) { + setup(p5); + p5.beginShape(p5.QUADS); + p5.vertex(10, 10); + p5.vertex(15, 10); + p5.vertex(15, 15); + p5.vertex(10, 15); + p5.vertex(25, 25); + p5.vertex(30, 25); + p5.vertex(30, 30); + p5.vertex(25, 30); + p5.endShape(); + screenshot(); + }); + if (mode === 'WebGL') { visualTest('3D vertex coordinates', function(p5, screenshot) { setup(p5); diff --git a/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with lines/000.png b/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with lines/000.png new file mode 100644 index 0000000000000000000000000000000000000000..a48c6dc9fe035983824befbabd4d1bd8a11be65b GIT binary patch literal 387 zcmV-}0et?6P)Px$JxN4CRA@u(mN5>6FbqS>m6$jX69;1AK%KbK|LTB*(3hy)xJ3MPr44;{92j!W zpY(z?1c);i!x3kOq;Mo05h)O@B@&h{Tjj{U?`hk%w5}`tBK5)l0x4=v)0A?~YGLX6 zRgSz0WLcIp&vP2bkycH4u-Xw8q}QOR25GranRsOtM^&o}NV&WkrW(W|@N9e5xY!k> zr9JOpAP@^hRV~&XM3ol^#IiLk+&#D3V<48I6d(x1Vsf2Tw9Lz+AeMQ7L9Bbbz*y9D z0b-FC7{ubGzdmlQd2s{Mnim+vdU9ReVe{e+gl%04gjMbC$M1N~Px$rAb6VRA@u(m7&stKoG~*<~xub3I>v9-ok*1A`D~q0qhI|6q5wrf((fOg)#dM zG{3oIKXZni z{M$4QwV`1cLT5|ZJ3=6Cw;PmYNkMkI9XO673`Q78mSqqGL2oIX&u2Is4nh`%0%5gv zG1hu7imxAbmSUei7d9iGE|hhj0%3Is`+Sljm@hVOLq>yOuT^0n*e|vMVRc|J*1~?V zS&e<4j~;g3i?QPr2zJL=`II884$VD(KA({1IlacREYLJ<@JcBaDT)G;B!RYVY4N(Q z!|8N_{eJ&1jFcd0nnDysy`nwO1KYM0$Xu&W`X9|&B+=vXpha#rn?dhRA^`y5!%h-h zE|=aQUawc?R+$RK``_qcpE8KN#mtHOU693Ci^z{L>|<><+FD~1V8tsCtWNXhQHt<( h3M)=2g4Jo>Jby#>c|e~L*_Z$T002ovPDHLkV1j#<(Ek7c literal 0 HcmV?d00001 diff --git a/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with points/metadata.json b/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with points/metadata.json new file mode 100644 index 0000000000..2d4bfe30da --- /dev/null +++ b/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with points/metadata.json @@ -0,0 +1,3 @@ +{ + "numScreenshots": 1 +} \ No newline at end of file diff --git a/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with quads/000.png b/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with quads/000.png new file mode 100644 index 0000000000000000000000000000000000000000..18b521de2ace7fee297f9de9799cc393411ff115 GIT binary patch literal 325 zcmV-L0lNN)P)Px#|4BqaRA@u(m$41SAPhvEJyK=@Cde?^Bg!5OLrKL1l-c8drAhItlfWm$KO{P1 zbN37hOV0UY6O2Vd2BRnNM; zZJQm(F@g^4)_R1j>uTqDzMHqVruqpkVeiLgGV?m}2k0E!UC52u8nhm-XvqYz;{0o;X5b8De3*c#_f zq;-SndI>?DV#SFF%W1TZh@eif;zWeyG+IYQP^VaNBEoVSts^3+Q>-`Px%SxH1eRA@u(mpzWcFc5_&EmxtVK$OsN2|6kY4uFJ!3Q^E<1PU5zDnL*m3XZ@b z=#Y@IdX{FD&4$F|pAhZZ4H62@e1319hv;&-#PkPN6hJDbVo;=Ff>2N-DB|e^{+G1| zg8?-f4eIy%p3c*LTP;Oyw;KTli(#q;B?5`#m}avXJ)cjS&*znb(gJ}J-ENn*+by-* z?Qb7c2}&EJ)oLk-{eGWm=ubmwgA9j5x?ZmYdljuuKxu=Z+3)xJFMH)d9S#TTbUL(J ztyJpyT-qRw$;#2}np zrXUREIt0WZoLuk5c}X<63;`n$PA*B&@1AuP0%DM4a=8G(9xh-i0RkA?Nx%riHo5YY zGz|eG5Ld~S*EiBhzzD=;a=nA$$w7C5HU@E-Ts$R=$798Xf1%B0lU}cvnw)j!Gb0e2 zM1Gk5?1002ovPDHLk FV1nF^A}as@ literal 0 HcmV?d00001 diff --git a/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with triangles/metadata.json b/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with triangles/metadata.json new file mode 100644 index 0000000000..2d4bfe30da --- /dev/null +++ b/test/unit/visual/screenshots/Shape drawing/2D mode/Drawing with triangles/metadata.json @@ -0,0 +1,3 @@ +{ + "numScreenshots": 1 +} \ No newline at end of file diff --git a/test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with lines/000.png b/test/unit/visual/screenshots/Shape drawing/WebGL mode/Drawing with lines/000.png new file mode 100644 index 0000000000000000000000000000000000000000..aaadb8a3259e4ece7b251c2dc3a3e3e2356da1f1 GIT binary patch literal 425 zcmV;a0apHrP)Px$V@X6oRA@u(m@y87Fbo9YOH@3FiU(2gpj3S6PDVnCsJt8R5ph20y2NI@_69PR zQa-~Aeq(}kreZ46nIJ`WFo?o&BIczFkcbw8K_Z>&-eN6k!ywVl6*Vv2 zfw1#Jfhe4-^?ac~T6)?0v4rO67UY^myMpq3?^7U3=c*M$E-fe!wR3sfkA97>H}-a6 zM=PRsE>sm71a%ek!O-Px#(n&-?RA@u(nK2TBFbo9YSN?ycUxk*W!8&sqO}x~S<=Zv5;EagR@dwXIkY*M! z(oD#K5sa7!JRYqv#@FbGFl}XRS%R$bd%t@hBk!~GtoUeTWo+e#f*>=dFfv2wr^b4; zg#E}Z1d-918Zlx5D=)jZk;?mFR*__cAhURdy1k7E!0auO5&N!$0R$1CSz9n-#Vah{ z)=2i!C5T`@)q;@}u7<_ZJCfC2k((fQ${qfh>}{mt%x7mvMzTXH>IqUoIWq$z8Cn&! e7^$F~nQ;N?WaBaa3*rU<0000Px#^+`lQRA@u(m$40nFc3qJJyJ4AhGCD0Js2ishDgaC|0@m6m%f4=pHMJ0c4WT` z=$2B-$0m3d1$h`n5qTI86A=+1HSoUCI*#L~%Wd08{oc3jBGN+CS}n$Sose_3bzSW# zVY-8a5Gr)#im%q_d1m-^-4VvYqdgU5bfc)Bh@cIQ z){DsKMo~W(A|5|edJwM_z$J*s3ZNjpm$Qx5G(Px%X-PyuRA@u(m_3RDK@f#&?%@H93=G6X(3=<-8F&LxLsJ7IV~-#hsVF!Ycmgk? z2rjReT6%}k?Vswgai>8TwXLbIU)Ae&k~B>p^Z_F&K_XMJR3tJ%s8pm>B+v@{ztTFN z&s4A11FffjSR+Liiv{6@(P%WN+wDdNWds5>`u#q&+ieANzu)O_I79_y1cKz7%_fb< zW7=-F3TCs}sO#Zy7zLCy$Y?a8$z-A+aLp>c8_F1DFc{G3bfU-O`>+fcC)PhMH~(yf>+xLU0i0^<#$E0Nt#K-_Az=ytnN=)J@Wgq>@@ z-&2w#YBNL$z7xm@Uaz5c3cpYky3 z>L-(&6+t|}xYo2!(xQq;C*m8=OA+6jOa8tDkz7rQSfwHot0)