Skip to content

Commit

Permalink
Update testvalueflow.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Sep 26, 2024
1 parent 7ddc4f4 commit d0797ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/testvalueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6992,6 +6992,14 @@ class TestValueFlow : public TestFixture {
" if (s.empty()) {}\n"
"}";
ASSERT_EQUALS("", isPossibleContainerSizeValue(tokenValues(code, "s . empty"), 0));

code = "int f(const std::string& str) {\n"
" std::istringstream iss(str);\n"
" std::vector<std::string> v{ std::istream_iterator<std::string>(iss), {} };\n"
" auto x = v.size();\n"
" return x;\n"
"}";
ASSERT_EQUALS(false, testValueOfXKnown(code, 5U, 2));
}

void valueFlowContainerElement()
Expand Down

0 comments on commit d0797ad

Please sign in to comment.