int-zjt
f4cf610159
[Coverage] Add gap region between binary operator '&& and ||' and RHS (#149085)
## Issue Summary
We identified an inaccuracy in line coverage reporting when short-circuit evaluation occurs in multi-line conditional expressions.
Specifically:
1. Un-executed conditions following line breaks may be incorrectly marked as covered
(e.g., conditionB in a non-executed && chain shows coverage)
```
1| |#include <iostream>
2| |
3| 1|int main() {
4| 1| bool conditionA = false;
5| 1| bool conditionB = true;
6| 1| if (conditionA &&
7| 1| conditionB) {
8| 0| std::cout << "IF-THEN" << std::endl;
9| 0| }
10| 1| return 0;
11| 1|}
```
2. Inconsistent coverage reporting across un-executed conditions
*(adjacent un-executed conditions may show 1 vs 0 line coverage)*
```
1| |#include <iostream>
2| |
3| 1|int main() {
4| 1| bool conditionA = false;
5| 1| bool conditionB = true;
6| 1| bool conditionC = true;
7| 1| if (conditionA &&
8| 1| (conditionB ||
9| 0| conditionC)) {
10| 0| std::cout << "IF-THEN" << std::endl;
11| 0| }
12| 1| return 0;
13| 1|}
```
This is resolved by inserting a GapRegion when mapping logical operators to isolate coverage contexts around short-circuit evaluation.
2025-08-08 12:50:52 -05:00
..
2022-02-09 09:11:49 -05:00
2024-10-20 12:30:35 +09:00
2021-01-05 09:51:51 -06:00
2021-01-05 13:35:52 -06:00
2024-01-04 12:29:18 -06:00
2022-02-09 09:11:49 -05:00
2024-05-24 12:06:43 +09:00
2021-03-04 11:52:43 -08:00
2022-02-09 09:11:49 -05:00
2020-08-18 13:26:19 -07:00
2024-02-18 15:11:08 -08:00
2022-02-09 09:11:49 -05:00
2020-09-21 12:42:53 -07:00
2023-09-15 17:06:04 -04:00
2022-02-09 09:11:49 -05:00
2020-09-21 12:42:53 -07:00
2020-09-21 12:42:53 -07:00
2024-10-20 12:30:35 +09:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00
2020-09-21 12:42:53 -07:00
2023-06-08 17:41:27 +02:00
2021-03-04 11:52:43 -08:00
2025-08-08 12:50:52 -05:00
2022-02-09 09:11:49 -05:00
2021-01-05 09:51:51 -06:00
2024-10-20 12:30:35 +09:00
2020-09-21 12:42:53 -07:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00
2024-05-24 12:06:43 +09:00
2021-02-18 11:41:04 -08:00
2024-06-14 19:31:56 +09:00
2024-06-14 19:31:56 +09:00
2024-06-14 19:31:56 +09:00
2024-06-14 19:31:56 +09:00
2024-06-14 19:31:56 +09:00
2025-03-01 15:58:39 +09:00
2024-10-20 12:30:35 +09:00
2024-10-20 12:30:35 +09:00
2020-09-21 12:42:53 -07:00
2021-02-18 11:41:04 -08:00
2020-09-21 12:42:53 -07:00
2023-04-19 23:00:26 +03:00
2022-02-09 09:11:49 -05:00
2024-12-28 17:47:09 +09:00
2024-04-22 12:37:38 -05:00
2023-05-04 19:19:52 +02:00
2025-01-18 19:16:33 +01:00
2024-12-19 08:41:07 +09:00
2024-07-10 17:11:12 +09:00
2024-05-24 13:04:18 -07:00
2025-05-19 15:49:26 -04:00
2022-02-09 09:11:49 -05:00
2021-03-04 11:52:43 -08:00
2020-09-21 12:42:53 -07:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00