File: stretch_test.c

package info (click to toggle)
libstb 0.0~git20180212.15.e6afb9c-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,440 kB
  • sloc: ansic: 65,656; cpp: 1,020; makefile: 54
file content (28 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
}