Skip to content

Commit 719e661

Browse files
Update testvalueflow.cpp
1 parent 6c9bcbc commit 719e661

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9225,6 +9225,19 @@ class TestValueFlow : public TestFixture {
92259225
"}\n";
92269226
ASSERT_EQUALS(false, testValueOfX(code, 5U, 1));
92279227
ASSERT_EQUALS(false, testValueOfX(code, 5U, 0));
9228+
9229+
code = "bool f() {\n"
9230+
" std::string s1, s2;\n"
9231+
" bool x = (s1 == s2);\n"
9232+
" return x;\n"
9233+
"}\n"
9234+
"bool g() {\n"
9235+
" std::string s1, s2;\n"
9236+
" bool x = (s1 != s2);\n"
9237+
" return x;\n"
9238+
"}\n";
9239+
ASSERT_EQUALS(true, testValueOfXKnown(code, 4U, 1));
9240+
ASSERT_EQUALS(true, testValueOfXKnown(code, 9U, 0));
92289241
}
92299242

92309243
void valueFlowBailoutIncompleteVar() {

0 commit comments

Comments
 (0)