projects
/
cgds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement HashTable + fix some extra blank spaces, remove Bool type (using bool ...
[cgds.git]
/
test
/
t.Vector.c
diff --git
a/test/t.Vector.c
b/test/t.Vector.c
index
8eb32bd
..
7fde1e9
100644
(file)
--- a/
test/t.Vector.c
+++ b/
test/t.Vector.c
@@
-1,7
+1,7
@@
#include <stdlib.h>
#include "cgds/Vector.h"
#include <stdlib.h>
#include "cgds/Vector.h"
-#include "
test/
helpers.h"
-#include "
test/
lut.h"
+#include "helpers.h"
+#include "lut.h"
void t_vector_clear()
{
void t_vector_clear()
{
@@
-88,8
+88,8
@@
void t_vector_push_pop_evolved()
StructTest1* st1 = (StructTest1*) malloc(n * sizeof (StructTest1));
for (int i = 0; i < n; i++)
{
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 = rand
om
() % 42;
+ st1[i].b = (double) rand
om
() / RAND_MAX;
vector_push(v, *(st1 + i));
}
for (int i = 0; i < n; i++)
vector_push(v, *(st1 + i));
}
for (int i = 0; i < n; i++)
@@
-107,10
+107,10
@@
void t_vector_push_pop_evolved()
StructTest2* st2 = (StructTest2*) malloc(n * sizeof (StructTest2));
for (int i = 0; i < n; i++)
{
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) rand
om
() / RAND_MAX;
st2[i].b = (StructTest1*) malloc(sizeof (StructTest1));
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 = rand
om
() % 42;
+ st2[i].b->b = (double) rand
om
() / RAND_MAX;
vector_push(v, st2 + i);
}
for (int i = 0; i < n; i++)
vector_push(v, st2 + i);
}
for (int i = 0; i < n; i++)
@@
-132,7
+132,7
@@
void t_vector_copy()
Vector* v = vector_new(int);
for (int i = 0; i < n; i++)
Vector* v = vector_new(int);
for (int i = 0; i < n; i++)
- vector_push(v, rand() % 42);
+ vector_push(v, rand
om
() % 42);
Vector* vc = vector_copy(v);
lu_assert_int_eq(v->size, vc->size);
Vector* vc = vector_copy(v);
lu_assert_int_eq(v->size, vc->size);