gtest-param-util.h
Go to the documentation of this file.
1 // Copyright 2008 Google Inc.
2 // All Rights Reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 
31 // Type and function utilities for implementing parameterized tests.
32 
33 // GOOGLETEST_CM0001 DO NOT DELETE
34 
35 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
36 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
37 
38 #include <ctype.h>
39 
40 #include <iterator>
41 #include <memory>
42 #include <set>
43 #include <tuple>
44 #include <utility>
45 #include <vector>
46 
49 #include "gtest/gtest-printers.h"
50 
51 namespace testing {
52 // Input to a parameterized test name generator, describing a test parameter.
53 // Consists of the parameter value and the integer parameter index.
54 template <class ParamType>
55 struct TestParamInfo {
56  TestParamInfo(const ParamType& a_param, size_t an_index) :
57  param(a_param),
58  index(an_index) {}
59  ParamType param;
60  size_t index;
61 };
62 
63 // A builtin parameterized test name generator which returns the result of
64 // testing::PrintToString.
66  template <class ParamType>
68  return PrintToString(info.param);
69  }
70 };
71 
72 namespace internal {
73 
74 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
75 // Utility Functions
76 
77 // Outputs a message explaining invalid registration of different
78 // fixture class for the same test suite. This may happen when
79 // TEST_P macro is used to define two tests with the same name
80 // but in different namespaces.
81 GTEST_API_ void ReportInvalidTestSuiteType(const char* test_suite_name,
82  CodeLocation code_location);
83 
84 template <typename> class ParamGeneratorInterface;
85 template <typename> class ParamGenerator;
86 
87 // Interface for iterating over elements provided by an implementation
88 // of ParamGeneratorInterface<T>.
89 template <typename T>
91  public:
93  // A pointer to the base generator instance.
94  // Used only for the purposes of iterator comparison
95  // to make sure that two iterators belong to the same generator.
96  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
97  // Advances iterator to point to the next element
98  // provided by the generator. The caller is responsible
99  // for not calling Advance() on an iterator equal to
100  // BaseGenerator()->End().
101  virtual void Advance() = 0;
102  // Clones the iterator object. Used for implementing copy semantics
103  // of ParamIterator<T>.
104  virtual ParamIteratorInterface* Clone() const = 0;
105  // Dereferences the current iterator and provides (read-only) access
106  // to the pointed value. It is the caller's responsibility not to call
107  // Current() on an iterator equal to BaseGenerator()->End().
108  // Used for implementing ParamGenerator<T>::operator*().
109  virtual const T* Current() const = 0;
110  // Determines whether the given iterator and other point to the same
111  // element in the sequence generated by the generator.
112  // Used for implementing ParamGenerator<T>::operator==().
113  virtual bool Equals(const ParamIteratorInterface& other) const = 0;
114 };
115 
116 // Class iterating over elements provided by an implementation of
117 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
118 // and implements the const forward iterator concept.
119 template <typename T>
121  public:
122  typedef T value_type;
123  typedef const T& reference;
124  typedef ptrdiff_t difference_type;
125 
126  // ParamIterator assumes ownership of the impl_ pointer.
127  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
129  if (this != &other)
130  impl_.reset(other.impl_->Clone());
131  return *this;
132  }
133 
134  const T& operator*() const { return *impl_->Current(); }
135  const T* operator->() const { return impl_->Current(); }
136  // Prefix version of operator++.
138  impl_->Advance();
139  return *this;
140  }
141  // Postfix version of operator++.
142  ParamIterator operator++(int /*unused*/) {
143  ParamIteratorInterface<T>* clone = impl_->Clone();
144  impl_->Advance();
145  return ParamIterator(clone);
146  }
147  bool operator==(const ParamIterator& other) const {
148  return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
149  }
150  bool operator!=(const ParamIterator& other) const {
151  return !(*this == other);
152  }
153 
154  private:
155  friend class ParamGenerator<T>;
156  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
157  std::unique_ptr<ParamIteratorInterface<T> > impl_;
158 };
159 
160 // ParamGeneratorInterface<T> is the binary interface to access generators
161 // defined in other translation units.
162 template <typename T>
164  public:
165  typedef T ParamType;
166 
168 
169  // Generator interface definition
170  virtual ParamIteratorInterface<T>* Begin() const = 0;
171  virtual ParamIteratorInterface<T>* End() const = 0;
172 };
173 
174 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
175 // compatible with the STL Container concept.
176 // This class implements copy initialization semantics and the contained
177 // ParamGeneratorInterface<T> instance is shared among all copies
178 // of the original object. This is possible because that instance is immutable.
179 template<typename T>
180 class ParamGenerator {
181  public:
183 
185  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
186 
188  impl_ = other.impl_;
189  return *this;
190  }
191 
192  iterator begin() const { return iterator(impl_->Begin()); }
193  iterator end() const { return iterator(impl_->End()); }
194 
195  private:
196  std::shared_ptr<const ParamGeneratorInterface<T> > impl_;
197 };
198 
199 // Generates values from a range of two comparable values. Can be used to
200 // generate sequences of user-defined types that implement operator+() and
201 // operator<().
202 // This class is used in the Range() function.
203 template <typename T, typename IncrementT>
205  public:
206  RangeGenerator(T begin, T end, IncrementT step)
207  : begin_(begin), end_(end),
208  step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
209  ~RangeGenerator() override {}
210 
211  ParamIteratorInterface<T>* Begin() const override {
212  return new Iterator(this, begin_, 0, step_);
213  }
214  ParamIteratorInterface<T>* End() const override {
215  return new Iterator(this, end_, end_index_, step_);
216  }
217 
218  private:
219  class Iterator : public ParamIteratorInterface<T> {
220  public:
222  IncrementT step)
223  : base_(base), value_(value), index_(index), step_(step) {}
224  ~Iterator() override {}
225 
226  const ParamGeneratorInterface<T>* BaseGenerator() const override {
227  return base_;
228  }
229  void Advance() override {
230  value_ = static_cast<T>(value_ + step_);
231  index_++;
232  }
233  ParamIteratorInterface<T>* Clone() const override {
234  return new Iterator(*this);
235  }
236  const T* Current() const override { return &value_; }
237  bool Equals(const ParamIteratorInterface<T>& other) const override {
238  // Having the same base generator guarantees that the other
239  // iterator is of the same type and we can downcast.
241  << "The program attempted to compare iterators "
242  << "from different generators." << std::endl;
243  const int other_index =
244  CheckedDowncastToActualType<const Iterator>(&other)->index_;
245  return index_ == other_index;
246  }
247 
248  private:
249  Iterator(const Iterator& other)
251  base_(other.base_), value_(other.value_), index_(other.index_),
252  step_(other.step_) {}
253 
254  // No implementation - assignment is unsupported.
255  void operator=(const Iterator& other);
256 
259  int index_;
260  const IncrementT step_;
261  }; // class RangeGenerator::Iterator
262 
263  static int CalculateEndIndex(const T& begin,
264  const T& end,
265  const IncrementT& step) {
266  int end_index = 0;
267  for (T i = begin; i < end; i = static_cast<T>(i + step))
268  end_index++;
269  return end_index;
270  }
271 
272  // No implementation - assignment is unsupported.
273  void operator=(const RangeGenerator& other);
274 
275  const T begin_;
276  const T end_;
277  const IncrementT step_;
278  // The index for the end() iterator. All the elements in the generated
279  // sequence are indexed (0-based) to aid iterator comparison.
280  const int end_index_;
281 }; // class RangeGenerator
282 
283 
284 // Generates values from a pair of STL-style iterators. Used in the
285 // ValuesIn() function. The elements are copied from the source range
286 // since the source can be located on the stack, and the generator
287 // is likely to persist beyond that stack frame.
288 template <typename T>
290  public:
291  template <typename ForwardIterator>
292  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
293  : container_(begin, end) {}
295 
296  ParamIteratorInterface<T>* Begin() const override {
297  return new Iterator(this, container_.begin());
298  }
299  ParamIteratorInterface<T>* End() const override {
300  return new Iterator(this, container_.end());
301  }
302 
303  private:
304  typedef typename ::std::vector<T> ContainerType;
305 
306  class Iterator : public ParamIteratorInterface<T> {
307  public:
309  typename ContainerType::const_iterator iterator)
310  : base_(base), iterator_(iterator) {}
311  ~Iterator() override {}
312 
313  const ParamGeneratorInterface<T>* BaseGenerator() const override {
314  return base_;
315  }
316  void Advance() override {
317  ++iterator_;
318  value_.reset();
319  }
320  ParamIteratorInterface<T>* Clone() const override {
321  return new Iterator(*this);
322  }
323  // We need to use cached value referenced by iterator_ because *iterator_
324  // can return a temporary object (and of type other then T), so just
325  // having "return &*iterator_;" doesn't work.
326  // value_ is updated here and not in Advance() because Advance()
327  // can advance iterator_ beyond the end of the range, and we cannot
328  // detect that fact. The client code, on the other hand, is
329  // responsible for not calling Current() on an out-of-range iterator.
330  const T* Current() const override {
331  if (value_.get() == nullptr) value_.reset(new T(*iterator_));
332  return value_.get();
333  }
334  bool Equals(const ParamIteratorInterface<T>& other) const override {
335  // Having the same base generator guarantees that the other
336  // iterator is of the same type and we can downcast.
338  << "The program attempted to compare iterators "
339  << "from different generators." << std::endl;
340  return iterator_ ==
341  CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
342  }
343 
344  private:
345  Iterator(const Iterator& other)
346  // The explicit constructor call suppresses a false warning
347  // emitted by gcc when supplied with the -Wextra option.
349  base_(other.base_),
350  iterator_(other.iterator_) {}
351 
353  typename ContainerType::const_iterator iterator_;
354  // A cached value of *iterator_. We keep it here to allow access by
355  // pointer in the wrapping iterator's operator->().
356  // value_ needs to be mutable to be accessed in Current().
357  // Use of std::unique_ptr helps manage cached value's lifetime,
358  // which is bound by the lifespan of the iterator itself.
359  mutable std::unique_ptr<const T> value_;
360  }; // class ValuesInIteratorRangeGenerator::Iterator
361 
362  // No implementation - assignment is unsupported.
363  void operator=(const ValuesInIteratorRangeGenerator& other);
364 
366 }; // class ValuesInIteratorRangeGenerator
367 
368 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
369 //
370 // Default parameterized test name generator, returns a string containing the
371 // integer test parameter index.
372 template <class ParamType>
374  Message name_stream;
375  name_stream << info.index;
376  return name_stream.GetString();
377 }
378 
379 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
380 //
381 // Parameterized test name overload helpers, which help the
382 // INSTANTIATE_TEST_SUITE_P macro choose between the default parameterized
383 // test name generator and user param name generator.
384 template <class ParamType, class ParamNameGenFunctor>
385 ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
386  return func;
387 }
388 
389 template <class ParamType>
392 };
393 
394 template <class ParamType>
396  return DefaultParamName;
397 }
398 
399 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
400 //
401 // Stores a parameter value and later creates tests parameterized with that
402 // value.
403 template <class TestClass>
405  public:
406  typedef typename TestClass::ParamType ParamType;
407  explicit ParameterizedTestFactory(ParamType parameter) :
408  parameter_(parameter) {}
409  Test* CreateTest() override {
410  TestClass::SetParam(&parameter_);
411  return new TestClass();
412  }
413 
414  private:
416 
418 };
419 
420 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
421 //
422 // TestMetaFactoryBase is a base class for meta-factories that create
423 // test factories for passing into MakeAndRegisterTestInfo function.
424 template <class ParamType>
426  public:
427  virtual ~TestMetaFactoryBase() {}
428 
429  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
430 };
431 
432 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
433 //
434 // TestMetaFactory creates test factories for passing into
435 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
436 // ownership of test factory pointer, same factory object cannot be passed
437 // into that method twice. But ParameterizedTestSuiteInfo is going to call
438 // it for each Test/Parameter value combination. Thus it needs meta factory
439 // creator class.
440 template <class TestSuite>
442  : public TestMetaFactoryBase<typename TestSuite::ParamType> {
443  public:
444  using ParamType = typename TestSuite::ParamType;
445 
447 
449  return new ParameterizedTestFactory<TestSuite>(parameter);
450  }
451 
452  private:
454 };
455 
456 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
457 //
458 // ParameterizedTestSuiteInfoBase is a generic interface
459 // to ParameterizedTestSuiteInfo classes. ParameterizedTestSuiteInfoBase
460 // accumulates test information provided by TEST_P macro invocations
461 // and generators provided by INSTANTIATE_TEST_SUITE_P macro invocations
462 // and uses that information to register all resulting test instances
463 // in RegisterTests method. The ParameterizeTestSuiteRegistry class holds
464 // a collection of pointers to the ParameterizedTestSuiteInfo objects
465 // and calls RegisterTests() on each of them when asked.
467  public:
469 
470  // Base part of test suite name for display purposes.
471  virtual const std::string& GetTestSuiteName() const = 0;
472  // Test case id to verify identity.
473  virtual TypeId GetTestSuiteTypeId() const = 0;
474  // UnitTest class invokes this method to register tests in this
475  // test suite right before running them in RUN_ALL_TESTS macro.
476  // This method should not be called more then once on any single
477  // instance of a ParameterizedTestSuiteInfoBase derived class.
478  virtual void RegisterTests() = 0;
479 
480  protected:
482 
483  private:
485 };
486 
487 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
488 //
489 // ParameterizedTestSuiteInfo accumulates tests obtained from TEST_P
490 // macro invocations for a particular test suite and generators
491 // obtained from INSTANTIATE_TEST_SUITE_P macro invocations for that
492 // test suite. It registers tests with all values generated by all
493 // generators when asked.
494 template <class TestSuite>
496  public:
497  // ParamType and GeneratorCreationFunc are private types but are required
498  // for declarations of public methods AddTestPattern() and
499  // AddTestSuiteInstantiation().
500  using ParamType = typename TestSuite::ParamType;
501  // A function that returns an instance of appropriate generator type.
502  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
504 
505  explicit ParameterizedTestSuiteInfo(const char* name,
506  CodeLocation code_location)
507  : test_suite_name_(name), code_location_(code_location) {}
508 
509  // Test case base name for display purposes.
510  const std::string& GetTestSuiteName() const override {
511  return test_suite_name_;
512  }
513  // Test case id to verify identity.
514  TypeId GetTestSuiteTypeId() const override { return GetTypeId<TestSuite>(); }
515  // TEST_P macro uses AddTestPattern() to record information
516  // about a single test in a LocalTestInfo structure.
517  // test_suite_name is the base name of the test suite (without invocation
518  // prefix). test_base_name is the name of an individual test without
519  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
520  // test suite base name and DoBar is test base name.
521  void AddTestPattern(const char* test_suite_name, const char* test_base_name,
522  TestMetaFactoryBase<ParamType>* meta_factory) {
523  tests_.push_back(std::shared_ptr<TestInfo>(
524  new TestInfo(test_suite_name, test_base_name, meta_factory)));
525  }
526  // INSTANTIATE_TEST_SUITE_P macro uses AddGenerator() to record information
527  // about a generator.
528  int AddTestSuiteInstantiation(const std::string& instantiation_name,
529  GeneratorCreationFunc* func,
530  ParamNameGeneratorFunc* name_func,
531  const char* file, int line) {
532  instantiations_.push_back(
533  InstantiationInfo(instantiation_name, func, name_func, file, line));
534  return 0; // Return value used only to run this method in namespace scope.
535  }
536  // UnitTest class invokes this method to register tests in this test suite
537  // test suites right before running tests in RUN_ALL_TESTS macro.
538  // This method should not be called more then once on any single
539  // instance of a ParameterizedTestSuiteInfoBase derived class.
540  // UnitTest has a guard to prevent from calling this method more then once.
541  void RegisterTests() override {
542  for (typename TestInfoContainer::iterator test_it = tests_.begin();
543  test_it != tests_.end(); ++test_it) {
544  std::shared_ptr<TestInfo> test_info = *test_it;
545  for (typename InstantiationContainer::iterator gen_it =
546  instantiations_.begin(); gen_it != instantiations_.end();
547  ++gen_it) {
548  const std::string& instantiation_name = gen_it->name;
549  ParamGenerator<ParamType> generator((*gen_it->generator)());
550  ParamNameGeneratorFunc* name_func = gen_it->name_func;
551  const char* file = gen_it->file;
552  int line = gen_it->line;
553 
554  std::string test_suite_name;
555  if ( !instantiation_name.empty() )
556  test_suite_name = instantiation_name + "/";
557  test_suite_name += test_info->test_suite_base_name;
558 
559  size_t i = 0;
560  std::set<std::string> test_param_names;
561  for (typename ParamGenerator<ParamType>::iterator param_it =
562  generator.begin();
563  param_it != generator.end(); ++param_it, ++i) {
564  Message test_name_stream;
565 
566  std::string param_name = name_func(
567  TestParamInfo<ParamType>(*param_it, i));
568 
569  GTEST_CHECK_(IsValidParamName(param_name))
570  << "Parameterized test name '" << param_name
571  << "' is invalid, in " << file
572  << " line " << line << std::endl;
573 
574  GTEST_CHECK_(test_param_names.count(param_name) == 0)
575  << "Duplicate parameterized test name '" << param_name
576  << "', in " << file << " line " << line << std::endl;
577 
578  test_param_names.insert(param_name);
579 
580  test_name_stream << test_info->test_base_name << "/" << param_name;
582  test_suite_name.c_str(), test_name_stream.GetString().c_str(),
583  nullptr, // No type parameter.
584  PrintToString(*param_it).c_str(), code_location_,
588  test_info->test_meta_factory->CreateTestFactory(*param_it));
589  } // for param_it
590  } // for gen_it
591  } // for test_it
592  } // RegisterTests
593 
594  private:
595  // LocalTestInfo structure keeps information about a single test registered
596  // with TEST_P macro.
597  struct TestInfo {
598  TestInfo(const char* a_test_suite_base_name, const char* a_test_base_name,
599  TestMetaFactoryBase<ParamType>* a_test_meta_factory)
600  : test_suite_base_name(a_test_suite_base_name),
601  test_base_name(a_test_base_name),
602  test_meta_factory(a_test_meta_factory) {}
603 
606  const std::unique_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
607  };
608  using TestInfoContainer = ::std::vector<std::shared_ptr<TestInfo> >;
609  // Records data received from INSTANTIATE_TEST_SUITE_P macros:
610  // <Instantiation name, Sequence generator creation function,
611  // Name generator function, Source file, Source line>
614  GeneratorCreationFunc* generator_in,
615  ParamNameGeneratorFunc* name_func_in,
616  const char* file_in,
617  int line_in)
618  : name(name_in),
619  generator(generator_in),
620  name_func(name_func_in),
621  file(file_in),
622  line(line_in) {}
623 
625  GeneratorCreationFunc* generator;
627  const char* file;
628  int line;
629  };
630  typedef ::std::vector<InstantiationInfo> InstantiationContainer;
631 
632  static bool IsValidParamName(const std::string& name) {
633  // Check for empty string
634  if (name.empty())
635  return false;
636 
637  // Check for invalid characters
638  for (std::string::size_type index = 0; index < name.size(); ++index) {
639  if (!isalnum(name[index]) && name[index] != '_')
640  return false;
641  }
642 
643  return true;
644  }
645 
650 
652 }; // class ParameterizedTestSuiteInfo
653 
654 // Legacy API is deprecated but still available
655 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
656 template <class TestCase>
658 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
659 
660 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
661 //
662 // ParameterizedTestSuiteRegistry contains a map of
663 // ParameterizedTestSuiteInfoBase classes accessed by test suite names. TEST_P
664 // and INSTANTIATE_TEST_SUITE_P macros use it to locate their corresponding
665 // ParameterizedTestSuiteInfo descriptors.
667  public:
670  for (auto& test_suite_info : test_suite_infos_) {
671  delete test_suite_info;
672  }
673  }
674 
675  // Looks up or creates and returns a structure containing information about
676  // tests and instantiations of a particular test suite.
677  template <class TestSuite>
679  const char* test_suite_name, CodeLocation code_location) {
680  ParameterizedTestSuiteInfo<TestSuite>* typed_test_info = nullptr;
681  for (auto& test_suite_info : test_suite_infos_) {
682  if (test_suite_info->GetTestSuiteName() == test_suite_name) {
683  if (test_suite_info->GetTestSuiteTypeId() != GetTypeId<TestSuite>()) {
684  // Complain about incorrect usage of Google Test facilities
685  // and terminate the program since we cannot guaranty correct
686  // test suite setup and tear-down in this case.
687  ReportInvalidTestSuiteType(test_suite_name, code_location);
688  posix::Abort();
689  } else {
690  // At this point we are sure that the object we found is of the same
691  // type we are looking for, so we downcast it to that type
692  // without further checks.
693  typed_test_info = CheckedDowncastToActualType<
694  ParameterizedTestSuiteInfo<TestSuite> >(test_suite_info);
695  }
696  break;
697  }
698  }
699  if (typed_test_info == nullptr) {
700  typed_test_info = new ParameterizedTestSuiteInfo<TestSuite>(
701  test_suite_name, code_location);
702  test_suite_infos_.push_back(typed_test_info);
703  }
704  return typed_test_info;
705  }
706  void RegisterTests() {
707  for (auto& test_suite_info : test_suite_infos_) {
708  test_suite_info->RegisterTests();
709  }
710  }
711 // Legacy API is deprecated but still available
712 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
713  template <class TestCase>
715  const char* test_case_name, CodeLocation code_location) {
716  return GetTestSuitePatternHolder<TestCase>(test_case_name, code_location);
717  }
718 
719 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
720 
721  private:
722  using TestSuiteInfoContainer = ::std::vector<ParameterizedTestSuiteInfoBase*>;
723 
725 
727 };
728 
729 } // namespace internal
730 
731 // Forward declarations of ValuesIn(), which is implemented in
732 // include/gtest/gtest-param-test.h.
733 template <class Container>
735  const Container& container);
736 
737 namespace internal {
738 // Used in the Values() function to provide polymorphic capabilities.
739 
740 template <typename... Ts>
741 class ValueArray {
742  public:
743  ValueArray(Ts... v) : v_{std::move(v)...} {}
744 
745  template <typename T>
746  operator ParamGenerator<T>() const { // NOLINT
747  return ValuesIn(MakeVector<T>(MakeIndexSequence<sizeof...(Ts)>()));
748  }
749 
750  private:
751  template <typename T, size_t... I>
752  std::vector<T> MakeVector(IndexSequence<I...>) const {
753  return std::vector<T>{static_cast<T>(v_.template Get<I>())...};
754  }
755 
756  FlatTuple<Ts...> v_;
757 };
758 
759 } // namespace internal
760 } // namespace testing
761 
762 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo::file
const char * file
Definition: gtest-param-util.h:627
testing::TestParamInfo::param
ParamType param
Definition: gtest-param-util.h:59
testing::internal::ParamGenerator
Definition: gtest-param-util.h:85
testing
Definition: gmock-actions.h:59
name
GLuint const GLchar * name
Definition: glcorearb.h:3055
testing::internal::ValuesInIteratorRangeGenerator::Iterator::Clone
ParamIteratorInterface< T > * Clone() const override
Definition: gtest-param-util.h:320
testing::internal::RangeGenerator::CalculateEndIndex
static int CalculateEndIndex(const T &begin, const T &end, const IncrementT &step)
Definition: gtest-param-util.h:263
testing::internal::ValuesInIteratorRangeGenerator::ValuesInIteratorRangeGenerator
ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
Definition: gtest-param-util.h:292
testing::internal::RangeGenerator::step_
const IncrementT step_
Definition: gtest-param-util.h:277
testing::internal::ParameterizedTestSuiteRegistry::RegisterTests
void RegisterTests()
Definition: gtest-param-util.h:706
testing::PrintToStringParamName::operator()
std::string operator()(const TestParamInfo< ParamType > &info) const
Definition: gtest-param-util.h:67
testing::internal::ParamIteratorInterface::Equals
virtual bool Equals(const ParamIteratorInterface &other) const =0
testing::internal::ParamIterator::operator==
bool operator==(const ParamIterator &other) const
Definition: gtest-param-util.h:147
end
GLuint GLuint end
Definition: glcorearb.h:2858
testing::Message::GetString
std::string GetString() const
Definition: gtest.cc:1004
testing::internal::ParameterizedTestSuiteInfo::TestInfo::test_suite_base_name
const std::string test_suite_base_name
Definition: gtest-param-util.h:604
testing::internal::ParameterizedTestFactory::ParameterizedTestFactory
ParameterizedTestFactory(ParamType parameter)
Definition: gtest-param-util.h:407
testing::internal::ParamIterator::operator=
ParamIterator & operator=(const ParamIterator &other)
Definition: gtest-param-util.h:128
testing::internal::ValueArray
Definition: gtest-param-util.h:741
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo
Definition: gtest-param-util.h:612
testing::internal::ValuesInIteratorRangeGenerator::~ValuesInIteratorRangeGenerator
~ValuesInIteratorRangeGenerator() override
Definition: gtest-param-util.h:294
testing::internal::ParameterizedTestSuiteRegistry
Definition: gtest-param-util.h:666
base
Definition: logging.cc:2162
testing::internal::ParameterizedTestSuiteRegistry::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteRegistry)
testing::internal::RangeGenerator::Iterator::~Iterator
~Iterator() override
Definition: gtest-param-util.h:224
testing::internal::RangeGenerator::Begin
ParamIteratorInterface< T > * Begin() const override
Definition: gtest-param-util.h:211
testing::internal::ParameterizedTestSuiteInfo
Definition: gtest-param-util.h:495
testing::internal::ValuesInIteratorRangeGenerator::operator=
void operator=(const ValuesInIteratorRangeGenerator &other)
testing::internal::ParameterizedTestSuiteInfo::GetTestSuiteTypeId
TypeId GetTestSuiteTypeId() const override
Definition: gtest-param-util.h:514
testing::internal::ParamNameGenFunc::Type
std::string Type(const TestParamInfo< ParamType > &)
Definition: gtest-param-util.h:391
testing::internal::TestMetaFactory::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory)
testing::internal::RangeGenerator::begin_
const T begin_
Definition: gtest-param-util.h:275
testing::internal::ParamGenerator::iterator
ParamIterator< T > iterator
Definition: gtest-param-util.h:182
testing::internal::ValuesInIteratorRangeGenerator::Iterator::Current
const T * Current() const override
Definition: gtest-param-util.h:330
testing::TestParamInfo
Definition: gtest-param-util.h:55
testing::internal::ReportInvalidTestSuiteType
GTEST_API_ void ReportInvalidTestSuiteType(const char *test_suite_name, CodeLocation code_location)
Definition: gtest.cc:2584
testing::internal::RangeGenerator::Iterator::Iterator
Iterator(const ParamGeneratorInterface< T > *base, T value, int index, IncrementT step)
Definition: gtest-param-util.h:221
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
testing::internal::ParameterizedTestFactory::parameter_
const ParamType parameter_
Definition: gtest-param-util.h:415
testing::internal::ParamIterator
Definition: gtest-param-util.h:120
testing::internal::RangeGenerator::Iterator::Clone
ParamIteratorInterface< T > * Clone() const override
Definition: gtest-param-util.h:233
gtest-internal.h
testing::internal::ValuesInIteratorRangeGenerator::Iterator::Advance
void Advance() override
Definition: gtest-param-util.h:316
testing::internal::ParameterizedTestSuiteInfo::TestInfo::test_base_name
const std::string test_base_name
Definition: gtest-param-util.h:605
testing::internal::ParameterizedTestSuiteInfoBase::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteInfoBase)
testing::internal::TestMetaFactory::ParamType
typename TestSuite::ParamType ParamType
Definition: gtest-param-util.h:444
testing::internal::ParameterizedTestSuiteInfo::TestInfo::test_meta_factory
const std::unique_ptr< TestMetaFactoryBase< ParamType > > test_meta_factory
Definition: gtest-param-util.h:606
T
#define T(upbtypeconst, upbtype, ctype, default_value)
testing::Message
Definition: gtest-message.h:90
testing::internal::ParameterizedTestSuiteInfoBase
Definition: gtest-param-util.h:466
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo::generator
GeneratorCreationFunc * generator
Definition: gtest-param-util.h:625
testing::Test
Definition: gtest.h:415
testing::internal::IndexSequence
Definition: gtest-internal.h:1181
testing::internal::RangeGenerator::Iterator::base_
const ParamGeneratorInterface< T > *const base_
Definition: gtest-param-util.h:257
testing::internal::ParameterizedTestSuiteInfo::GetTestSuiteName
const std::string & GetTestSuiteName() const override
Definition: gtest-param-util.h:510
testing::internal::ParamIterator::operator*
const T & operator*() const
Definition: gtest-param-util.h:134
testing::internal::ParamIterator::difference_type
ptrdiff_t difference_type
Definition: gtest-param-util.h:124
testing::internal::ParameterizedTestSuiteInfo::InstantiationContainer
::std::vector< InstantiationInfo > InstantiationContainer
Definition: gtest-param-util.h:630
testing::internal::ParamGenerator::ParamGenerator
ParamGenerator(const ParamGenerator &other)
Definition: gtest-param-util.h:185
testing::internal::RangeGenerator::Iterator::value_
T value_
Definition: gtest-param-util.h:258
param
GLenum GLfloat param
Definition: glcorearb.h:2769
testing::internal::ParameterizedTestSuiteInfo::tests_
TestInfoContainer tests_
Definition: gtest-param-util.h:648
begin
static size_t begin(const upb_table *t)
Definition: php/ext/google/protobuf/upb.c:4898
testing::internal::ParameterizedTestSuiteInfo::instantiations_
InstantiationContainer instantiations_
Definition: gtest-param-util.h:649
testing::internal::ParamIterator::operator->
const T * operator->() const
Definition: gtest-param-util.h:135
testing::internal::ParamIteratorInterface::~ParamIteratorInterface
virtual ~ParamIteratorInterface()
Definition: gtest-param-util.h:92
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo::line
int line
Definition: gtest-param-util.h:628
testing::internal::ParameterizedTestSuiteInfo::TestInfo::TestInfo
TestInfo(const char *a_test_suite_base_name, const char *a_test_base_name, TestMetaFactoryBase< ParamType > *a_test_meta_factory)
Definition: gtest-param-util.h:598
testing::internal::CodeLocation
Definition: gtest-internal.h:512
testing::internal::RangeGenerator::End
ParamIteratorInterface< T > * End() const override
Definition: gtest-param-util.h:214
GTEST_CHECK_
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1036
testing::internal::FlatTuple
Definition: gtest-internal.h:1228
testing::internal::RangeGenerator::Iterator::index_
int index_
Definition: gtest-param-util.h:259
testing::internal::ValueArray::v_
FlatTuple< Ts... > v_
Definition: gtest-param-util.h:756
testing::internal::ParamIteratorInterface
Definition: gtest-param-util.h:90
testing::internal::ParameterizedTestSuiteRegistry::~ParameterizedTestSuiteRegistry
~ParameterizedTestSuiteRegistry()
Definition: gtest-param-util.h:669
testing::internal::ParameterizedTestSuiteInfo::ParamType
typename TestSuite::ParamType ParamType
Definition: gtest-param-util.h:500
testing::internal::ParamIteratorInterface::Advance
virtual void Advance()=0
testing::internal::ValuesInIteratorRangeGenerator::container_
const ContainerType container_
Definition: gtest-param-util.h:365
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo::name
std::string name
Definition: gtest-param-util.h:624
testing::internal::TestMetaFactory::CreateTestFactory
TestFactoryBase * CreateTestFactory(ParamType parameter) override
Definition: gtest-param-util.h:448
testing::internal::TestMetaFactoryBase::~TestMetaFactoryBase
virtual ~TestMetaFactoryBase()
Definition: gtest-param-util.h:427
testing::internal::ParameterizedTestSuiteInfo::code_location_
CodeLocation code_location_
Definition: gtest-param-util.h:647
testing::internal::ParamIteratorInterface::Current
virtual const T * Current() const =0
testing::internal::ParameterizedTestSuiteRegistry::test_suite_infos_
TestSuiteInfoContainer test_suite_infos_
Definition: gtest-param-util.h:724
testing::internal::MakeIndexSequence
Definition: gtest-internal.h:1200
testing::internal::posix::Abort
void Abort()
Definition: gtest-port.h:2158
gtest-port.h
testing::internal::ValuesInIteratorRangeGenerator::Iterator::BaseGenerator
const ParamGeneratorInterface< T > * BaseGenerator() const override
Definition: gtest-param-util.h:313
testing::internal::ParamGenerator::ParamGenerator
ParamGenerator(ParamGeneratorInterface< T > *impl)
Definition: gtest-param-util.h:184
testing::internal::ParameterizedTestSuiteInfoBase::~ParameterizedTestSuiteInfoBase
virtual ~ParameterizedTestSuiteInfoBase()
Definition: gtest-param-util.h:468
testing::internal::ParameterizedTestSuiteInfoBase::RegisterTests
virtual void RegisterTests()=0
testing::internal::RangeGenerator::Iterator::Advance
void Advance() override
Definition: gtest-param-util.h:229
testing::internal::RangeGenerator::end_index_
const int end_index_
Definition: gtest-param-util.h:280
testing::internal::ParameterizedTestSuiteInfo::AddTestPattern
void AddTestPattern(const char *test_suite_name, const char *test_base_name, TestMetaFactoryBase< ParamType > *meta_factory)
Definition: gtest-param-util.h:521
GTEST_API_
#define GTEST_API_
Definition: gtest-port.h:764
testing::internal::ParamGenerator::begin
iterator begin() const
Definition: gtest-param-util.h:192
testing::internal::TestMetaFactoryBase
Definition: gtest-param-util.h:425
testing::internal::ValuesInIteratorRangeGenerator
Definition: gtest-param-util.h:289
testing::internal::TestMetaFactoryBase::CreateTestFactory
virtual TestFactoryBase * CreateTestFactory(ParamType parameter)=0
testing::internal::ParamGenerator::impl_
std::shared_ptr< const ParamGeneratorInterface< T > > impl_
Definition: gtest-param-util.h:196
testing::internal::ParameterizedTestSuiteInfo::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteInfo)
testing::internal::RangeGenerator::~RangeGenerator
~RangeGenerator() override
Definition: gtest-param-util.h:209
testing::internal::ParamGeneratorInterface::ParamType
T ParamType
Definition: gtest-param-util.h:165
testing::internal::TestMetaFactory
Definition: gtest-param-util.h:441
testing::internal::ParameterizedTestFactory
Definition: gtest-param-util.h:404
testing::internal::ParameterizedTestSuiteRegistry::ParameterizedTestSuiteRegistry
ParameterizedTestSuiteRegistry()
Definition: gtest-param-util.h:668
testing::internal::RangeGenerator::end_
const T end_
Definition: gtest-param-util.h:276
testing::internal::RangeGenerator::Iterator::step_
const IncrementT step_
Definition: gtest-param-util.h:260
testing::internal::ParamIterator::reference
const typedef T & reference
Definition: gtest-param-util.h:123
testing::internal::ParamIterator::operator!=
bool operator!=(const ParamIterator &other) const
Definition: gtest-param-util.h:150
testing::internal::ParamIterator::ParamIterator
ParamIterator(const ParamIterator &other)
Definition: gtest-param-util.h:127
testing::internal::RangeGenerator::Iterator::Iterator
Iterator(const Iterator &other)
Definition: gtest-param-util.h:249
testing::internal::ParamIterator::operator++
ParamIterator operator++(int)
Definition: gtest-param-util.h:142
i
int i
Definition: gmock-matchers_test.cc:764
testing::internal::ParameterizedTestSuiteInfo::TestInfo
Definition: gtest-param-util.h:597
testing::internal::TypeId
const typedef void * TypeId
Definition: gtest-internal.h:437
testing::internal::ValuesInIteratorRangeGenerator::Iterator::Iterator
Iterator(const ParamGeneratorInterface< T > *base, typename ContainerType::const_iterator iterator)
Definition: gtest-param-util.h:308
testing::internal::MakeAndRegisterTestInfo
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)
Definition: gtest.cc:2572
testing::internal::ParamGeneratorInterface
Definition: gtest-param-util.h:84
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo::InstantiationInfo
InstantiationInfo(const std::string &name_in, GeneratorCreationFunc *generator_in, ParamNameGeneratorFunc *name_func_in, const char *file_in, int line_in)
Definition: gtest-param-util.h:613
testing::internal::ParameterizedTestSuiteInfo::InstantiationInfo::name_func
ParamNameGeneratorFunc * name_func
Definition: gtest-param-util.h:626
testing::internal::ValuesInIteratorRangeGenerator::ContainerType
::std::vector< T > ContainerType
Definition: gtest-param-util.h:304
testing::internal::ParamGeneratorInterface::~ParamGeneratorInterface
virtual ~ParamGeneratorInterface()
Definition: gtest-param-util.h:167
testing::internal::ParameterizedTestSuiteInfo::TestInfoContainer
::std::vector< std::shared_ptr< TestInfo > > TestInfoContainer
Definition: gtest-param-util.h:608
testing::internal::ParamNameGenFunc
Definition: gtest-param-util.h:390
testing::internal::RangeGenerator::RangeGenerator
RangeGenerator(T begin, T end, IncrementT step)
Definition: gtest-param-util.h:206
testing::internal::ParameterizedTestSuiteRegistry::TestSuiteInfoContainer
::std::vector< ParameterizedTestSuiteInfoBase * > TestSuiteInfoContainer
Definition: gtest-param-util.h:722
testing::internal::ParameterizedTestSuiteInfo::ParameterizedTestSuiteInfo
ParameterizedTestSuiteInfo(const char *name, CodeLocation code_location)
Definition: gtest-param-util.h:505
v
const GLdouble * v
Definition: glcorearb.h:3106
testing::internal::ValuesInIteratorRangeGenerator::Iterator::Equals
bool Equals(const ParamIteratorInterface< T > &other) const override
Definition: gtest-param-util.h:334
testing::internal::RangeGenerator::Iterator::Equals
bool Equals(const ParamIteratorInterface< T > &other) const override
Definition: gtest-param-util.h:237
testing::internal::ValueArray::ValueArray
ValueArray(Ts... v)
Definition: gtest-param-util.h:743
testing::internal::SuiteApiResolver
Definition: gtest-internal.h:535
testing::internal::ParameterizedTestSuiteInfo::test_suite_name_
const std::string test_suite_name_
Definition: gtest-param-util.h:646
gtest-printers.h
testing::PrintToStringParamName
Definition: gtest-param-util.h:65
testing::internal::RangeGenerator::Iterator::Current
const T * Current() const override
Definition: gtest-param-util.h:236
testing::internal::ParameterizedTestSuiteInfo::RegisterTests
void RegisterTests() override
Definition: gtest-param-util.h:541
testing::internal::ParamIteratorInterface::Clone
virtual ParamIteratorInterface * Clone() const =0
testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder
ParameterizedTestSuiteInfo< TestSuite > * GetTestSuitePatternHolder(const char *test_suite_name, CodeLocation code_location)
Definition: gtest-param-util.h:678
func
GLenum func
Definition: glcorearb.h:3052
testing::internal::RangeGenerator::operator=
void operator=(const RangeGenerator &other)
testing::internal::CheckedDowncastToActualType
Derived * CheckedDowncastToActualType(Base *base)
Definition: gtest-port.h:1157
testing::internal::ParamIterator::ParamIterator
ParamIterator(ParamIteratorInterface< T > *impl)
Definition: gtest-param-util.h:156
testing::internal::ParamGenerator::end
iterator end() const
Definition: gtest-param-util.h:193
testing::internal::ParameterizedTestFactory::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory)
testing::internal::ParamIterator::impl_
std::unique_ptr< ParamIteratorInterface< T > > impl_
Definition: gtest-param-util.h:157
testing::internal::ParameterizedTestSuiteInfoBase::ParameterizedTestSuiteInfoBase
ParameterizedTestSuiteInfoBase()
Definition: gtest-param-util.h:481
testing::internal::ParamGeneratorInterface::End
virtual ParamIteratorInterface< T > * End() const =0
testing::internal::ValueArray::MakeVector
std::vector< T > MakeVector(IndexSequence< I... >) const
Definition: gtest-param-util.h:752
testing::internal::ParameterizedTestSuiteInfo::ParamNameGeneratorFunc
ParamNameGenFunc< ParamType >::Type ParamNameGeneratorFunc
Definition: gtest-param-util.h:503
testing::internal::ParamGenerator::operator=
ParamGenerator & operator=(const ParamGenerator &other)
Definition: gtest-param-util.h:187
testing::internal::RangeGenerator::Iterator::BaseGenerator
const ParamGeneratorInterface< T > * BaseGenerator() const override
Definition: gtest-param-util.h:226
testing::internal::ValuesInIteratorRangeGenerator::End
ParamIteratorInterface< T > * End() const override
Definition: gtest-param-util.h:299
testing::internal::ParamIteratorInterface::BaseGenerator
virtual const ParamGeneratorInterface< T > * BaseGenerator() const =0
testing::internal::ParamIterator::operator++
ParamIterator & operator++()
Definition: gtest-param-util.h:137
internal
Definition: any.pb.h:40
testing::internal::ValuesInIteratorRangeGenerator::Iterator::value_
std::unique_ptr< const T > value_
Definition: gtest-param-util.h:359
testing::internal::ValuesInIteratorRangeGenerator::Iterator::Iterator
Iterator(const Iterator &other)
Definition: gtest-param-util.h:345
testing::internal::DefaultParamName
std::string DefaultParamName(const TestParamInfo< ParamType > &info)
Definition: gtest-param-util.h:373
testing::TestParamInfo::TestParamInfo
TestParamInfo(const ParamType &a_param, size_t an_index)
Definition: gtest-param-util.h:56
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
testing::internal::ParameterizedTestSuiteRegistry::GetTestCasePatternHolder
ParameterizedTestCaseInfo< TestCase > * GetTestCasePatternHolder(const char *test_case_name, CodeLocation code_location)
Definition: gtest-param-util.h:714
testing::internal::ValuesInIteratorRangeGenerator::Iterator::iterator_
ContainerType::const_iterator iterator_
Definition: gtest-param-util.h:353
testing::internal::ValuesInIteratorRangeGenerator::Begin
ParamIteratorInterface< T > * Begin() const override
Definition: gtest-param-util.h:296
testing::internal::GetParamNameGen
ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func)
Definition: gtest-param-util.h:385
testing::internal::RangeGenerator::Iterator
Definition: gtest-param-util.h:219
testing::internal::ParamIterator::value_type
T value_type
Definition: gtest-param-util.h:122
testing::internal::ParameterizedTestSuiteInfoBase::GetTestSuiteTypeId
virtual TypeId GetTestSuiteTypeId() const =0
testing::ValuesIn
internal::ParamGenerator< typename ::testing::internal::IteratorTraits< ForwardIterator >::value_type > ValuesIn(ForwardIterator begin, ForwardIterator end)
Definition: gtest-param-test.h:301
testing::internal::ParameterizedTestFactory::CreateTest
Test * CreateTest() override
Definition: gtest-param-util.h:409
testing::internal::RangeGenerator::Iterator::operator=
void operator=(const Iterator &other)
index
GLuint index
Definition: glcorearb.h:3055
testing::internal::ParameterizedTestSuiteInfo::IsValidParamName
static bool IsValidParamName(const std::string &name)
Definition: gtest-param-util.h:632
testing::internal::ValuesInIteratorRangeGenerator::Iterator::base_
const ParamGeneratorInterface< T > *const base_
Definition: gtest-param-util.h:352
testing::internal::ParamGeneratorInterface::Begin
virtual ParamIteratorInterface< T > * Begin() const =0
testing::internal::RangeGenerator
Definition: gtest-param-util.h:204
testing::internal::ParameterizedTestSuiteInfo::AddTestSuiteInstantiation
int AddTestSuiteInstantiation(const std::string &instantiation_name, GeneratorCreationFunc *func, ParamNameGeneratorFunc *name_func, const char *file, int line)
Definition: gtest-param-util.h:528
testing::internal::ParameterizedTestFactory::ParamType
TestClass::ParamType ParamType
Definition: gtest-param-util.h:406
testing::internal::TestMetaFactory::TestMetaFactory
TestMetaFactory()
Definition: gtest-param-util.h:446
testing::internal::TestFactoryBase
Definition: gtest-internal.h:472
testing::internal::ValuesInIteratorRangeGenerator::Iterator::~Iterator
~Iterator() override
Definition: gtest-param-util.h:311
testing::TestParamInfo::index
size_t index
Definition: gtest-param-util.h:60
testing::internal::ParameterizedTestSuiteInfoBase::GetTestSuiteName
virtual const std::string & GetTestSuiteName() const =0
testing::internal::ValuesInIteratorRangeGenerator::Iterator
Definition: gtest-param-util.h:306
testing::PrintToString
::std::string PrintToString(const T &value)
Definition: gtest-printers.h:938


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:53