CI: Fix testrunner

This commit is contained in:
Daniel Marjamäki 2020-12-13 15:51:20 +01:00
parent 6fb1a81eae
commit 81c3ac738d
2 changed files with 7 additions and 3 deletions

View File

@ -268,7 +268,7 @@ namespace {
if (tok->index() == 0)
return;
const std::string &symbolicExpression = value->getSymbolicExpression();
if (std::isdigit(symbolicExpression[0]) || value->type == ExprEngine::ValueType::BinOpResult)
if (std::isdigit(symbolicExpression[0]) || value->type == ExprEngine::ValueType::BinOpResult || value->type == ExprEngine::ValueType::UninitValue)
return;
if (mSymbols.find(symbolicExpression) != mSymbols.end())
return;

View File

@ -333,13 +333,15 @@ private:
Settings settings;
LOAD_LIB_2(settings.library, "std.cfg");
ASSERT_EQUALS("1:26: $3=IntRange(0:2147483647)\n"
ASSERT_EQUALS("1:26: $4=ArrayValue([$3],[:]=$2)\n"
"1:26: $3=IntRange(0:2147483647)\n"
"1:26: $2=IntRange(-128:127)\n"
"1:27: 0:memory:{s=($4,[$3],[:]=$2)}\n",
trackExecution("void foo() { std::string s; }", &settings));
ASSERT_EQUALS("1:52: $3=IntRange(0:2147483647)\n"
ASSERT_EQUALS("1:52: $4=ArrayValue([$3],[:]=$2)\n"
"1:52: $3=IntRange(0:2147483647)\n"
"1:52: $2=IntRange(-128:127)\n"
"1:66: 0:memory:{s=($4,[$3],[:]=$2)}\n",
trackExecution("std::string getName(int); void foo() { std::string s = getName(1); }", &settings));
@ -628,6 +630,7 @@ private:
const char code[] = "int buf[10];\n"
"void f() { int x = buf[0]; }";
ASSERT_EQUALS("2:16: $2:0=IntRange(-2147483648:2147483647)\n"
"2:20: $1=ArrayValue([10],[:]=$2)\n"
"2:20: $2=IntRange(-2147483648:2147483647)\n"
"2:26: 0:memory:{buf=($1,[10],[:]=$2) x=$2:0}\n",
trackExecution(code));
@ -641,6 +644,7 @@ private:
"}";
ASSERT_EQUALS("1:14: $1=IntRange(-2147483648:2147483647)\n"
"1:14: 0:memory:{x=$1}\n"
"2:7: $2=ArrayValue([3][4][5],[:]=?)\n"
"2:19: 0:memory:{x=$1 buf=($2,[3][4][5],[:]=?)}\n"
"3:20: 0:memory:{x=$1 buf=($2,[3][4][5],[:]=?,[((20)*($1))+(7)]=10)}\n",
trackExecution(code));