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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy