aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/obscure.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/obscure.c b/tests/obscure.c
new file mode 100644
index 0000000..190ff09
--- /dev/null
+++ b/tests/obscure.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+#define CONTAINER_IMPLEMENTATION
+#include "../include/container.h"
+
+typedef char* packet_t;
+
+int main() {
+ packet_t *data = array_new(packet_t, 0);
+ packet_t el_0 = malloc(128);
+ memset(el_0, 42, 128);
+ packet_t el_1 = malloc(128);
+ memset(el_1, 69, 128);
+ array_push(data, el_0);
+ array_push(data, el_1);
+ for (size_t i = 0; i < array_size(data); ++i) {
+ for (size_t j = 0; j < 128; ++j) {
+ printf("%.2X ", data[i][j]);
+ }
+ putchar('\n');
+ }
+ return (data[0][69] == 42 && data[1][42] == 69 ? 0 : 1);
+ // OS will free it for me
+}