testing.c 704 B

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