update tests and project files for stb_ds
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parent 477471d · Browse files · 7 files·+44 added−26 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+44 added−26 removed
- tests:+44 added−26 removed
Provenance
- Commit
e704ed0- Tree
e98ad69- Author
Sean Barrett <sean@nothings.org>- Committer
Sean Barrett <sean@nothings.org>- Parent
477471d
7 files changed+44 added−26 removed
modified:tests/image_test.c+4 added
60 unmodified lines61 if (len > 1024) len = 1024;62 memcpy(dummy, data, len);63 }64 65+extern void image_write_test(void);66+67 int main(int argc, char **argv)68 {69 int w,h;70 //test_ycbcr();71 72+ image_write_test();73+74 #if 075 // test hdr asserts76 for (h=0; h < 100; h += 2)77 for (w=0; w < 200; ++w)95 unmodified linesmodified:tests/image_test.dsp+4 added
86 unmodified lines87 SOURCE=.\image_test.c88 # End Source File89 # Begin Source File90 91+SOURCE=.\image_write_test.c92+# End Source File93+# Begin Source File94+95 SOURCE=..\stb_image.h96 # End Source File97 # Begin Source File98 4 unmodified linesmodified:tests/image_write_test.c+18 added-11 removed
1+#define STB_IMAGE_WRITE_STATIC2 #define STB_IMAGE_WRITE_IMPLEMENTATION3 #include "stb_image_write.h"4 5 // using an 'F' since it has no rotational symmetries, and 6x57 unmodified lines13 ".***.."14 ".*...."15 ".*....";16 16-int main(int argc, char **argv)17+void image_write_test(void)18 {19 // make a RGB version of the template image20 // use red on blue to detect R<->B swaps21 unsigned char img6x5_rgb[6*5*3];10 unmodified lines32 img6x5_rgbf[i*3 + 1] = 0.0f;33 img6x5_rgbf[i*3 + 2] = on ? 0.0f : 1.0f;34 }35 35- stbi_write_png("wr6x5_regular.png", 6, 5, 3, img6x5_rgb, 6*3);36- stbi_write_bmp("wr6x5_regular.bmp", 6, 5, 3, img6x5_rgb);37- stbi_write_tga("wr6x5_regular.tga", 6, 5, 3, img6x5_rgb);38- stbi_write_jpg("wr6x5_regular.jpg", 6, 5, 3, img6x5_rgb, 95);39- stbi_write_hdr("wr6x5_regular.hdr", 6, 5, 3, img6x5_rgbf);36+ stbi_write_png("output/wr6x5_regular.png", 6, 5, 3, img6x5_rgb, 6*3);37+ stbi_write_bmp("output/wr6x5_regular.bmp", 6, 5, 3, img6x5_rgb);38+ stbi_write_tga("output/wr6x5_regular.tga", 6, 5, 3, img6x5_rgb);39+ stbi_write_jpg("output/wr6x5_regular.jpg", 6, 5, 3, img6x5_rgb, 95);40+ stbi_write_hdr("output/wr6x5_regular.hdr", 6, 5, 3, img6x5_rgbf);41 42 stbi_flip_vertically_on_write(1);43 43- stbi_write_png("wr6x5_flip.png", 6, 5, 3, img6x5_rgb, 6*3);44- stbi_write_bmp("wr6x5_flip.bmp", 6, 5, 3, img6x5_rgb);45- stbi_write_tga("wr6x5_flip.tga", 6, 5, 3, img6x5_rgb);46- stbi_write_jpg("wr6x5_flip.jpg", 6, 5, 3, img6x5_rgb, 95);47- stbi_write_hdr("wr6x5_flip.hdr", 6, 5, 3, img6x5_rgbf);44+ stbi_write_png("output/wr6x5_flip.png", 6, 5, 3, img6x5_rgb, 6*3);45+ stbi_write_bmp("output/wr6x5_flip.bmp", 6, 5, 3, img6x5_rgb);46+ stbi_write_tga("output/wr6x5_flip.tga", 6, 5, 3, img6x5_rgb);47+ stbi_write_jpg("output/wr6x5_flip.jpg", 6, 5, 3, img6x5_rgb, 95);48+ stbi_write_hdr("output/wr6x5_flip.hdr", 6, 5, 3, img6x5_rgbf);49+}50 51+#ifdef IWT_TEST52+int main(int argc, char **argv)53+{54+ image_write_test();55 return 0;56 }57+#endifmodified:tests/stb.dsp+13 added-1 removed
64 unmodified lines65 # PROP Intermediate_Dir "Debug\stb"66 # PROP Ignore_Export_Lib 067 # PROP Target_Dir ""68 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c69-# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "TT_TEST" /FR /FD /GZ /c69+# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "DS_TEST" /FR /FD /GZ /c70 # SUBTRACT CPP /YX71 # ADD BASE RSC /l 0x409 /d "_DEBUG"72 # ADD RSC /l 0x409 /d "_DEBUG"73 BSC32=bscmake.exe35 unmodified lines109 SOURCE=..\stb_divide.h110 # End Source File111 # Begin Source File112 113+SOURCE=..\stb_ds.h114+# End Source File115+# Begin Source File116+117 SOURCE=..\stb_dxt.h118 # End Source File119 # Begin Source File120 32 unmodified lines153 SOURCE=..\stb_pg.h154 # End Source File155 # Begin Source File156 157+SOURCE=.\stb_query.h158+# End Source File159+# Begin Source File160+161 SOURCE=..\stb_rect_pack.h162 # End Source File163 # Begin Source File164 40 unmodified lines205 SOURCE=.\test_c_lexer.c206 # End Source File207 # Begin Source File208 209+SOURCE=.\test_ds.c210+# End Source File211+# Begin Source File212+213 SOURCE=.\test_dxt.c214 # End Source File215 # Begin Source File216 36 unmodified linesmodified:tests/stb.dsw-12 removed
61 unmodified lines62 }}}63 64 ###############################################################################65 66-Project: "pg_test"=.\pg_test\pg_test.dsp - Package Owner=<4>67-68-Package=<5>69-{{{70-}}}71-72-Package=<4>73-{{{74-}}}75-76-###############################################################################77-66 Project: "resize"=.\resize.dsp - Package Owner=<4>67 68 Package=<5>69 {{{104 unmodified linesmodified:tests/test_c_compilation.c+3 added-2 removed
9 unmodified lines10 #define STB_IMAGE_RESIZE_IMPLEMENTATION11 #define STB_RECT_PACK_IMPLEMENTATION12 #define STB_VOXEL_RENDER_IMPLEMENTATION13 #define STB_EASY_FONT_IMPLEMENTATION14+#define STB_DXT_IMPLEMENTATION15 16 #include "stb_herringbone_wang_tile.h"17 #include "stb_image.h"18 #include "stb_image_write.h"1 unmodified line20 #include "stb_c_lexer.h"21 #include "stb_divide.h"22 #include "stb_image_resize.h"23 #include "stb_rect_pack.h"23-24-#define STB_DXT_IMPLEMENTATION24 #include "stb_dxt.h"25 26+#include "stb_ds.h"27+28 #define STBVOX_CONFIG_MODE 129 #include "stb_voxel_render.h"30 31 #define STBTE_DRAW_RECT(x0,y0,x1,y1,color) 011 unmodified linesmodified:tests/test_cpp_compilation.cpp+2 added
13 unmodified lines14 #define STB_HERRINGBONE_WANG_TILE_IMPLEMENTATION15 #define STB_RECT_PACK_IMPLEMENTATION16 #define STB_VOXEL_RENDER_IMPLEMENTATION17 #define STB_CONNECTED_COMPONENTS_IMPLEMENTATION18+#define STB_DS_IMPLEMENTATION19 20 #define STBI_MALLOC my_malloc21 #define STBI_FREE my_free22 #define STBI_REALLOC my_realloc10 unmodified lines33 #include "stb_dxt.h"34 #include "stb_c_lexer.h"35 #include "stb_divide.h"36 #include "stb_herringbone_wang_tile.h"37+#include "stb_ds.h"38 39 #define STBCC_GRID_COUNT_X_LOG2 1040 #define STBCC_GRID_COUNT_Y_LOG2 1041 #include "stb_connected_components.h"109 unmodified lines