@@ -692,6 +692,8 @@ void KTestObjectParser::parseTestCases(const UTBotKTestList &cases,
692692 // if all of the data characters are not printable the case is skipped
693693 continue ;
694694 }
695+ swap (testCase.classPreValues , testCaseDescription.classPreValues );
696+ swap (testCase.classPostValues , testCaseDescription.classPostValues );
695697 swap (testCase.globalPreValues , testCaseDescription.globalPreValues );
696698 swap (testCase.globalPostValues , testCaseDescription.globalPostValues );
697699 swap (testCase.paramPostValues , testCaseDescription.paramPostValues );
@@ -794,6 +796,25 @@ KTestObjectParser::parseTestCaseParams(const UTBotKTest &ktest,
794796 }
795797
796798 const RawKleeParam emptyKleeParam = {" " , {}};
799+
800+ if (methodDescription.isClassMethod ()) {
801+ auto methodParam = methodDescription.classObj .value ();
802+ shared_ptr<AbstractValueView> testParamView;
803+ auto paramType = methodParam.type .maybeJustPointer () ? methodParam.type .baseTypeObj () : methodParam.type ;
804+ if (CollectionUtils::containsKey (methodDescription.functionPointers , methodParam.name )) {
805+ testParamView = testParameterView (
806+ emptyKleeParam, { paramType, methodParam.name }, PointerUsage::PARAMETER, testCaseDescription.fromAddressToName ,
807+ testCaseDescription.lazyReferences , methodDescription);
808+ } else {
809+ const auto kleeParam = getKleeParamOrThrow (rawKleeParams, methodParam.name );
810+ testParamView = testParameterView (kleeParam, {paramType, methodParam.name }, PointerUsage::PARAMETER,
811+ testCaseDescription.fromAddressToName , testCaseDescription.lazyReferences ,
812+ methodDescription);
813+ }
814+ testCaseDescription.classPreValues = { methodParam.name , methodParam.alignment , testParamView };
815+ processClassPostValue (testCaseDescription, methodParam, rawKleeParams);
816+ }
817+
797818 for (auto &methodParam : methodDescription.params ) {
798819 shared_ptr<AbstractValueView> testParamView;
799820 auto paramType = methodParam.type .maybeJustPointer () ? methodParam.type .baseTypeObj () : methodParam.type ;
@@ -898,6 +919,20 @@ void KTestObjectParser::processGlobalParamPostValue(Tests::TestCaseDescription &
898919 testCaseDescription.globalPostValues .emplace_back ( globalParam.name , globalParam.alignment , testParamView );
899920}
900921
922+ void KTestObjectParser::processClassPostValue (Tests::TestCaseDescription &testCaseDescription,
923+ const Tests::MethodParam ¶m,
924+ vector<RawKleeParam> &rawKleeParams) {
925+ const auto usage = types::PointerUsage::PARAMETER;
926+ auto symbolicVariable = KleeUtils::postSymbolicVariable (param.name );
927+ auto kleeParam = getKleeParamOrThrow (rawKleeParams, symbolicVariable);
928+ types::Type paramType = param.type .arrayCloneMultiDim (usage);
929+ auto type = typesHandler.getReturnTypeToCheck (paramType);
930+ Tests::TypeAndVarName typeAndVarName{ type, param.name };
931+ auto testParamView = testParameterView (kleeParam, typeAndVarName, usage, testCaseDescription.fromAddressToName ,
932+ testCaseDescription.lazyReferences );
933+ testCaseDescription.classPostValues = { param.name , param.alignment , testParamView };
934+ }
935+
901936void KTestObjectParser::processParamPostValue (Tests::TestCaseDescription &testCaseDescription,
902937 const Tests::MethodParam ¶m,
903938 vector<RawKleeParam> &rawKleeParams) {
@@ -961,9 +996,10 @@ shared_ptr<AbstractValueView> KTestObjectParser::testParameterView(
961996 return arrayView (rawData, paramType.baseTypeObj (), rawData.size (), 0 , usage);
962997 }
963998 case TypeKind::FUNCTION_POINTER:
964- if (!testingMethod.has_value ())
999+ if (!testingMethod.has_value ()) {
9651000 return functionPointerView (std::nullopt , " " , param.varName );
966- return functionPointerView (testingMethod->className , testingMethod->name , param.varName );
1001+ }
1002+ return functionPointerView (testingMethod->getClassTypeName (), testingMethod->name , param.varName );
9671003 case TypeKind::ENUM:
9681004 enumInfo = typesHandler.getEnumInfo (paramType);
9691005 return enumView (rawData, enumInfo, 0 , rawData.size ());
0 commit comments