@@ -348,7 +348,6 @@ void TestsPrinter::genParametrizedTestCase(const Tests::MethodDescription &metho
348
348
openFiles (methodDescription, testCase);
349
349
parametrizedInitializeGlobalVariables (methodDescription, testCase);
350
350
parametrizedInitializeSymbolicStubs (methodDescription, testCase);
351
- parametrizedArrayParameters (methodDescription, testCase);
352
351
printClassObject (methodDescription, testCase);
353
352
printStubVariables (methodDescription, testCase);
354
353
printFunctionParameters (methodDescription, testCase, false );
@@ -453,20 +452,16 @@ void TestsPrinter::printFunctionParameters(const Tests::MethodDescription &metho
453
452
const Tests::MethodTestCase &testCase,
454
453
bool all) {
455
454
for (auto i = 0 ; i < testCase.paramValues .size (); i++) {
456
- bool containsLazy = ! testCase. paramValues [i]. lazyValues . empty () &&
457
- ! methodDescription.params [i]. isChangeable () ;
458
- if (!methodDescription. params [i].type . isFilePointer () &&
459
- (all || methodDescription. params [i]. type .isLValueReference () || containsLazy)) {
460
- Tests::MethodParam param = methodDescription. params [i];
461
- auto value = testCase.paramValues [i];
455
+ parametrizedArrayParameters (methodDescription, testCase, i);
456
+ const Tests::MethodParam ¶m = methodDescription.params [i];
457
+ bool containsLazy = !testCase. paramValues [i].lazyValues . empty () && !param. isChangeable ();
458
+ if (!param. type .isFilePointer () &&
459
+ (all || param. type . isLValueReference () || param. type . isSimple () && containsLazy)) {
460
+ Tests::TestCaseParamValue value = testCase.paramValues [i];
462
461
Tests::MethodParam valueParam = getValueParam (param);
463
- if (methodDescription.params [i].type .maybeJustPointer ()) {
464
- valueParam.type = valueParam.type .baseTypeObj ();
465
- }
466
462
value.name = valueParam.name ;
467
- verboseParameter (methodDescription, valueParam, value, true );
468
- if (param.type .isTwoDimensionalPointer ()) {
469
- gen2DPointer (param, true );
463
+ if (param.type .isLValueReference () || param.type .isSimple ()) {
464
+ verboseParameter (methodDescription, valueParam, value, true );
470
465
}
471
466
}
472
467
}
@@ -629,33 +624,37 @@ void TestsPrinter::globalParamsAsserts(const Tests::MethodDescription &methodDes
629
624
}
630
625
631
626
void TestsPrinter::parametrizedArrayParameters (const Tests::MethodDescription &methodDescription,
632
- const Tests::MethodTestCase &testCase) {
633
- for (auto i = 0 ; i < testCase.paramValues .size (); i++) {
634
- const auto ¶m = methodDescription.params [i];
635
- const auto &value = testCase.paramValues [i];
636
- if (types::TypesHandler::isArrayOfPointersToFunction (param.type )) {
637
- auto type = getTypedefFunctionPointer (methodDescription.name , param.name , false );
638
- std::string stubName = PrinterUtils::getFunctionPointerStubName (
639
- methodDescription.getClassTypeName (), methodDescription.name , param.name );
640
- strDeclareArrayOfFunctionPointerVar (type, param.name , stubName);
641
- } else if (types::TypesHandler::isCStringType (param.type )) {
642
- strDeclareArrayVar (param.type , param.name , types::PointerUsage::PARAMETER, value.view ->getEntryValue (this ), param.alignment );
643
- } else if (!param.type .isFilePointer () && (param.type .isObjectPointer () || param.type .isArray ())) {
644
- auto arrayType = types::TypesHandler::isVoid (param.type .baseTypeObj ())
645
- ? types::Type::minimalScalarPointerType (param.type .arraysSizes (types::PointerUsage::PARAMETER).size ())
646
- : param.type ;
647
- if (param.type .maybeJustPointer ()) {
648
- strDeclareVar (arrayType.baseType (), param.name , value.view ->getEntryValue (this ), param.alignment );
649
- } else {
650
- auto paramName = param.type .isTwoDimensionalPointer () ? param.underscoredName () : param.name ;
651
- strDeclareArrayVar (arrayType, paramName, types::PointerUsage::PARAMETER,
652
- value.view ->getEntryValue (this ), param.alignment , true );
653
- }
654
- }
655
- if (param.type .isTwoDimensionalPointer ()) {
656
- gen2DPointer (param, true );
627
+ const Tests::MethodTestCase &testCase,
628
+ int param_num) {
629
+ const auto ¶m = methodDescription.params [param_num];
630
+ const auto &value = testCase.paramValues [param_num];
631
+ if (types::TypesHandler::isArrayOfPointersToFunction (param.type )) {
632
+ auto type = getTypedefFunctionPointer (methodDescription.name , param.name , false );
633
+ std::string stubName = PrinterUtils::getFunctionPointerStubName (
634
+ methodDescription.getClassTypeName (), methodDescription.name , param.name );
635
+ strDeclareArrayOfFunctionPointerVar (type, param.name , stubName);
636
+ } else if (types::TypesHandler::isCStringType (param.type )) {
637
+ strDeclareArrayVar (param.type , param.name , types::PointerUsage::PARAMETER,
638
+ value.view ->getEntryValue (this ), param.alignment );
639
+ } else if (!param.type .isFilePointer () &&
640
+ (param.type .isObjectPointer () || param.type .isArray ())) {
641
+ auto arrayType = types::TypesHandler::isVoid (param.type .baseTypeObj ())
642
+ ? types::Type::minimalScalarPointerType (
643
+ param.type .arraysSizes (types::PointerUsage::PARAMETER).size ())
644
+ : param.type ;
645
+ if (param.type .maybeJustPointer ()) {
646
+ strDeclareVar (arrayType.baseType (), param.name , value.view ->getEntryValue (this ),
647
+ param.alignment );
648
+ } else {
649
+ auto paramName =
650
+ param.type .isTwoDimensionalPointer () ? param.underscoredName () : param.name ;
651
+ strDeclareArrayVar (arrayType, paramName, types::PointerUsage::PARAMETER,
652
+ value.view ->getEntryValue (this ), param.alignment , true );
657
653
}
658
654
}
655
+ if (param.type .isTwoDimensionalPointer ()) {
656
+ gen2DPointer (param, true );
657
+ }
659
658
}
660
659
661
660
void TestsPrinter::parametrizedAsserts (const Tests::MethodDescription &methodDescription,
0 commit comments