c-uebungen/Assignment_023/vector_stack_test.c

39 lines
721 B
C

#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include "minitest.h"
#include "vector_stack.h"
static char* test_creation() {
Vector vec;
vec_init(&vec, 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);
return 0;
}
/* Weitere Testmethoden hier einfügen */
static int tests_run;
static char* allTests() {
mu_run_test(test_creation);
/* Alle Testmethoden hier rufen */
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;
}