@@ -285,8 +285,9 @@ namespace tests {
285285 struct InitReference {
286286 std::string varName;
287287 std::string refName;
288- InitReference (std::string varName, std::string refName)
289- : varName(std::move(varName)), refName(std::move(refName)) {
288+ std::string typeName;
289+ InitReference (std::string varName, std::string refName, std::string typeName)
290+ : varName(std::move(varName)), refName(std::move(refName)), typeName(std::move(typeName)) {
290291 }
291292 };
292293
@@ -300,6 +301,7 @@ namespace tests {
300301 : type(std::move(type)), varName(std::move(varName)) {
301302 }
302303 };
304+
303305 struct MethodParam {
304306 types::Type type;
305307 string name;
@@ -340,6 +342,8 @@ namespace tests {
340342 string name;
341343 std::optional<uint64_t > alignment;
342344 shared_ptr<AbstractValueView> view;
345+ vector<MethodParam> lazyParams;
346+ vector<TestCaseParamValue> lazyValues;
343347 TestCaseParamValue () = default ;
344348 TestCaseParamValue (string name,
345349 std::optional<uint64_t > alignment,
@@ -357,7 +361,7 @@ namespace tests {
357361 vector<MethodParam> stubValuesTypes;
358362 vector<TestCaseParamValue> stubValues;
359363
360- MapAddressName fromAddressToName ;
364+ MapAddressName lazyAddressToName ;
361365 vector<InitReference> lazyReferences;
362366
363367 vector<TestCaseParamValue> funcParamValues;
@@ -376,25 +380,23 @@ namespace tests {
376380 vector<TestCaseParamValue> globalPreValues;
377381 vector<TestCaseParamValue> globalPostValues;
378382 std::optional <TestCaseParamValue> stdinValue;
379- vector<TypeAndVarName> lazyVariables;
380383 vector<InitReference> lazyReferences;
381384 vector<UTBotKTestObject> objects;
382385
383- MapAddressName fromAddressToName ;
386+ MapAddressName lazyAddressToName ;
384387
385388 vector<MethodParam> stubValuesTypes;
386389 vector<TestCaseParamValue> stubValues;
387390
388391 vector<TestCaseParamValue> paramValues;
389392 vector<TestCaseParamValue> paramPostValues;
390- vector<TestCaseParamValue> lazyValues;
391393 vector<TestCaseParamValue> stubParamValues;
392394 vector<MethodParam> stubParamTypes;
393- shared_ptr<AbstractValueView> returnValueView ;
395+ TestCaseParamValue returnValue ;
394396 std::optional<TestCaseParamValue> classPreValues;
395397 std::optional<TestCaseParamValue> classPostValues;
396398
397- bool isError () const ;
399+ [[nodiscard]] bool isError () const ;
398400 };
399401
400402 struct Modifiers {
@@ -463,7 +465,7 @@ namespace tests {
463465 return method;
464466 }
465467
466- bool hasChangeable () const {
468+ [[nodiscard]] bool hasChangeable () const {
467469 for (const auto & i : params) {
468470 if (i.isChangeable ()) {
469471 return true ;
@@ -472,18 +474,18 @@ namespace tests {
472474 return false ;
473475 }
474476
475- bool isClassMethod () const {
477+ [[nodiscard]] bool isClassMethod () const {
476478 return classObj.has_value ();
477479 }
478480
479- std::optional<std::string> getClassName () const {
481+ [[nodiscard]] std::optional<std::string> getClassName () const {
480482 if (isClassMethod ()) {
481483 return std::make_optional (classObj->name );
482484 }
483485 return std::nullopt ;
484486 }
485487
486- std::optional<std::string> getClassTypeName () const {
488+ [[nodiscard]] std::optional<std::string> getClassTypeName () const {
487489 if (isClassMethod ()) {
488490 return std::make_optional (classObj->type .typeName ());
489491 }
@@ -579,9 +581,14 @@ namespace tests {
579581 }
580582 };
581583
582- struct JsonNumAndType {
583- int num;
584- types::Type type;
584+ struct JsonIndAndParam {
585+ size_t jsonInd;
586+ Tests::MethodParam param;
587+ Tests::TestCaseParamValue& paramValue;
588+ JsonIndAndParam (size_t jsonInd, Tests::MethodParam param,
589+ Tests::TestCaseParamValue& paramValue) : jsonInd(jsonInd),
590+ param (std::move(param)), paramValue(paramValue) {
591+ }
585592 };
586593
587594 /* *
@@ -714,20 +721,32 @@ namespace tests {
714721 const std::unordered_map<string, types::Type>& methodNameToReturnTypeMap,
715722 vector<RawKleeParam> &rawKleeParams);
716723
724+ static void addToOrder (const vector<UTBotKTestObject> &objects,
725+ const std::string ¶mName,
726+ const types::Type ¶mType,
727+ Tests::TestCaseParamValue ¶mValue,
728+ std::vector<bool > &visited,
729+ std::queue<JsonIndAndParam>& order);
730+
717731 void assignTypeUnnamedVar (Tests::MethodTestCase &testCase,
718732 const Tests::MethodDescription &methodDescription);
719733
720734 void assignTypeStubVar (Tests::MethodTestCase &testCase,
721735 const Tests::MethodDescription &methodDescription);
722736
723- void workWithStructInBFS (std::queue<JsonNumAndType> &order, std::vector<bool > &visited,
724- const Offset &off, std::vector<UTBotKTestObject> &objects, const types::StructInfo &structInfo);
725-
726- int findFieldIndex (const types::StructInfo &structInfo, size_t offset);
737+ size_t findFieldIndex (const types::StructInfo &structInfo, size_t offset);
727738
728- int findObjectIndex (const std::vector<UTBotKTestObject> &objects, const std::string &name);
739+ types::Type traverseLazyInStruct (vector<bool > &visited,
740+ const types::Type &curVarType,
741+ size_t offset,
742+ const Tests::MethodTestCase &testCase,
743+ const Tests::MethodDescription &methodDescription);
729744
730- types::Type traverseStruct (const types::StructInfo &structInfo, size_t offset);
745+ shared_ptr<AbstractValueView> getLazyPointerView (const MapAddressName &fromAddressToName,
746+ vector<InitReference> &initReferences,
747+ const string &name,
748+ std::string res,
749+ const types::Type ¶mType) const ;
731750 };
732751 /* *
733752 * @brief This function is used for converting primiive value of a specific type
0 commit comments