Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
lcartey committed Oct 22, 2024
1 parent 2b275b6 commit 68c1daf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpp/autosar/test/rules/M0-1-2/InfeasiblePath.expected
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
| test.cpp:86:9:86:14 | ... < ... | The true path is infeasible because 0 (max value: 0) is always less than or equal to a (minimum value: 0). |
| test.cpp:117:7:117:7 | 0 | The path is unreachable in a template. |
| test.cpp:123:7:123:8 | ! ... | The path is unreachable in a template. |
| test.cpp:137:7:137:12 | ... > ... | The path is unreachable in a template. |
11 changes: 11 additions & 0 deletions cpp/autosar/test/rules/M0-1-2/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,15 @@ void test_infeasible_instantiates() {
template_infeasible_true_path<B>();
template_infeasible_false_path<A>();
template_infeasible_false_path<B>();
}

template <unsigned int i> int template_infeasible_relation() {
if (i > -1) { // NON_COMPLIANT - true path is infeasible in all circumstances
return 3;
}
}

void test_infeasible_relation() {
template_infeasible_relation<0>();
template_infeasible_relation<1>();
}

0 comments on commit 68c1daf

Please sign in to comment.