Skip to content
Myr

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

7 files+44 added−26 removed

modified:tests/image_test.c+4 added
60 unmodified lines
61 if (len > 1024) len = 1024;62 memcpy(dummy, data, len);63}6465extern void image_write_test(void);6667int main(int argc, char **argv)68{69 int w,h;70 //test_ycbcr();7172 image_write_test();7374 #if 075 // test hdr asserts76 for (h=0; h < 100; h += 2)77 for (w=0; w < 200; ++w)
95 unmodified lines
modified:tests/image_test.dsp+4 added
86 unmodified lines
87SOURCE=.\image_test.c88# End Source File89# Begin Source File9091SOURCE=.\image_write_test.c92# End Source File93# Begin Source File9495SOURCE=..\stb_image.h96# End Source File97# Begin Source File98
4 unmodified lines
modified: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"45// using an 'F' since it has no rotational symmetries, and 6x5
7 unmodified lines
13 ".***.."14 ".*...."15 ".*....";1616int main(int argc, char **argv)17void 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 lines
32 img6x5_rgbf[i*3 + 1] = 0.0f;33 img6x5_rgbf[i*3 + 2] = on ? 0.0f : 1.0f;34 }3535 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);4142 stbi_flip_vertically_on_write(1);4343 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}5051#ifdef IWT_TEST52int main(int argc, char **argv)53{54 image_write_test();55 return 0;56}57#endif
modified:tests/stb.dsp+13 added-1 removed
64 unmodified lines
65# 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"73BSC32=bscmake.exe
35 unmodified lines
109SOURCE=..\stb_divide.h110# End Source File111# Begin Source File112113SOURCE=..\stb_ds.h114# End Source File115# Begin Source File116117SOURCE=..\stb_dxt.h118# End Source File119# Begin Source File120
32 unmodified lines
153SOURCE=..\stb_pg.h154# End Source File155# Begin Source File156157SOURCE=.\stb_query.h158# End Source File159# Begin Source File160161SOURCE=..\stb_rect_pack.h162# End Source File163# Begin Source File164
40 unmodified lines
205SOURCE=.\test_c_lexer.c206# End Source File207# Begin Source File208209SOURCE=.\test_ds.c210# End Source File211# Begin Source File212213SOURCE=.\test_dxt.c214# End Source File215# Begin Source File216
36 unmodified lines
modified:tests/stb.dsw-12 removed
61 unmodified lines
62}}}6364###############################################################################6566Project: "pg_test"=.\pg_test\pg_test.dsp - Package Owner=<4>6768Package=<5>69{{{70}}}7172Package=<4>73{{{74}}}7576###############################################################################7766Project: "resize"=.\resize.dsp - Package Owner=<4>6768Package=<5>69{{{
104 unmodified lines
modified:tests/test_c_compilation.c+3 added-2 removed
9 unmodified lines
10#define STB_IMAGE_RESIZE_IMPLEMENTATION11#define STB_RECT_PACK_IMPLEMENTATION12#define STB_VOXEL_RENDER_IMPLEMENTATION13#define STB_EASY_FONT_IMPLEMENTATION14#define STB_DXT_IMPLEMENTATION1516#include "stb_herringbone_wang_tile.h"17#include "stb_image.h"18#include "stb_image_write.h"
1 unmodified line
20#include "stb_c_lexer.h"21#include "stb_divide.h"22#include "stb_image_resize.h"23#include "stb_rect_pack.h"2324#define STB_DXT_IMPLEMENTATION24#include "stb_dxt.h"2526#include "stb_ds.h"2728#define STBVOX_CONFIG_MODE 129#include "stb_voxel_render.h"3031#define STBTE_DRAW_RECT(x0,y0,x1,y1,color) 0
11 unmodified lines
modified:tests/test_cpp_compilation.cpp+2 added
13 unmodified lines
14#define STB_HERRINGBONE_WANG_TILE_IMPLEMENTATION15#define STB_RECT_PACK_IMPLEMENTATION16#define STB_VOXEL_RENDER_IMPLEMENTATION17#define STB_CONNECTED_COMPONENTS_IMPLEMENTATION18#define STB_DS_IMPLEMENTATION1920#define STBI_MALLOC my_malloc21#define STBI_FREE my_free22#define STBI_REALLOC my_realloc
10 unmodified lines
33#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"3839#define STBCC_GRID_COUNT_X_LOG2 1040#define STBCC_GRID_COUNT_Y_LOG2 1041#include "stb_connected_components.h"
109 unmodified lines