Improve test suite

This commit is contained in:
Patrick Pelissier committed 2023-02-24 19:56:56 +01:00
1 parent fbab093d52
commit 4140df5bfc
3 files changed
+10 -1

No files matched your search

+2
View File
@@ -98,6 +98,7 @@ static void test_uint(void)
for M_EACH(item, tree, UINT_OPLIST) {
assert (*item == tab2[k] );
k ++;
assert(k <= 2);
}
assert(k == 2);
@@ -109,6 +110,7 @@ static void test_uint(void)
for M_EACH(item, tree, UINT_OPLIST) {
assert (*item == tab3[k] );
k ++;
assert(k <= 3);
}
assert(k == 3);
+7
View File
@@ -354,7 +354,9 @@ static void test_double(void)
double *p = SnapshotDouble_get_write_buffer(s);
*p = 42.0;
p = SnapshotDouble_write(s);
assert(p != NULL);
const double *q = SnapshotDouble_read(s);
assert(q != NULL);
assert (*q == 42.0);
SnapshotDouble_clear(s);
}
@@ -364,9 +366,12 @@ static void test_doubleSPMC(void)
SnapshotDoubleSPMC s;
SnapshotDoubleSPMC_init(s, 1);
double *p = SnapshotDoubleSPMC_get_write_buffer(s);
assert(p != NULL);
*p = 42.0;
p = SnapshotDoubleSPMC_write(s);
assert(p != NULL);
const double *q = SnapshotDoubleSPMC_read_start(s);
assert(q != NULL);
assert (*q == 42.0);
SnapshotDoubleSPMC_read_end(s, q);
SnapshotDoubleSPMC_clear(s);
@@ -377,9 +382,11 @@ static void test_doubleMPMC(void)
SnapshotDoubleMPMC s;
SnapshotDoubleMPMC_init(s, 1, 1);
double *p = SnapshotDoubleMPMC_write_start(s);
assert(p != NULL);
*p = 42.0;
SnapshotDoubleMPMC_write_end(s, p);
const double *q = SnapshotDoubleMPMC_read_start(s);
assert(q != NULL);
assert (*q == 42.0);
SnapshotDoubleMPMC_read_end(s, q);
SnapshotDoubleMPMC_clear(s);
+1 -1
View File
@@ -467,7 +467,7 @@ static void test_io(void)
tree_insert_down(root, 1);
tree_insert_left(it, 3);
tree_it_t it4 = tree_insert_right(it, 4);
root = tree_insert_up(root, -1);
tree_insert_up(root, -1);
tree_insert_up(it, 5);
tree_insert_child(it4, 6);
tree_it_t it7 = tree_insert_child(it4, 7);