Skip to content

Commit 20f0e00

Browse files
committed
Expand bool_condition_logical test
1 parent c28fb2d commit 20f0e00

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

tests/unit/bool_condition_logical.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,37 @@ int main() {
4545
}
4646
assert(side_effect == 0);
4747

48+
int chunk_count = 5;
49+
int max_chunks = 3;
50+
unsigned opts = 0x2u;
51+
if ((chunk_count > max_chunks) || (opts & 0x1u)) {
52+
assert(true);
53+
}
54+
if ((chunk_count < max_chunks) || (opts & 0x1u)) {
55+
assert(false);
56+
}
57+
58+
unsigned a_id = 1u;
59+
unsigned b_id = 2u;
60+
unsigned other_id = 3u;
61+
if (((a_id != other_id)) && ((b_id != other_id))) {
62+
assert(true);
63+
}
64+
65+
int reply_ms = -1;
66+
if ((p != nullptr) && (reply_ms < 0)) {
67+
assert(true);
68+
}
69+
70+
unsigned baller_count = 2u;
71+
bool ballers_complete = false;
72+
if ((baller_count > 1u) || !ballers_complete) {
73+
assert(true);
74+
}
75+
76+
if (((chunk_count > max_chunks)) || ((opts & 0x4u))) {
77+
assert(true);
78+
}
79+
4880
return 0;
4981
}

tests/unit/bool_condition_logical_c.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,37 @@ int main() {
4646
}
4747
assert(side_effect == 0);
4848

49+
int chunk_count = 5;
50+
int max_chunks = 3;
51+
unsigned opts = 0x2u;
52+
if ((chunk_count > max_chunks) || (opts & 0x1u)) {
53+
assert(true);
54+
}
55+
if ((chunk_count < max_chunks) || (opts & 0x1u)) {
56+
assert(false);
57+
}
58+
59+
unsigned a_id = 1u;
60+
unsigned b_id = 2u;
61+
unsigned other_id = 3u;
62+
if (((a_id != other_id)) && ((b_id != other_id))) {
63+
assert(true);
64+
}
65+
66+
int reply_ms = -1;
67+
if ((p != NULL) && (reply_ms < 0)) {
68+
assert(true);
69+
}
70+
71+
unsigned baller_count = 2u;
72+
bool ballers_complete = false;
73+
if ((baller_count > 1u) || !ballers_complete) {
74+
assert(true);
75+
}
76+
77+
if (((chunk_count > max_chunks)) || ((opts & 0x4u))) {
78+
assert(true);
79+
}
80+
4981
return 0;
5082
}

0 commit comments

Comments
 (0)