aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cyn/comp.c51
-rw-r--r--tests/d/test.c1
-rw-r--r--tests/un/lists.c2
3 files changed, 52 insertions, 2 deletions
diff --git a/tests/cyn/comp.c b/tests/cyn/comp.c
new file mode 100644
index 0000000..65a48f6
--- /dev/null
+++ b/tests/cyn/comp.c
@@ -0,0 +1,51 @@
+#include <ungrateful.h>
+#include <cynic.h>
+
+#include <stdio.h>
+
+int main(void) {
+
+ /*
+ u64 file_size, bytes_read;
+ Buffer buf, output_buffer;
+ Allocator talloc;
+ FILE *file;
+
+ un_init(UN_KB(10));
+
+ talloc = un_alloc_temp_get();
+ file = fopen(__FILE__, "rb");
+
+ if (file) {
+ fseek(file, 0L, SEEK_END);
+ file_size = ftell(file);
+ rewind(file);
+
+ if (file_size == 0) {
+ fclose(file);
+ return 100;
+ }
+
+ buf.size = file_size;
+ buf.data = un_memory_alloc(buf.size, talloc);
+ assert(buf.data != NULL);
+
+ bytes_read = fread(buf.data, sizeof(u8), buf.size, file);
+
+ if (bytes_read != buf.size) {
+ fclose(file);
+ return 120;
+ }
+
+ fclose(file);
+ } else {
+ return 300;
+ }
+
+ output_buffer = un_compress(buf, talloc);
+
+ fprintf(stdout, "Compressed: %lluB, Uncompressed: %lluB\n", output_buffer.size, buf.size);
+
+ */
+ return 0;
+}
diff --git a/tests/d/test.c b/tests/d/test.c
index 6e6442b..a77a759 100644
--- a/tests/d/test.c
+++ b/tests/d/test.c
@@ -3,7 +3,6 @@
int main(void) {
un_init(UN_KB(4));
-
d_init();
String host = UN_STR("f-tier-games.ru");
diff --git a/tests/un/lists.c b/tests/un/lists.c
index afab83e..8834080 100644
--- a/tests/un/lists.c
+++ b/tests/un/lists.c
@@ -7,7 +7,7 @@ int main(void) {
size = UN_LIST_STANDARD_CAPACITY;
times = 4;
- un_alloc_temp_init(UN_MB(50));
+ un_init(UN_MB(5));
{
list.alloc = un_alloc_temp_get();