parent
60fd53ec09
commit
b4561229cb
|
@ -241,6 +241,12 @@ private:
|
|||
inconclusive = false;
|
||||
ASSERT_EQUALS(false, isVariableChangedByFunctionCall(code, "x ) ;", &inconclusive));
|
||||
ASSERT_EQUALS(true, inconclusive);
|
||||
|
||||
code = "int f(int x) {\n"
|
||||
"return int(x);\n"
|
||||
"}\n";
|
||||
ASSERT_EQUALS(false, isVariableChangedByFunctionCall(code, "x ) ;", &inconclusive));
|
||||
TODO_ASSERT_EQUALS(false, true, inconclusive);
|
||||
}
|
||||
|
||||
bool nextAfterAstRightmostLeaf(const char code[], const char parentPattern[], const char rightPattern[]) {
|
||||
|
|
|
@ -4402,6 +4402,22 @@ private:
|
|||
ASSERT(value.isKnown());
|
||||
ASSERT_EQUALS(1, value.intvalue);
|
||||
|
||||
code = "bool f() {\n"
|
||||
" const int s = int( 4 );"
|
||||
" return s == 4;\n" // <- known value
|
||||
"}";
|
||||
value = valueOfTok(code, "==");
|
||||
ASSERT(value.isKnown());
|
||||
ASSERT_EQUALS(1, value.intvalue);
|
||||
|
||||
code = "bool f() {\n"
|
||||
" const int s = int{ 4 };"
|
||||
" return s == 4;\n" // <- known value
|
||||
"}";
|
||||
value = valueOfTok(code, "==");
|
||||
ASSERT(value.isKnown());
|
||||
ASSERT_EQUALS(1, value.intvalue);
|
||||
|
||||
// calculation with known result
|
||||
code = "int f(int x) { a = x & 0; }"; // <- & is 0
|
||||
value = valueOfTok(code, "&");
|
||||
|
|
Loading…
Reference in New Issue