We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ae134e commit 890e605Copy full SHA for 890e605
1 file changed
test/testvalueflow.cpp
@@ -5112,6 +5112,27 @@ class TestValueFlow : public TestFixture {
5112
++it;
5113
ASSERT_EQUALS(0, it->intvalue);
5114
ASSERT(it->isPossible());
5115
+
5116
+ code = "void g(int*);\n"
5117
+ "void f(int* a) {\n"
5118
+ " for (int i = 0; i < 5; ++i) {\n"
5119
+ " g(&a[i]);\n"
5120
+ " }\n"
5121
+ "}\n";
5122
+ values = tokenValues(code, "i ]");
5123
+ ASSERT_EQUALS(4, values.size());
5124
+ it = values.begin();
5125
+ ASSERT_EQUALS(0, it->intvalue);
5126
+ ASSERT(it->isPossible());
5127
+ ++it;
5128
+ ASSERT_EQUALS(-1, it->intvalue);
5129
+ ASSERT(it->isImpossible());
5130
5131
+ ASSERT_EQUALS(4, it->intvalue);
5132
5133
5134
+ ASSERT_EQUALS(5, it->intvalue);
5135
5136
}
5137
5138
void valueFlowSubFunction() {
0 commit comments