| 1252 | } |
| 1253 | |
| 1254 | void hasKnownIntValue() const { |
| 1255 | // pointer might be NULL |
| 1256 | ValueFlow::Value v1(0); |
| 1257 | |
| 1258 | // pointer points at buffer that is 2 bytes |
| 1259 | ValueFlow::Value v2(2); |
| 1260 | v2.valueType = ValueFlow::Value::ValueType::BUFFER_SIZE; |
| 1261 | v2.setKnown(); |
| 1262 | |
| 1263 | auto tokensFrontBack = std::make_shared<TokensFrontBack>(); |
| 1264 | Token token(list, std::move(tokensFrontBack)); |
| 1265 | ASSERT_EQUALS(true, token.addValue(v1)); |
| 1266 | ASSERT_EQUALS(true, token.addValue(v2)); |
| 1267 | ASSERT_EQUALS(false, token.hasKnownIntValue()); |
| 1268 | } |
| 1269 | |
| 1270 | #define assert_tok(...) _assert_tok(__FILE__, __LINE__, __VA_ARGS__) |
| 1271 | void _assert_tok(const char* file, int line, const Token* tok, Token::Type t, bool l = false, bool std = false, bool ctrl = false) const |
no test coverage detected