c-uebungen/Assignment_022/vector_heap_test.c

36 lines
690 B
C
Raw Normal View History

2023-05-21 21:10:46 +02:00
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include "minitest.h"
#include "vector_heap.h"
static char* test_creation() {
Vector* vec = vec_new(3.0, 1.0, -5.0);
mu_assert("Equal x", vec->x == 3.0);
mu_assert("Equal y", vec->y == 1.0);
mu_assert("Equal z", vec->z == -5.0);
free(vec);
return 0;
}
static int tests_run;
static char* allTests() {
mu_run_test(test_creation);
/* Weitere Tests hier einfügen */
return 0;
}
int main() {
char *result = allTests();
if (result != 0) printf("%s\n", result);
else printf("ALL TESTS PASSED\n");
printf("Tests run: %d\n", tests_run);
return result != 0;
}