8000 Add validation tests for boolean expressions (#1505) · jacoco/jacoco@7162917 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7162917

Browse files
authored
Add validation tests for boolean expressions (#1505)
1 parent 4bc9267 commit 7162917

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/targets/BooleanExpressionsTarget.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static void main(String[] args) {
4646
if (t() & t()) { // assertFullyCovered(1, 1)
4747
nop();
4848
}
49+
nop(f() & f()); // assertFullyCovered()
4950

5051
/* 4. Conditional And */
5152
if (f() && f()) { // assertPartlyCovered(3, 1)
@@ -60,6 +61,8 @@ public static void main(String[] args) {
6061
if (t() && t()) { // assertFullyCovered(2, 2)
6162
nop();
6263
}
64+
nop(f() && f()); // assertPartlyCovered(3, 1)
65+
nop(t() && f()); // assertPartlyCovered(2, 2)
6366

6467
/* 5. Or */
6568
if (f() | f()) { // assertFullyCovered(1, 1)
@@ -74,6 +77,7 @@ public static void main(String[] args) {
7477
if (t() | t()) { // assertFullyCovered(1, 1)
7578
nop();
7679
}
80+
nop(f() | f()); // assertFullyCovered()
7781

7882
/* 6. Conditional Or */
7983
if (f() || f()) { // assertFullyCovered(2, 2)
@@ -88,6 +92,8 @@ public static void main(String[] args) {
8892
if (t() || t()) { // assertPartlyCovered(3, 1)
8993
nop();
9094
}
95+
nop(t() || f()); // assertPartlyCovered(3, 1)
96+
nop(f() || f()); // assertPartlyCovered(2, 2)
9197

9298
/* 7. Exclusive Or */
9399
if (f() ^ f()) { // assertFullyCovered(1, 1)
@@ -102,6 +108,7 @@ public static void main(String[] args) {
102108
if (t() ^ t()) { // assertFullyCovered(1, 1)
103109
nop();
104110
}
111+
nop(f() ^ f()); // assertFullyCovered()
105112

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

0 commit comments

Comments
 (0)
0