diff --git a/server/src/Tests.cpp b/server/src/Tests.cpp index ca24eedce..b23f530a8 100644 --- a/server/src/Tests.cpp +++ b/server/src/Tests.cpp @@ -300,7 +300,7 @@ std::shared_ptr KTestObjectParser::structView(const std::vector return true; }; - if (prevFieldEndOffset < fieldStartOffset) { + if (prevFieldEndOffset < fieldStartOffset && curStruct.subType == types::SubType::Union) { // check an alignment gap for (int i = prevFieldEndOffset/8; i < fieldStartOffset/8; ++i) { if (dirtyCheck(i)) { @@ -392,12 +392,12 @@ std::shared_ptr KTestObjectParser::structView(const std::vector throw NoSuchTypeException(message); } - if (!dirtyInitializedField && sizeOfFieldToInitUnion < fieldLen) { + if (!dirtyInitializedField && sizeOfFieldToInitUnion < fieldLen && + curStruct.subType == types::SubType::Union) { fieldIndexToInitUnion = fieldIndex; sizeOfFieldToInitUnion = fieldLen; - } else { - dirtyInitializedStruct = true; } + dirtyInitializedStruct |= dirtyInitializedField; prevFieldEndOffset = fieldEndOffset; ++fieldIndex; } diff --git a/server/test/framework/Syntax_Tests.cpp b/server/test/framework/Syntax_Tests.cpp index 10463774e..963a693a7 100644 --- a/server/test/framework/Syntax_Tests.cpp +++ b/server/test/framework/Syntax_Tests.cpp @@ -1881,8 +1881,7 @@ namespace { [] (const tests::Tests::MethodTestCase& testCase) { return stoi(testCase.paramValues[0].view->getEntryValue(nullptr)) == stoi(testCase.paramValues[1].view->getEntryValue(nullptr)) && - StringUtils::startsWith(testCase.returnValue.view->getEntryValue(nullptr), - "{from_bytes({"); + testCase.returnValue.view->getEntryValue(nullptr) == "{{{'k', 1.010100e+00}}}"; }, [] (const tests::Tests::MethodTestCase& testCase) { return stoi(testCase.paramValues[0].view->getEntryValue(nullptr)) > @@ -1909,8 +1908,7 @@ namespace { [] (const tests::Tests::MethodTestCase& testCase) { return stoi(testCase.paramValues[0].view->getEntryValue(nullptr)) == stoi(testCase.paramValues[1].view->getEntryValue(nullptr)) && - StringUtils::startsWith(testCase.returnValue.view->getEntryValue(nullptr), - "{from_bytes({"); + testCase.returnValue.view->getEntryValue(nullptr) == "{{{'k', 1.010100e+00}}}"; }, [] (const tests::Tests::MethodTestCase& testCase) { return stoi(testCase.paramValues[0].view->getEntryValue(nullptr)) >