summaryrefslogtreecommitdiff
path: root/thirdparty/stb/tests/stretch_test.c
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /thirdparty/stb/tests/stretch_test.c
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'thirdparty/stb/tests/stretch_test.c')
-rw-r--r--thirdparty/stb/tests/stretch_test.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/thirdparty/stb/tests/stretch_test.c b/thirdparty/stb/tests/stretch_test.c
new file mode 100644
index 0000000..8caf43f
--- /dev/null
+++ b/thirdparty/stb/tests/stretch_test.c
@@ -0,0 +1,28 @@
+// check that stb_truetype compiles with no stb_rect_pack.h
+#define STB_TRUETYPE_IMPLEMENTATION
+#include "stb_truetype.h"
+
+#include "stretchy_buffer.h"
+#include <assert.h>
+
+int main(int arg, char **argv)
+{
+ int i;
+ int *arr = NULL;
+
+ for (i=0; i < 1000000; ++i)
+ sb_push(arr, i);
+
+ assert(sb_count(arr) == 1000000);
+ for (i=0; i < 1000000; ++i)
+ assert(arr[i] == i);
+
+ sb_free(arr);
+ arr = NULL;
+
+ for (i=0; i < 1000; ++i)
+ sb_add(arr, 1000);
+ assert(sb_count(arr) == 1000000);
+
+ return 0;
+} \ No newline at end of file