added stb, more binaryout changes"
[henge/apc.git] / stb / tests / stretch_test.c
1 // check that stb_truetype compiles with no stb_rect_pack.h
2 #define STB_TRUETYPE_IMPLEMENTATION
3 #include "stb_truetype.h"
4
5 #include "stretchy_buffer.h"
6 #include <assert.h>
7
8 int main(int arg, char **argv)
9 {
10 int i;
11 int *arr = NULL;
12
13 for (i=0; i < 1000000; ++i)
14 sb_push(arr, i);
15
16 assert(sb_count(arr) == 1000000);
17 for (i=0; i < 1000000; ++i)
18 assert(arr[i] == i);
19
20 sb_free(arr);
21 arr = NULL;
22
23 for (i=0; i < 1000; ++i)
24 sb_add(arr, 1000);
25 assert(sb_count(arr) == 1000000);
26
27 return 0;
28 }