From eafc282efd9d32840ce3c1f045736af5d3f4fcb9 Mon Sep 17 00:00:00 2001 From: numzero Date: Sat, 30 Sep 2023 21:26:08 +0300 Subject: [PATCH] Add unit tests for image loaders --- test/CMakeLists.txt | 31 ++++++ test/data/sample_16bpp_v3.bmp | Bin 0 -> 654 bytes test/data/sample_16bpp_v7.bmp | Bin 0 -> 738 bytes test/data/sample_24bpp.png | Bin 0 -> 580 bytes test/data/sample_24bpp_down.tga | Bin 0 -> 899 bytes test/data/sample_24bpp_rle_down.tga | Bin 0 -> 844 bytes test/data/sample_24bpp_rle_up.tga | Bin 0 -> 844 bytes test/data/sample_24bpp_up.tga | Bin 0 -> 899 bytes test/data/sample_24bpp_v3.bmp | Bin 0 -> 954 bytes test/data/sample_24bpp_v7.bmp | Bin 0 -> 1038 bytes test/data/sample_4bpp_v3.bmp | Bin 0 -> 298 bytes test/data/sample_8bpp.png | Bin 0 -> 346 bytes test/data/sample_8bpp_down.tga | Bin 0 -> 419 bytes test/data/sample_8bpp_rle_down.tga | Bin 0 -> 444 bytes test/data/sample_8bpp_rle_up.tga | Bin 0 -> 444 bytes test/data/sample_8bpp_up.tga | Bin 0 -> 419 bytes test/data/sample_8bpp_v3.bmp | Bin 0 -> 474 bytes test/data/sample_8bpp_v3_rle.bmp | Bin 0 -> 524 bytes test/data/sample_8bpp_v7.bmp | Bin 0 -> 558 bytes test/data/sample_8bpp_v7_rle.bmp | Bin 0 -> 608 bytes test/image_loader_test.cpp | 160 ++++++++++++++++++++++++++++ 21 files changed, 191 insertions(+) create mode 100644 test/data/sample_16bpp_v3.bmp create mode 100644 test/data/sample_16bpp_v7.bmp create mode 100644 test/data/sample_24bpp.png create mode 100644 test/data/sample_24bpp_down.tga create mode 100644 test/data/sample_24bpp_rle_down.tga create mode 100644 test/data/sample_24bpp_rle_up.tga create mode 100644 test/data/sample_24bpp_up.tga create mode 100644 test/data/sample_24bpp_v3.bmp create mode 100644 test/data/sample_24bpp_v7.bmp create mode 100644 test/data/sample_4bpp_v3.bmp create mode 100644 test/data/sample_8bpp.png create mode 100644 test/data/sample_8bpp_down.tga create mode 100644 test/data/sample_8bpp_rle_down.tga create mode 100644 test/data/sample_8bpp_rle_up.tga create mode 100644 test/data/sample_8bpp_up.tga create mode 100644 test/data/sample_8bpp_v3.bmp create mode 100644 test/data/sample_8bpp_v3_rle.bmp create mode 100644 test/data/sample_8bpp_v7.bmp create mode 100644 test/data/sample_8bpp_v7_rle.bmp create mode 100644 test/image_loader_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 681e06d4c..6518f69c1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1 +1,32 @@ link_libraries(IrrlichtMt::IrrlichtMt) +add_executable(image_loader_test image_loader_test.cpp) + +function(test_image_loader format expected input) + string(TOLOWER ${format} suffix) + add_test(NAME ImageLoader${format}-${input} COMMAND image_loader_test ${expected} data/sample_${input}.${suffix} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endfunction() + +test_image_loader(BMP 16color-16bpp 4bpp_v3) +# test_image_loader(BMP 16color-16bpp 4bpp_v7) +# test_image_loader(BMP 16color-16bpp 4bpp_v3_rle) +# test_image_loader(BMP 16color-16bpp 4bpp_v7_rle) +test_image_loader(BMP 30color-16bpp 8bpp_v3) +# test_image_loader(BMP 30color-16bpp 8bpp_v7) +test_image_loader(BMP 30color-16bpp 8bpp_v3_rle) +# test_image_loader(BMP 30color-16bpp 8bpp_v7_rle) +# test_image_loader(BMP 30color-16bpp 16bpp_v3) +# test_image_loader(BMP 30color-16bpp 16bpp_v7) +test_image_loader(BMP 30color-24bpp 24bpp_v3) +test_image_loader(BMP 30color-24bpp 24bpp_v7) + +test_image_loader(PNG 30color-24bpp 8bpp) +test_image_loader(PNG 30color-24bpp 24bpp) + +test_image_loader(TGA 30color-32bpp 8bpp_up) +test_image_loader(TGA 30color-32bpp 8bpp_down) +# test_image_loader(TGA 30color-16bpp 8bpp_rle_up) +# test_image_loader(TGA 30color-16bpp 8bpp_rle_down) +test_image_loader(TGA 30color-24bpp 24bpp_up) +test_image_loader(TGA 30color-24bpp 24bpp_down) +test_image_loader(TGA 30color-24bpp 24bpp_rle_up) +test_image_loader(TGA 30color-24bpp 24bpp_rle_down) diff --git a/test/data/sample_16bpp_v3.bmp b/test/data/sample_16bpp_v3.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4b6fbcf501a0fb43d42dc6ab2d6a2b67acb8a0e0 GIT binary patch literal 654 zcmZ{iF=~ZC5QaCoKmq~VEz+b)nc~4)!OkL<5*B3Om6mqy%FHdEC$SVyky^+_HZ!|f zw28}1p&$Ru|F6~O&!dXZ2lqFw7p^C+2ldQdsW1Ni`kpGj;HIs%We={y2|bQD{zEDi>Xk$h2^`XdhGq;dDQ^AUlO+ocbJxVJk@Kh{C$n3hIGLY0B+)aZ z`HZZ$;64-{ZlVW`aHUyE6cg96-pI^8EV%V#TQ5}RLanVK@uGP{&z!hkFma`UN+~j> z3AK=Af4H7wK84Tu2nSWT3YT&Ocg|7VNRmoz7cxlfz-kIEIB@&0^^&(Zfac)XK~iLP zAHZ$>#LS4$95*9+NMvMkaGC4=IH(p(J7z8_My}*EI@S`sv?9vxe z@1!`+QmDlVBY*sN|1X!XKev#cPuY8^N2zOc;by*8^p)uvh}HEo|H>Su~65W6Eb0=6saHGH#U1IikPLQQc^g z0OOi1u{dysqmLf_)Q*kjtq!nSIB}2_g`HaTW77-M5mw91s2(v}?Hv8g)n^XNf%1$q vmlP9MNE)?hsorwe%8hGHR}|A^;(4!RAS`8Un{Os_%1S!P^^(r@-vjUq7yl1M literal 0 HcmV?d00001 diff --git a/test/data/sample_24bpp.png b/test/data/sample_24bpp.png new file mode 100644 index 0000000000000000000000000000000000000000..d38f5989c712b9edb7992dd8f84b78a2a962420a GIT binary patch literal 580 zcmV-K0=xZ*P);t$FE~(5E9%T9 zp8{gF0Uiu{H{aNfAR>SFUL78mO;lMkQQvsH-FeCVxTmSEyRTzHK*v(Ob(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pgnlCjdJ)aAptPJRBMVM3D$FE6w?|=`InOu+j|J>6Ely$xfZ*^qv{R z$iFGOkTD?!=6oAT$GxdSWao}eVx?gRGb&%Tkne^p;pm8U%()4QatC3T_KO~Jm+=4N Z@BUjB=a-VpsfE7CeZUl+5g^f)R2}WEH#3qo!O2k6N z&U7}SfkaJqJa_Nx7?Z+qS++TQzWdE22&RJUHxo<;vw^L|GP{pSwflCEyc`anqT$Wa z;OcmAQvW`Uzs}m9=Xd?f&iHt6lm+~kwdK9{SF6&G=L9cLyuDkC)L!?z)Yk9uTGNyX zjV+fv$cuuc9kd;&fl2E@jqO21YQzP_kQO6g((JIQt+kvnH1e{ug-E3yq$LGG7+7>9 zym;sn(iu~bO<5C{Rs^N>LTSCiW+1L)f7?byUIa{8z_EG(l_f2M)ET3q;N_A7vooco z$up&4KxJ*CfRybdXC)>ig)o5RWHmidcLbrKUJptqnN+|^ES*%lP)I?f-q7f|_=|)Q zP&U=H=te;5^&lUI^_zOoNi$GdGED(PqeiXh_ad=lqd-CliInZq)dZ}yl;tAHXGs+m pHLzTy6m(BHm#p5u=Q8=1$^K+(E9<$9{AzxAX>M~NznGg3egMO@v-AJ} literal 0 HcmV?d00001 diff --git a/test/data/sample_24bpp_v3.bmp b/test/data/sample_24bpp_v3.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4684f14669f8f4a1601a63dcb70a92ed998200fe GIT binary patch literal 954 zcmaizF-yZh7=|M{>)_(<;^gQLaQDY_3w7vXTy!uMq+SLWmm*TE7!bsz(7{Q>LB-8( zE~16Dn&y1Ie91MogK~F-!jtFy-iw=Ciwj=%x52r_US=<`=e!k8&)b>zyw!Ex*$*5x zh-K|Rr}h5FQTlc~eu>6+C&|rea@PDgkH0Uvqsxckb#Ho=*)k6MFD`8D;Pc(8`s+2t z&WU|+Z&BOZfm7S&BX(=rvO<%wRmbw6EU}Yr&T4XEJ67|TS#;{f2*@HfUf8tVV`|&z zgA)zgr)6K}>cH6vrx#sIZ&KrLMGf<>1e?us|^c@{Rq zVW$d*Rh-x?)Dv&y^AcOD=4^4-ls0?UbPlVycv}_JOe%qcn6&i6f+a9x>P73lFf4_a zS*fT{3me2zQN0g{8cGTejb4`f%+w1jQ)_IbC6>Y+%lpCI)MYkT7p#rknQW1-$(h=*(ilrFt0?^MWzGI`!Tti@bg?i1 literal 0 HcmV?d00001 diff --git a/test/data/sample_24bpp_v7.bmp b/test/data/sample_24bpp_v7.bmp new file mode 100644 index 0000000000000000000000000000000000000000..1fa343188bc7deadf985d9ea5d274a1363e35c11 GIT binary patch literal 1038 zcma)*J4*vW6otn}t%Z%fy+0z2m5u)-*n}vgF&1j!Mv%B$*w_S-V8nnRHh~mYA{Huk z+S!N(5;fWJyK{FZYf@;qGfW=eoO93J}ygv!mXrjQ=$Mg=ahrDDRSvnI6hS(7=e;-Xv6 zBTc7bxZK1o`B1PJrcE8R&V^iTTGY>9?N8s<=g(PF QQ8KJF@ZZB4|8v3q0IVCfB>(^b literal 0 HcmV?d00001 diff --git a/test/data/sample_4bpp_v3.bmp b/test/data/sample_4bpp_v3.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0cc06f3161f8e3f81cd682e77503e8d1d8b594ed GIT binary patch literal 298 zcmZ?r)na4-gEAng0mQ;U%n!tj3@kvBfnf^}3v)xT0FVvB|9jdP{Ib5hL4Z_ zGYFcccg$LI?%lfw3=D$CW)+=Kw!HAS?>BFqiwgzX!EX#??^?4j4ycA-{@dLfxAw$^ zg4iEFU%Rn;bsQgv&3HMteCMhd1_cHN1wmo6^qI5HfXq~21hOk;tpc%~{>tvoj-1L0 zV*4}5N~e}KtU3c?D~L;Hm$qtw*$mv$rl}3H)&Rv_?sD%o4Qo(Z1!B7ZotIY8x#|D| F0|4G7a;N|R literal 0 HcmV?d00001 diff --git a/test/data/sample_8bpp.png b/test/data/sample_8bpp.png new file mode 100644 index 0000000000000000000000000000000000000000..c81f816f4f031b4596304b336d80942b8d598b48 GIT binary patch literal 346 zcmV-g0j2(lP)++atplo7P@c)0aK|9UknLF9QaZMnUG3b{yq`d9m91+wK&Byvx&U4-laBY@Q zRWa7FSO+(^Q&Fv0Vn|l&kxCmaynv`FY;1yv7%?D- zjgZ1h#6rc+bT*h+fMqj*L$k=ZVtMES-5c{ zBI1M$1SA{5g)5OPG-RhcHxdO$9lKI9NG{yX$KjrHE)Wmk1!MpcVzd0Eo}1BgU-ZIk zx%^qrclE}!{<^Lg&-Hpo?|sm#hvm}k^-6iM_Vjz>>3FlRw|^aM^>?-(%g*I)_d)-> z+dsPRAL(zWy}J|r{j7KMr~Gl*`+KE7dKLx3(B;Cf)?^sf8|Y!`K@taUh5I!NZ5q|H z$SZ6M5*EAMcce4WWzsMphKa!E(y=0JK+^~B4IJo{?b$`nQcP?S2QuX7(5$H} zbC4hd7X=$yV;!5Ih)t1zNo1Ks56o${eb7$tx-r2qLv9q(YbJu^6{0oHzNg#>h->?%?$RROJQbYwYTBNZN z5pg98fsiI(kt&1~CfI3bBPzH_*10*mMNawfa(LczfCT_k&<2_mG)S;3%Xa0hef_-J zcx6`yc4x`1ZQD0L?RMWDF50ax)%xw#W_AAV{@2d^*Y_j4_v6#_)uw<&hJkVK^wrWOt1~_&-QK}-$HKrnoWXD6Jc$bO7 zS9!gW#+V3#++i+91|;B+fW{aSY(WQ&<2t}lfR9Q{OtFa_FmB+Mg~%~;RT}A7qQ~1E zlLRHDbCIg3F10sqWpq%wz_Kw5i8+(K6r{ZbeHnV%o3zD%+#yRNzb3x=h>6F>G|H%-s49P7G`?0(+}Yva>r}H literal 0 HcmV?d00001 diff --git a/test/data/sample_8bpp_up.tga b/test/data/sample_8bpp_up.tga new file mode 100644 index 0000000000000000000000000000000000000000..a314e8689590abe043c1c5a60eb908aa77de8fe6 GIT binary patch literal 419 zcmYk(Jxjwt7zgmn`=yukl3bH(lB?f9zeRB!|fM`3oxD*kwVnGlW zp@Wl%gNmEoTttOdZF62y2mj-b-LhEb_hUWc%}NH+k6~JkdF*CipXMUR(|*(=?A2lot`VtS7s_xlcNjcm5K5g_yu3qUMc_p literal 0 HcmV?d00001 diff --git a/test/data/sample_8bpp_v3.bmp b/test/data/sample_8bpp_v3.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a890e64655127621d12b5418e1799341e990ad14 GIT binary patch literal 474 zcmYk2y)Oh&6vfYczwu^wzIOJRomq`WA^r%xKSn1MDjEtOiLeTdMg*}!A`y*5p%PIb zIy#LYvDlsGzFCEvoSVE~PTsxej!%r~C~Kek2q`A{Bn^x@FscE=V|@+LTS?ANla?SC zW>BooL(ZK*Zcafiw;&hqAzN+8gGtEs3lu9KcwH;-w9&)EW)D|eUC5nVoNafpyYqvh z{fxbnZ^-jc9A18*dns{r)4}Jp#PMAR?~esepF4PakuXh%dzGpmMz#82UY24C`u`xb zrs-rntE6E<#vo_R28cCzRuy3q)fCHf#j=d2LikA(*9UTD=g^x3dFly2j-!AzZ1U+% z%}gCGD%CiQB4WA$OV_l&(P0?X>kaZ*1~j!J@9$V^G;+9BmYO0-cpUg4v+Y5}GBOG? z=0Sz|b{U441uap`BW9={6*EB0VV>>VWoo#t5J=*{8DL)3uq+Bg%yo4dU0$Mp9{d7t CQCp}0 literal 0 HcmV?d00001 diff --git a/test/data/sample_8bpp_v3_rle.bmp b/test/data/sample_8bpp_v3_rle.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d460d0fd66c87c67af2e4d3f302a7a44b1bdec51 GIT binary patch literal 524 zcmXw$y-wUf6orqy{u!@-#`dgtc6Zh^X{dOJ^mzruE2N7^k%}}>Btb%CDbmm&1SlYo zkWiXP6saOa0Z}^WXi$R0CfW7mj=hX@Mw(A&=AL`!`HLkR_1dR>o+L<|WPy=@McSS% zG@7Hck$$sGdI!Dw8rAw+=#>-btyj?RN6>56(4#}>gO|{oUr~K{!2L#rn~zic*qY+o zrwR1VCC;`d*xmVu>hKnOCx4;8JmT~DA56|QjxNS{{H}3)HOB9s6;5x*_;sg&*m3+Y ziW8pYoo)}_kisOy4CD=T4HH)B_$pL!KP$+X4jJo<;DI0h*zg=2R-w$P+h%C>E+pYQ?*S4%#oGi<`-NDT7wqTj; zVUxWx7&LVQSM?oP6ro6Y#yqe0#1&nTjtJA3anCe6^D7rtVR%HmWh&Hl14R{x`z-Rf i*G$Ls6$DbE5UJm0QPOfTpr5#bFeY=>{xa(`Kc^Flsbf zlxG>x)E)Wsj`db6hihf2DUyW8fgdv4ZYs+tQJ66gs?4{`X2>jPi87DOP=8crfXrc@ g?b~J7a9tsg#DP;`Ud^y9YKF{pbt+xH#PoUa1n?(co&W#< literal 0 HcmV?d00001 diff --git a/test/data/sample_8bpp_v7_rle.bmp b/test/data/sample_8bpp_v7_rle.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d197b09a615ea5b00dc78ab57a7f2dc44d43fed9 GIT binary patch literal 608 zcmb7?KTi}v7{;I7+ds4HpV{5Hz2RHbhLQppgPFF$x6@4Kc)c zMiLTZV?tqNj0F-p>1Yg)aKf?UJG%=#lX)jIzdSSV^S+sx$8$F7VOzjU+6f9yVS!Nq zPicAhsEG%3HUa3{S)XQRpFFQO_gLDrcQ^Fn3+TmF=vNDul$DI z7(st{2L1LMs`U%}eN*AjyBi#B-r)Pz1bXKezHCqMe&-t1=mfiaSI}QC@$ujvCI=dy zevWbZL*w(|80W_o_D{w*JEb~e$MM4`PI#7gd(-fSWGNwLAa9^+n6OI6SD}jgSwX^d z$e3r`3lJ|umB_5fyM_;qyyi-UeJOd7i{8|b)lWm%W$6%)Bo`u2*}!Y{c4;|%Ka_DI zvOFhlcj|Xs+p=0aS(f*DgI4c$U>WaWc1X7|9sXxV{q~p3&G+`$Ix5-f5x2Bo& GiT(q@QD6!H literal 0 HcmV?d00001 diff --git a/test/image_loader_test.cpp b/test/image_loader_test.cpp new file mode 100644 index 000000000..94fc26cbf --- /dev/null +++ b/test/image_loader_test.cpp @@ -0,0 +1,160 @@ +#include +#include +#include +#include +#include + +using namespace irr; + +struct ImageDesc { + const char *name; + video::ECOLOR_FORMAT format; + std::vector data; +}; + +template +std::vector to_byte_array(std::initializer_list in_data) { + std::vector data; + data.resize(sizeof(T) * in_data.size()); + memcpy(data.data(), in_data.begin(), data.size()); + return data; +} + +static const ImageDesc test_images[] = { + {"16color-16bpp", video::ECF_A1R5G5B5, to_byte_array({ + 0xb6df, 0xb6df, 0xb6df, 0xb6df, 0xc23f, 0xc23f, 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe7a, 0xfe7a, 0xfe97, 0xfeb5, 0xfeb5, 0xff16, + 0xb6df, 0xb6df, 0xff3f, 0xff3f, 0xc23f, 0xf2df, 0xf2df, 0xf2df, 0xea3f, 0xda7f, 0xda7f, 0xfe5e, 0xfe7a, 0xc23f, 0xbe7f, 0xbe7f, 0xfeb5, 0xfeb5, 0xfb76, + 0xb6df, 0xff9e, 0xc23f, 0xc23f, 0xc23f, 0xf2df, 0xd61f, 0xf2df, 0xea3f, 0xda7f, 0xfe5e, 0xda7f, 0xfe7a, 0xc23f, 0xfe97, 0xfeb5, 0xfeb5, 0xff16, 0xfb76, + 0xb6df, 0xff9e, 0xbe7f, 0xc23f, 0xd61f, 0xfe7c, 0xd61f, 0xf2df, 0xfe5e, 0xf2df, 0xfe7c, 0xda7f, 0xfe7a, 0xda7f, 0xbe7f, 0xfeb5, 0xff16, 0xff16, 0xfb76, + 0xb6df, 0xff9e, 0xc23f, 0xc23f, 0xd61f, 0xff3f, 0xd61f, 0xf2df, 0xfe5e, 0xda7f, 0xfe7c, 0xda7f, 0xfe7a, 0xc23f, 0xfeb5, 0xfeb5, 0xff16, 0xff16, 0xfb76, + 0xb6df, 0xbe7f, 0xff9e, 0xff3f, 0xd61f, 0xff3f, 0xf2df, 0xf2df, 0xfe5e, 0xf2df, 0xda7f, 0xfe97, 0xfe97, 0xda7f, 0xc23f, 0xda7f, 0xfb76, 0xfb76, 0xfb76, + 0xbe7f, 0xc23f, 0xc23f, 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe7c, 0xfe7a, 0xfe97, 0xfeb5, 0xfeb5, 0xfeb5, 0xfb76, 0xfb76, 0xfb76, + 0xbe7f, 0xc23f, 0xd61f, 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe97, 0xfe97, 0xfe97, 0xfeb5, 0xff16, 0xff16, 0xfb76, 0xfb76, 0xfb76, + 0xc23f, 0xff9e, 0xc23f, 0xd61f, 0xff3f, 0xea3f, 0xfe5e, 0xff3f, 0xfe7c, 0xfe7c, 0xf2df, 0xfe97, 0xfeb5, 0xfeb5, 0xda7f, 0xff16, 0xc23f, 0xc23f, 0xbe7f, + 0xc23f, 0xff9e, 0xff9e, 0xd61f, 0xff9e, 0xea3f, 0xff3f, 0xfe5e, 0xff3f, 0xfe7a, 0xf2df, 0xf2df, 0xfeb5, 0xf2df, 0xda7f, 0xfb76, 0xc23f, 0xfb76, 0xfb76, + 0xc23f, 0xff9e, 0xd61f, 0xff9e, 0xff9e, 0xfe5e, 0xff3f, 0xff3f, 0xff3f, 0xfe7a, 0xff3f, 0xfeb5, 0xf2df, 0xff16, 0xda7f, 0xfb76, 0xda7f, 0xda7f, 0xfb76, + 0xc23f, 0xff9e, 0xea3f, 0xea3f, 0xff9e, 0xfe5e, 0xff9e, 0xfe7c, 0xff3f, 0xfe97, 0xf2df, 0xfeb5, 0xfeb5, 0xff16, 0xf2df, 0xfb76, 0xda7f, 0xfb76, 0xfb76, + 0xd61f, 0xff9e, 0xd61f, 0xea3f, 0xff9e, 0xfe5e, 0xff9e, 0xfe7c, 0xff3f, 0xfe97, 0xff3f, 0xfeb5, 0xff16, 0xfb76, 0xda7f, 0xfb76, 0xda7f, 0xda7f, 0xc23f, + 0xd61f, 0xd61f, 0xea3f, 0xea3f, 0xea3f, 0xfe5e, 0xfe7c, 0xfe7a, 0xfe7a, 0xfe97, 0xfeb5, 0xff16, 0xff16, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76, + 0xd61f, 0xd61f, 0xea3f, 0xfe5e, 0xfe5e, 0xfe7c, 0xfe7a, 0xfe7a, 0xfe97, 0xfeb5, 0xfeb5, 0xff16, 0xff16, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76, 0xfb76, + })}, + + {"30color-16bpp", video::ECF_A1R5G5B5, to_byte_array({ + 0xbabf, 0xbabf, 0xbabf, 0xbabf, 0xbe3f, 0xbdff, 0xc9ff, 0xda1f, 0xee3f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe7b, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xff16, + 0xbabf, 0xbabf, 0xff1f, 0xff1f, 0xbdff, 0xfaff, 0xf2df, 0xeabf, 0xee3f, 0xe27f, 0xda7f, 0xfe5e, 0xfe7b, 0xc25f, 0xbe7f, 0xbe7f, 0xfeb5, 0xfed5, 0xff56, + 0xbabf, 0xff7e, 0xbe7f, 0xc25f, 0xbdff, 0xfaff, 0xda1f, 0xf2df, 0xee3f, 0xda7f, 0xfe5e, 0xce5f, 0xfe79, 0xce5f, 0xfe97, 0xfeb5, 0xfed5, 0xff16, 0xff56, + 0xbabf, 0xff7e, 0xbe7f, 0xbdff, 0xc9ff, 0xfaff, 0xda1f, 0xf2df, 0xfa5f, 0xeabf, 0xfe5e, 0xda7f, 0xfe79, 0xce5f, 0xc25f, 0xfeb5, 0xff16, 0xff16, 0xff76, + 0xbabf, 0xff7e, 0xc25f, 0xbdff, 0xc9ff, 0xff1f, 0xda1f, 0xf2df, 0xfa5f, 0xeabf, 0xfe7c, 0xda7f, 0xfe79, 0xce5f, 0xfeb5, 0xfed5, 0xff16, 0xff56, 0xff97, + 0xbabf, 0xbe7f, 0xff7e, 0xff5e, 0xda1f, 0xff1f, 0xfaff, 0xfaff, 0xfa5f, 0xf2df, 0xeabf, 0xfe79, 0xfe97, 0xda7f, 0xce5f, 0xce5f, 0xff56, 0xff76, 0xff97, + 0xbe7f, 0xc25f, 0xbdff, 0xc9ff, 0xda1f, 0xda1f, 0xee3f, 0xfa5f, 0xfa5f, 0xfe7c, 0xfe7b, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xfed5, 0xff76, 0xff76, 0xff97, + 0xbe7f, 0xbe3f, 0xc9ff, 0xc9ff, 0xda1f, 0xee3f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe79, 0xfe97, 0xfe97, 0xfeb5, 0xff16, 0xff16, 0xff76, 0xff97, 0xff97, + 0xbe3f, 0xffbe, 0xc9ff, 0xda1f, 0xff5e, 0xee3f, 0xfa5f, 0xff1f, 0xfe7c, 0xfe7b, 0xf2df, 0xfe97, 0xfeb5, 0xfeb5, 0xda7f, 0xff76, 0xce5f, 0xbe3f, 0xc25f, + 0xbe3f, 0xffbe, 0xffbe, 0xda1f, 0xff7e, 0xfa5f, 0xff5e, 0xfe5e, 0xff1f, 0xfe79, 0xf2df, 0xf2df, 0xfeb5, 0xeabf, 0xda7f, 0xff76, 0xce5f, 0xff97, 0xff97, + 0xbdff, 0xffbe, 0xda1f, 0xff7e, 0xff7e, 0xfa5f, 0xff5e, 0xff1f, 0xff1f, 0xfe79, 0xfaff, 0xfeb5, 0xf2df, 0xff16, 0xe27f, 0xff97, 0xda7f, 0xce5f, 0xff97, + 0xbdff, 0xffbe, 0xda1f, 0xee3f, 0xffbe, 0xfa5f, 0xff7e, 0xfe7b, 0xff1f, 0xfe97, 0xfaff, 0xfeb5, 0xfed5, 0xff56, 0xeabf, 0xff97, 0xda7f, 0xff97, 0xff97, + 0xc9ff, 0xffbe, 0xda1f, 0xee3f, 0xff7e, 0xfa5f, 0xff7e, 0xfe7c, 0xff5e, 0xfe97, 0xfaff, 0xfed5, 0xff16, 0xff56, 0xeabf, 0xff97, 0xda7f, 0xda7f, 0xce5f, + 0xda1f, 0xda1f, 0xee3f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe79, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xff16, 0xff56, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97, + 0xda1f, 0xda1f, 0xee3f, 0xfa5f, 0xfe5e, 0xfe7c, 0xfe7b, 0xfe79, 0xfe97, 0xfeb5, 0xfed5, 0xff16, 0xff56, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97, + })}, + + {"30color-24bpp", video::ECF_R8G8B8, { + 0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0x7b, 0x8b, 0xff, 0x7a, 0x7f, 0xff, 0x90, 0x7f, 0xff, 0xb6, 0x85, 0xff, 0xd9, 0x8c, 0xff, 0xd9, 0x8c, 0xff, 0xf4, 0x92, 0xfe, 0xfe, 0x96, 0xf0, 0xfd, 0x99, 0xe3, 0xfd, 0x9b, 0xda, 0xfc, 0x9f, 0xca, 0xfc, 0xa4, 0xbc, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf9, 0xc6, 0xb1, + 0x71, 0xaf, 0xff, 0x71, 0xaf, 0xff, 0xff, 0xc6, 0xfc, 0xff, 0xc6, 0xfc, 0x7a, 0x7f, 0xff, 0xf7, 0xbe, 0xff, 0xe4, 0xb2, 0xfe, 0xd4, 0xa9, 0xff, 0xd9, 0x8c, 0xff, 0xc3, 0x98, 0xff, 0xb2, 0x9a, 0xff, 0xfe, 0x96, 0xf0, 0xfd, 0x9b, 0xda, 0x86, 0x93, 0xfe, 0x78, 0x9b, 0xff, 0x78, 0x9b, 0xff, 0xfb, 0xa9, 0xab, 0xfa, 0xb6, 0xad, 0xf8, 0xd2, 0xb3, + 0x71, 0xaf, 0xff, 0xfe, 0xdc, 0xf3, 0x78, 0x9b, 0xff, 0x86, 0x93, 0xfe, 0x7a, 0x7f, 0xff, 0xf7, 0xbe, 0xff, 0xb6, 0x85, 0xff, 0xe4, 0xb2, 0xfe, 0xd9, 0x8c, 0xff, 0xb2, 0x9a, 0xff, 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G8B8, to_byte_array({ + 0xff71afff, 0xff71afff, 0xff71afff, 0xff71afff, 0xff7b8bff, 0xff7a7fff, 0xff907fff, 0xffb685ff, 0xffd98cff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffd9bda, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, + 0xff71afff, 0xff71afff, 0xffffc6fc, 0xffffc6fc, 0xff7a7fff, 0xfff7beff, 0xffe4b2fe, 0xffd4a9ff, 0xffd98cff, 0xffc398ff, 0xffb29aff, 0xfffe96f0, 0xfffd9bda, 0xff8693fe, 0xff789bff, 0xff789bff, 0xfffba9ab, 0xfffab6ad, 0xfff8d2b3, + 0xff71afff, 0xfffedcf3, 0xff789bff, 0xff8693fe, 0xff7a7fff, 0xfff7beff, 0xffb685ff, 0xffe4b2fe, 0xffd98cff, 0xffb29aff, 0xfffe96f0, 0xff9a91ff, 0xfffc9fca, 0xff9a91ff, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, + 0xff71afff, 0xfffedcf3, 0xff789bff, 0xff7a7fff, 0xff907fff, 0xfff7beff, 0xffb685ff, 0xffe4b2fe, 0xfff492fe, 0xffd4a9ff, 0xfffe96f0, 0xffb29aff, 0xfffc9fca, 0xff9a91ff, 0xff8693fe, 0xfffba9ab, 0xfff9c6b1, 0xfff9c6b1, 0xfff8d8b5, + 0xff71afff, 0xfffedcf3, 0xff8693fe, 0xff7a7fff, 0xff907fff, 0xffffc6fc, 0xffb685ff, 0xffe4b2fe, 0xfff492fe, 0xffd4a9ff, 0xfffd99e3, 0xffb29aff, 0xfffc9fca, 0xff9a91ff, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xfff8e4b9, + 0xff71afff, 0xff789bff, 0xfffedcf3, 0xffffd0f7, 0xffb685ff, 0xffffc6fc, 0xfff7beff, 0xfff7beff, 0xfff492fe, 0xffe4b2fe, 0xffd4a9ff, 0xfffc9fca, 0xfffca4bc, 0xffb29aff, 0xff9a91ff, 0xff9a91ff, 0xfff8d2b3, 0xfff8d8b5, 0xfff8e4b9, + 0xff789bff, 0xff8693fe, 0xff7a7fff, 0xff907fff, 0xffb685ff, 0xffb685ff, 0xffd98cff, 0xfff492fe, 0xfff492fe, 0xfffd99e3, 0xfffd9bda, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfffab6ad, 0xfff8d8b5, 0xfff8d8b5, 0xfff8e4b9, + 0xff789bff, 0xff7b8bff, 0xff907fff, 0xff907fff, 0xffb685ff, 0xffd98cff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffc9fca, 0xfffca4bc, 0xfffca4bc, 0xfffba9ab, 0xfff9c6b1, 0xfff9c6b1, 0xfff8d8b5, 0xfff8e4b9, 0xfff8e4b9, + 0xff7b8bff, 0xffffebf2, 0xff907fff, 0xffb685ff, 0xffffd0f7, 0xffd98cff, 0xfff492fe, 0xffffc6fc, 0xfffd99e3, 0xfffd9bda, 0xffe4b2fe, 0xfffca4bc, 0xfffba9ab, 0xfffba9ab, 0xffb29aff, 0xfff8d8b5, 0xff9a91ff, 0xff7b8bff, 0xff8693fe, + 0xff7b8bff, 0xffffebf2, 0xffffebf2, 0xffb685ff, 0xfffedcf3, 0xfff492fe, 0xffffd0f7, 0xfffe96f0, 0xffffc6fc, 0xfffc9fca, 0xffe4b2fe, 0xffe4b2fe, 0xfffba9ab, 0xffd4a9ff, 0xffb29aff, 0xfff8d8b5, 0xff9a91ff, 0xfff8e4b9, 0xfff8e4b9, + 0xff7a7fff, 0xffffebf2, 0xffb685ff, 0xfffedcf3, 0xfffedcf3, 0xfff492fe, 0xffffd0f7, 0xffffc6fc, 0xffffc6fc, 0xfffc9fca, 0xfff7beff, 0xfffba9ab, 0xffe4b2fe, 0xfff9c6b1, 0xffc398ff, 0xfff8e4b9, 0xffb29aff, 0xff9a91ff, 0xfff8e4b9, + 0xff7a7fff, 0xffffebf2, 0xffb685ff, 0xffd98cff, 0xffffebf2, 0xfff492fe, 0xfffedcf3, 0xfffd9bda, 0xffffc6fc, 0xfffca4bc, 0xfff7beff, 0xfffba9ab, 0xfffab6ad, 0xfff8d2b3, 0xffd4a9ff, 0xfff8e4b9, 0xffb29aff, 0xfff8e4b9, 0xfff8e4b9, + 0xff907fff, 0xffffebf2, 0xffb685ff, 0xffd98cff, 0xfffedcf3, 0xfff492fe, 0xfffedcf3, 0xfffd99e3, 0xffffd0f7, 0xfffca4bc, 0xfff7beff, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xffd4a9ff, 0xfff8e4b9, 0xffb29aff, 0xffb29aff, 0xff9a91ff, + 0xffb685ff, 0xffb685ff, 0xffd98cff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffc9fca, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, + 0xffb685ff, 0xffb685ff, 0xffd98cff, 0xfff492fe, 0xfffe96f0, 0xfffd99e3, 0xfffd9bda, 0xfffc9fca, 0xfffca4bc, 0xfffba9ab, 0xfffab6ad, 0xfff9c6b1, 0xfff8d2b3, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, 0xfff8e4b9, + })}, + +}; + +void printImageBytes(const video::IImage *img) +{ + const auto *data = (u8 *)img->getData(); + const auto w = img->getPitch(); + const auto h = img->getDimension().Height; + for (int y = 0; y < h; y++) { + for (int k = 0; k < w; k++) { + std::printf("0x%02x, ", *data++); + } + std::printf("\n"); + } +} + +int main(int argc, char *argv[]) +try { + if (argc != 3) + throw std::runtime_error("Invalid arguments. Expected sample ID and image file name"); + + const ImageDesc *sample = nullptr; + for (auto &&image: test_images) { + if (strcmp(argv[1], image.name) == 0) + sample = ℑ + } + if (!sample) + throw std::runtime_error("Sample not found"); + + SIrrlichtCreationParameters p; + p.DriverType = video::EDT_NULL; + p.WindowSize = core::dimension2du(640, 480); + p.LoggingLevel = ELL_DEBUG; + + auto *device = createDeviceEx(p); + if (!device) + throw std::runtime_error("Failed to create device"); + + auto *driver = device->getVideoDriver(); + + auto *img = driver->createImageFromFile(argv[2]); + if (!img) + throw std::runtime_error("Failed to load image"); + + if (img->getDimension() != core::dimension2du{19, 15}) + throw std::runtime_error("Wrong image dimensions"); + + if (img->getColorFormat() != sample->format) + throw std::runtime_error("Wrong image format"); + + if (img->getImageDataSizeInBytes() != sample->data.size()) + throw std::logic_error("Image data size not equal to sample size"); + + if (memcmp(img->getData(), sample->data.data(), sample->data.size()) != 0) { + printImageBytes(img); + throw std::runtime_error("Wrong image contents"); + } + + img->drop(); + device->drop(); + + return 0; +} catch (const std::exception &e) { + std::printf("Test failed: %s\n", e.what()); + return 1; +}