X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=test%2Ft.Vector.c;h=7fde1e94f720a26a3a825582f22239200e4b6b1c;hb=1ff641f9960fa6c6081817a5641afb22fad91dcd;hp=aa88c3a173e28556256e6cf2b199b872391eaddf;hpb=a78687686f5b490d99fae21f9fa8aaa9a34f1812;p=cgds.git diff --git a/test/t.Vector.c b/test/t.Vector.c index aa88c3a..7fde1e9 100644 --- a/test/t.Vector.c +++ b/test/t.Vector.c @@ -1,9 +1,9 @@ #include #include "cgds/Vector.h" -#include "test/helpers.h" -#include "test/lut.h" +#include "helpers.h" +#include "lut.h" -void t_vector_clear() //FTEST +void t_vector_clear() { Vector* v = vector_new(int); lu_assert(vector_empty(v)); @@ -25,7 +25,7 @@ void t_vector_clear() //FTEST vector_destroy(v); } -void t_vector_size() //FTEST +void t_vector_size() { Vector* v = vector_new(int); lu_assert(vector_empty(v)); @@ -47,7 +47,7 @@ void t_vector_size() //FTEST vector_destroy(v); } -void t_vector_push_pop_basic() //FTEST +void t_vector_push_pop_basic() { int n = 10; @@ -80,7 +80,7 @@ void t_vector_push_pop_basic() //FTEST vectorI_destroy(vi); } -void t_vector_push_pop_evolved() //FTEST +void t_vector_push_pop_evolved() { int n = 10; @@ -88,8 +88,8 @@ void t_vector_push_pop_evolved() //FTEST StructTest1* st1 = (StructTest1*) malloc(n * sizeof (StructTest1)); for (int i = 0; i < n; i++) { - st1[i].a = rand() % 42; - st1[i].b = (double) rand() / RAND_MAX; + st1[i].a = random() % 42; + st1[i].b = (double) random() / RAND_MAX; vector_push(v, *(st1 + i)); } for (int i = 0; i < n; i++) @@ -107,10 +107,10 @@ void t_vector_push_pop_evolved() //FTEST StructTest2* st2 = (StructTest2*) malloc(n * sizeof (StructTest2)); for (int i = 0; i < n; i++) { - st2[i].a = (float) rand() / RAND_MAX; + st2[i].a = (float) random() / RAND_MAX; st2[i].b = (StructTest1*) malloc(sizeof (StructTest1)); - st2[i].b->a = rand() % 42; - st2[i].b->b = (double) rand() / RAND_MAX; + st2[i].b->a = random() % 42; + st2[i].b->b = (double) random() / RAND_MAX; vector_push(v, st2 + i); } for (int i = 0; i < n; i++) @@ -126,13 +126,13 @@ void t_vector_push_pop_evolved() //FTEST vector_destroy(v); } -void t_vector_copy() //FTEST +void t_vector_copy() { int n = 10; Vector* v = vector_new(int); for (int i = 0; i < n; i++) - vector_push(v, rand() % 42); + vector_push(v, random() % 42); Vector* vc = vector_copy(v); lu_assert_int_eq(v->size, vc->size);