543 {
544 bool generated_instantiations = false;
545
546 for (typename TestInfoContainer::iterator test_it = tests_.begin();
547 test_it != tests_.end(); ++test_it) {
548 std::shared_ptr<TestInfo> test_info = *test_it;
549 for (typename InstantiationContainer::iterator gen_it =
550 instantiations_.begin(); gen_it != instantiations_.end();
551 ++gen_it) {
552 const std::string& instantiation_name = gen_it->name;
553 ParamGenerator<ParamType> generator((*gen_it->generator)());
555 const char*
file = gen_it->file;
556 int line = gen_it->line;
557
558 std::string test_suite_name;
559 if ( !instantiation_name.empty() )
560 test_suite_name = instantiation_name + "/";
561 test_suite_name += test_info->test_suite_base_name;
562
564 std::set<std::string> test_param_names;
566 generator.begin();
567 param_it != generator.end(); ++param_it, ++
i) {
568 generated_instantiations = true;
569
570 Message test_name_stream;
571
572 std::string param_name = name_func(
573 TestParamInfo<ParamType>(*param_it,
i));
574
576 << "Parameterized test name '" << param_name
577 <<
"' is invalid, in " <<
file
578 << " line " << line << std::endl;
579
581 << "Duplicate parameterized test name '" << param_name
582 <<
"', in " <<
file <<
" line " << line << std::endl;
583
584 test_param_names.insert(param_name);
585
586 if (!test_info->test_base_name.empty()) {
587 test_name_stream << test_info->test_base_name << "/";
588 }
589 test_name_stream << param_name;
591 test_suite_name.c_str(), test_name_stream.GetString().c_str(),
592 nullptr,
597 test_info->test_meta_factory->CreateTestFactory(*param_it));
598 }
599 }
600 }
601
602 if (!generated_instantiations) {
603
605 !tests_.empty());
606 }
607 }
#define GTEST_CHECK_(condition)
::std::string PrintToString(const T &value)
GTEST_API_ void InsertSyntheticTestCase(const std::string &name, CodeLocation location, bool has_test_p)
GTEST_API_ TestInfo * MakeAndRegisterTestInfo(const char *test_suite_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase *factory)
static SetUpTearDownSuiteFuncType GetTearDownCaseOrSuite(const char *filename, int line_num)
static SetUpTearDownSuiteFuncType GetSetUpCaseOrSuite(const char *filename, int line_num)
ParamIterator< T > iterator
std::string(const TestParamInfo< ParamType > &) ParamNameGeneratorFunc
const std::string & GetTestSuiteName() const override
TypeId GetTestSuiteTypeId() const override