testing.c 783 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <stdio.h>
  2. #include <zivuos.h>
  3. void dump(zv_vector_t *self) {
  4. zv_vector_count_t length = zv_vector_length(self);
  5. printf("Vector length: %u\n", length);
  6. zv_vector_container_t *current = *self;
  7. size_t count = 0;
  8. while (count < length) {
  9. printf("Item %u: %s\n", count++, current->content.string);
  10. current = current->next;
  11. }
  12. puts("Dump end");
  13. puts("");
  14. }
  15. int main() {
  16. puts("ZivuOS vector test unit.");
  17. zv_universal_t first = { .string = "UwU" };
  18. zv_universal_t second = { .string = "OwO" };
  19. zv_vector_t *test = zv_vector_create();
  20. dump(test);
  21. zv_vector_append(test, first);
  22. zv_vector_append(test, second);
  23. zv_vector_append(test, second);
  24. dump(test);
  25. return 0;
  26. }