36 lines
690 B
C
36 lines
690 B
C
#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;
|
|
}
|