diff options
Diffstat (limited to 'tests/vec.c')
| -rw-r--r-- | tests/vec.c | 19 | 
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/vec.c b/tests/vec.c new file mode 100644 index 0000000..4bc06e7 --- /dev/null +++ b/tests/vec.c @@ -0,0 +1,19 @@ +#include <assert.h> + +#define VEC_TYPE int +#define VEC_NAME ints +#include <conts/vec.h> + +int main() +{ +	struct ints ints = ints_create(0); +	for (int i = 0; i < 1000000; ++i) { +		ints_append(&ints, i); +	} + +	for (int i = 0; i < 1000000; ++i) { +		int *v = ints_at(&ints, i); +		assert(v && *v == i); +	} +	ints_destroy(&ints); +}  | 
