Mercurial > vec
comparison test/test.c @ 17:41dd962abdd1
*: allow compiling vec in a C++ translation unit
this is stupid, but whatever
author | Paper <paper@tflc.us> |
---|---|
date | Wed, 20 Nov 2024 12:02:15 -0500 |
parents | e05c257c6a23 |
children | cf04071d2148 |
comparison
equal
deleted
inserted
replaced
16:9da2aba90c87 | 17:41dd962abdd1 |
---|---|
1 #include "vec/vec.h" | 1 #include "vec/vec.h" |
2 | 2 |
3 #include <stdio.h> | 3 #include <stdio.h> |
4 #include <string.h> | |
4 #include <inttypes.h> | 5 #include <inttypes.h> |
5 | 6 |
6 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) | 7 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) |
7 | 8 |
8 static const int8_t testval8[] = { | 9 static const int8_t testval8[] = { |
76 | 77 |
77 #define DEF_VEC_TEST_FUNCS(bits, size) \ | 78 #define DEF_VEC_TEST_FUNCS(bits, size) \ |
78 VTEST(, , bits, size) VTEST(u, U, bits, size) \ | 79 VTEST(, , bits, size) VTEST(u, U, bits, size) \ |
79 VPRINT(, , d, bits, size) VPRINT(u, U, u, bits, size) | 80 VPRINT(, , d, bits, size) VPRINT(u, U, u, bits, size) |
80 | 81 |
82 DEF_VEC_TEST_FUNCS(8, 2) | |
83 | |
84 DEF_VEC_TEST_FUNCS(8, 4) | |
85 DEF_VEC_TEST_FUNCS(16, 2) | |
86 | |
81 DEF_VEC_TEST_FUNCS(8, 8) | 87 DEF_VEC_TEST_FUNCS(8, 8) |
82 DEF_VEC_TEST_FUNCS(16, 4) | 88 DEF_VEC_TEST_FUNCS(16, 4) |
83 DEF_VEC_TEST_FUNCS(32, 2) | 89 DEF_VEC_TEST_FUNCS(32, 2) |
84 | 90 |
85 DEF_VEC_TEST_FUNCS(8, 16) | 91 DEF_VEC_TEST_FUNCS(8, 16) |