Skip to content

Commit

Permalink
Add validation tests for boolean expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
marchof authored and Godin committed Oct 3, 2023
1 parent 4bc9267 commit 6dac178
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static void main(String[] args) {
if (t() & t()) { // assertFullyCovered(1, 1)
nop();
}
nop(f() & f()); // assertFullyCovered()

/* 4. Conditional And */
if (f() && f()) { // assertPartlyCovered(3, 1)
Expand All @@ -60,6 +61,8 @@ public static void main(String[] args) {
if (t() && t()) { // assertFullyCovered(2, 2)
nop();
}
nop(f() && f()); // assertPartlyCovered(3, 1)
nop(t() && f()); // assertPartlyCovered(2, 2)

/* 5. Or */
if (f() | f()) { // assertFullyCovered(1, 1)
Expand All @@ -74,6 +77,7 @@ public static void main(String[] args) {
if (t() | t()) { // assertFullyCovered(1, 1)
nop();
}
nop(f() | f()); // assertFullyCovered()

/* 6. Conditional Or */
if (f() || f()) { // assertFullyCovered(2, 2)
Expand All @@ -88,6 +92,8 @@ public static void main(String[] args) {
if (t() || t()) { // assertPartlyCovered(3, 1)
nop();
}
nop(t() || f()); // assertPartlyCovered(3, 1)
nop(f() || f()); // assertPartlyCovered(2, 2)

/* 7. Exclusive Or */
if (f() ^ f()) { // assertFullyCovered(1, 1)
Expand All @@ -102,6 +108,7 @@ public static void main(String[] args) {
if (t() ^ t()) { // assertFullyCovered(1, 1)
nop();
}
nop(f() ^ f()); // assertFullyCovered()

/* 8. Conditional Operator */
nop(t() ? i1() : i2()); // assertPartlyCovered(1, 1)
Expand Down

0 comments on commit 6dac178

Please sign in to comment.