Spider2/tests/dynarr_get.c

14 lines
340 B
C

#include "util.h"
#include "unit.h"
#define TEST_LEN 32768
int tests_dynarr_get(int argc, char **argv) {
int_dynarr_t arr = dynarr_initi(int_dynarr_t);
for (int i = 0; i < 100; i++)
dynarr_push(arr, 0);
chi_assert("get(5) == arr.data + 5", dynarr_get(arr, 5) == arr.data + 5);
dynarr_destroy(arr);
return 0;
}