Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
googletest-param-test-test.cc File Reference
#include "gtest/gtest.h"
#include <algorithm>
#include <iostream>
#include <list>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include "src/gtest-internal-inl.h"
#include "test/googletest-param-test-test.h"
Include dependency graph for googletest-param-test-test.cc:

Go to the source code of this file.

Classes

class  DogAdder
 
class  IntWrapper
 
class  NonDefaultConstructAssignString
 
class  TestGenerationEnvironment< kExpectedCalls >
 
class  TestGenerationTest
 
class  GeneratorEvaluationTest
 
class  ExternalGeneratorTest
 
class  MultipleInstantiationTest
 
class  SeparateInstanceTest
 
class  NamingTest
 
class  MacroNamingTest
 
class  MacroNamingTestNonParametrized
 
class  CustomFunctorNamingTest
 
struct  CustomParamNameFunctor
 
class  CustomFunctionNamingTest
 
class  CustomLambdaNamingTest
 
class  CustomIntegerNamingTest
 
struct  CustomStruct
 
class  CustomStructNamingTest
 
struct  StatefulNamingFunctor
 
class  StatefulNamingTest
 
class  Unstreamable
 
class  CommentTest
 
class  NonParameterizedBaseTest
 
class  ParameterizedDerivedTest
 
class  ParameterizedDeathTest
 
class  MyEnumTest
 
class  works_here::NotUsedTest
 
class  works_here::NotUsedTypeTest< T >
 
class  works_here::NotInstantiatedTest
 
class  works_here::NotInstantiatedTypeTest< T >
 

Namespaces

 works_here
 

Macros

#define PREFIX_WITH_FOO(test_name)   Foo##test_name
 
#define PREFIX_WITH_MACRO(test_name)   Macro##test_name
 

Typedefs

using works_here::OtherName = NotInstantiatedTest
 

Enumerations

enum  MyEnums { ENUM1 = 1, ENUM2 = 3, ENUM3 = 8 }
 

Functions

template<typename T >
::std::string PrintValue (const T &value)
 
template<typename T , size_t N>
void VerifyGenerator (const ParamGenerator< T > &generator, const T(&expected_values)[N])
 
template<typename T >
void VerifyGeneratorIsEmpty (const ParamGenerator< T > &generator)
 
 TEST (IteratorTest, ParamIteratorConformsToForwardIteratorConcept)
 
 TEST (RangeTest, IntRangeWithDefaultStep)
 
 TEST (RangeTest, IntRangeSingleValue)
 
 TEST (RangeTest, IntRangeEmpty)
 
 TEST (RangeTest, IntRangeWithCustomStep)
 
 TEST (RangeTest, IntRangeWithCustomStepOverUpperBound)
 
 TEST (RangeTest, WorksWithACustomType)
 
 TEST (RangeTest, WorksWithACustomTypeWithDifferentIncrementType)
 
 TEST (ValuesInTest, ValuesInArray)
 
 TEST (ValuesInTest, ValuesInConstArray)
 
 TEST (ValuesInTest, ValuesInSingleElementArray)
 
 TEST (ValuesInTest, ValuesInVector)
 
 TEST (ValuesInTest, ValuesInIteratorRange)
 
 TEST (ValuesInTest, ValuesInSingleElementIteratorRange)
 
 TEST (ValuesInTest, ValuesInEmptyIteratorRange)
 
 TEST (ValuesTest, ValuesWorks)
 
 TEST (ValuesTest, ValuesWorksForValuesOfCompatibleTypes)
 
 TEST (ValuesTest, ValuesWorksForMaxLengthList)
 
 TEST (ValuesTest, ValuesWithSingleParameter)
 
 TEST (BoolTest, BoolWorks)
 
 TEST (CombineTest, CombineWithTwoParameters)
 
 TEST (CombineTest, CombineWithThreeParameters)
 
 TEST (CombineTest, CombineWithFirstParameterSingleValue)
 
 TEST (CombineTest, CombineWithSecondParameterSingleValue)
 
 TEST (CombineTest, CombineWithFirstParameterEmptyRange)
 
 TEST (CombineTest, CombineWithSecondParameterEmptyRange)
 
 TEST (CombineTest, CombineWithMaxNumberOfParameters)
 
 TEST (CombineTest, NonDefaultConstructAssign)
 
 TEST (ParamGeneratorTest, AssignmentWorks)
 
 TEST_P (TestGenerationTest, TestsExpandedAndRun)
 
 INSTANTIATE_TEST_SUITE_P (TestExpansionModule, TestGenerationTest, ValuesIn(test_generation_params))
 
 TEST_P (GeneratorEvaluationTest, GeneratorsEvaluatedInMain)
 
 INSTANTIATE_TEST_SUITE_P (GenEvalModule, GeneratorEvaluationTest, Values(GeneratorEvaluationTest::param_value()))
 
 TEST_P (ExternalGeneratorTest, ExternalGenerator)
 
 INSTANTIATE_TEST_SUITE_P (ExternalGeneratorModule, ExternalGeneratorTest, extern_gen)
 
 TEST_P (ExternalInstantiationTest, IsMultipleOf33)
 
 TEST_P (MultipleInstantiationTest, AllowsMultipleInstances)
 
 INSTANTIATE_TEST_SUITE_P (Sequence1, MultipleInstantiationTest, Values(1, 2))
 
 INSTANTIATE_TEST_SUITE_P (Sequence2, MultipleInstantiationTest, Range(3, 5))
 
 TEST_P (InstantiationInMultipleTranslationUnitsTest, IsMultipleOf42)
 
 INSTANTIATE_TEST_SUITE_P (Sequence1, InstantiationInMultipleTranslationUnitsTest, Values(42, 42 *2))
 
 TEST_P (SeparateInstanceTest, TestsRunInSeparateInstances)
 
 INSTANTIATE_TEST_SUITE_P (FourElemSequence, SeparateInstanceTest, Range(1, 4))
 
 TEST_P (NamingTest, TestsReportCorrectNamesAndParameters)
 
 INSTANTIATE_TEST_SUITE_P (ZeroToFiveSequence, NamingTest, Range(0, 5))
 
 TEST_P (PREFIX_WITH_MACRO(NamingTest), PREFIX_WITH_FOO(SomeTestName))
 
 INSTANTIATE_TEST_SUITE_P (FortyTwo, MacroNamingTest, Values(42))
 
 TEST_F (PREFIX_WITH_MACRO(NamingTestNonParametrized), PREFIX_WITH_FOO(SomeTestName))
 
 TEST (MacroNameing, LookupNames)
 
 TEST_P (CustomFunctorNamingTest, CustomTestNames)
 
 INSTANTIATE_TEST_SUITE_P (CustomParamNameFunctor, CustomFunctorNamingTest, Values(std::string("FunctorName")), CustomParamNameFunctor())
 
 INSTANTIATE_TEST_SUITE_P (AllAllowedCharacters, CustomFunctorNamingTest, Values("abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ","01234567890_"), CustomParamNameFunctor())
 
std::string CustomParamNameFunction (const ::testing::TestParamInfo< std::string > &inf)
 
 TEST_P (CustomFunctionNamingTest, CustomTestNames)
 
 INSTANTIATE_TEST_SUITE_P (CustomParamNameFunction, CustomFunctionNamingTest, Values(std::string("FunctionName")), CustomParamNameFunction)
 
 INSTANTIATE_TEST_SUITE_P (CustomParamNameFunctionP, CustomFunctionNamingTest, Values(std::string("FunctionNameP")),&CustomParamNameFunction)
 
 TEST_P (CustomLambdaNamingTest, CustomTestNames)
 
 INSTANTIATE_TEST_SUITE_P (CustomParamNameLambda, CustomLambdaNamingTest, Values(std::string("LambdaName")), [](const ::testing::TestParamInfo< std::string > &inf){return inf.param;})
 
 TEST (CustomNamingTest, CheckNameRegistry)
 
 TEST_P (CustomIntegerNamingTest, TestsReportCorrectNames)
 
 INSTANTIATE_TEST_SUITE_P (PrintToString, CustomIntegerNamingTest, Range(0, 5),::testing::PrintToStringParamName())
 
std::ostream & operator<< (std::ostream &stream, const CustomStruct &val)
 
 TEST_P (CustomStructNamingTest, TestsReportCorrectNames)
 
 INSTANTIATE_TEST_SUITE_P (PrintToString, CustomStructNamingTest, Values(CustomStruct(0), CustomStruct(1)),::testing::PrintToStringParamName())
 
 TEST_P (StatefulNamingTest, TestsReportCorrectNames)
 
 INSTANTIATE_TEST_SUITE_P (StatefulNamingFunctor, StatefulNamingTest, Range(0, 5), StatefulNamingFunctor())
 
 TEST_P (CommentTest, TestsCorrectlyReportUnstreamableParams)
 
 INSTANTIATE_TEST_SUITE_P (InstantiationWithComments, CommentTest, Values(Unstreamable(1)))
 
 TEST_F (NonParameterizedBaseTest, FixtureIsInitialized)
 
 TEST_P (ParameterizedDerivedTest, SeesSequence)
 
 TEST_F (ParameterizedDeathTest, GetParamDiesFromTestF)
 
 INSTANTIATE_TEST_SUITE_P (RangeZeroToFive, ParameterizedDerivedTest, Range(0, 5))
 
 TEST_P (MyEnumTest, ChecksParamMoreThanZero)
 
 INSTANTIATE_TEST_SUITE_P (MyEnumTests, MyEnumTest,::testing::Values(ENUM1, ENUM2, 0))
 
 works_here::TYPED_TEST_SUITE_P (NotUsedTypeTest)
 
 works_here::GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST (NotInstantiatedTest)
 
 works_here::TEST_P (NotInstantiatedTest, Used)
 
 works_here::TYPED_TEST_SUITE_P (NotInstantiatedTypeTest)
 
 works_here::GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST (NotInstantiatedTypeTest)
 
 works_here::TYPED_TEST_P (NotInstantiatedTypeTest, Used)
 
 works_here::REGISTER_TYPED_TEST_SUITE_P (NotInstantiatedTypeTest, Used)
 
int main (int argc, char **argv)
 

Variables

const int test_generation_params [] = {36, 42, 72}
 
ParamGenerator< int > extern_gen
 

Macro Definition Documentation

#define PREFIX_WITH_FOO (   test_name)    Foo##test_name

Definition at line 799 of file googletest-param-test-test.cc.

#define PREFIX_WITH_MACRO (   test_name)    Macro##test_name

Definition at line 800 of file googletest-param-test-test.cc.

Enumeration Type Documentation

enum MyEnums
Enumerator
ENUM1 
ENUM2 
ENUM3 

Definition at line 1060 of file googletest-param-test-test.cc.

Function Documentation

template<typename T >
::std::string PrintValue ( const T value)

Definition at line 70 of file googletest-param-test-test.cc.

template<typename T , size_t N>
void VerifyGenerator ( const ParamGenerator< T > &  generator,
const T(&)  expected_values[N] 
)

Definition at line 78 of file googletest-param-test-test.cc.

template<typename T >
void VerifyGeneratorIsEmpty ( const ParamGenerator< T > &  generator)

Definition at line 120 of file googletest-param-test-test.cc.

TEST ( IteratorTest  ,
ParamIteratorConformsToForwardIteratorConcept   
)

Definition at line 137 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
IntRangeWithDefaultStep   
)

Definition at line 172 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
IntRangeSingleValue   
)

Definition at line 180 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
IntRangeEmpty   
)

Definition at line 188 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
IntRangeWithCustomStep   
)

Definition at line 195 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
IntRangeWithCustomStepOverUpperBound   
)

Definition at line 205 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
WorksWithACustomType   
)

Definition at line 237 of file googletest-param-test-test.cc.

TEST ( RangeTest  ,
WorksWithACustomTypeWithDifferentIncrementType   
)

Definition at line 271 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInArray   
)

Definition at line 286 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInConstArray   
)

Definition at line 294 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInSingleElementArray   
)

Definition at line 302 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInVector   
)

Definition at line 310 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInIteratorRange   
)

Definition at line 323 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInSingleElementIteratorRange   
)

Definition at line 337 of file googletest-param-test-test.cc.

TEST ( ValuesInTest  ,
ValuesInEmptyIteratorRange   
)

Definition at line 349 of file googletest-param-test-test.cc.

TEST ( ValuesTest  ,
ValuesWorks   
)

Definition at line 358 of file googletest-param-test-test.cc.

TEST ( ValuesTest  ,
ValuesWorksForValuesOfCompatibleTypes   
)

Definition at line 367 of file googletest-param-test-test.cc.

TEST ( ValuesTest  ,
ValuesWorksForMaxLengthList   
)

Definition at line 374 of file googletest-param-test-test.cc.

TEST ( ValuesTest  ,
ValuesWithSingleParameter   
)

Definition at line 393 of file googletest-param-test-test.cc.

TEST ( BoolTest  ,
BoolWorks   
)

Definition at line 401 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithTwoParameters   
)

Definition at line 409 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithThreeParameters   
)

Definition at line 422 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithFirstParameterSingleValue   
)

Definition at line 436 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithSecondParameterSingleValue   
)

Definition at line 448 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithFirstParameterEmptyRange   
)

Definition at line 459 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithSecondParameterEmptyRange   
)

Definition at line 467 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
CombineWithMaxNumberOfParameters   
)

Definition at line 475 of file googletest-param-test-test.cc.

TEST ( CombineTest  ,
NonDefaultConstructAssign   
)

Definition at line 506 of file googletest-param-test-test.cc.

TEST ( ParamGeneratorTest  ,
AssignmentWorks   
)

Definition at line 536 of file googletest-param-test-test.cc.

TEST_P ( TestGenerationTest  ,
TestsExpandedAndRun   
)

Definition at line 675 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( TestExpansionModule  ,
TestGenerationTest  ,
ValuesIn(test_generation_params  
)
TEST_P ( GeneratorEvaluationTest  ,
GeneratorsEvaluatedInMain   
)

Definition at line 703 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( GenEvalModule  ,
GeneratorEvaluationTest  ,
Values(GeneratorEvaluationTest::param_value())   
)
TEST_P ( ExternalGeneratorTest  ,
ExternalGenerator   
)

Definition at line 713 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( ExternalGeneratorModule  ,
ExternalGeneratorTest  ,
extern_gen   
)
TEST_P ( ExternalInstantiationTest  ,
IsMultipleOf33   
)

Definition at line 725 of file googletest-param-test-test.cc.

TEST_P ( MultipleInstantiationTest  ,
AllowsMultipleInstances   
)

Definition at line 732 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( Sequence1  ,
MultipleInstantiationTest  ,
Values(1, 2)   
)
INSTANTIATE_TEST_SUITE_P ( Sequence2  ,
MultipleInstantiationTest  ,
Range(3, 5)   
)
TEST_P ( InstantiationInMultipleTranslationUnitsTest  ,
IsMultipleOf42   
)

Definition at line 742 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( Sequence1  ,
InstantiationInMultipleTranslationUnitsTest  ,
Values(42, 42 *2)   
)
TEST_P ( SeparateInstanceTest  ,
TestsRunInSeparateInstances   
)

Definition at line 768 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( FourElemSequence  ,
SeparateInstanceTest  ,
Range(1, 4)   
)
TEST_P ( NamingTest  ,
TestsReportCorrectNamesAndParameters   
)

Definition at line 781 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( ZeroToFiveSequence  ,
NamingTest  ,
Range(0, 5)   
)
TEST_P ( PREFIX_WITH_MACRO(NamingTest ,
PREFIX_WITH_FOO(SomeTestName)   
)

Definition at line 802 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( FortyTwo  ,
MacroNamingTest  ,
Values(42)   
)
TEST_F ( PREFIX_WITH_MACRO(NamingTestNonParametrized)  ,
PREFIX_WITH_FOO(SomeTestName)   
)

Definition at line 815 of file googletest-param-test-test.cc.

TEST ( MacroNameing  ,
LookupNames   
)

Definition at line 824 of file googletest-param-test-test.cc.

TEST_P ( CustomFunctorNamingTest  ,
CustomTestNames   
)

Definition at line 859 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( CustomParamNameFunctor  ,
CustomFunctorNamingTest  ,
Values(std::string("FunctorName"))  ,
CustomParamNameFunctor()   
)
INSTANTIATE_TEST_SUITE_P ( AllAllowedCharacters  ,
CustomFunctorNamingTest  ,
Values("abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ","01234567890_")  ,
CustomParamNameFunctor()   
)
std::string CustomParamNameFunction ( const ::testing::TestParamInfo< std::string > &  inf)
inline

Definition at line 876 of file googletest-param-test-test.cc.

TEST_P ( CustomFunctionNamingTest  ,
CustomTestNames   
)

Definition at line 882 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( CustomParamNameFunction  ,
CustomFunctionNamingTest  ,
Values(std::string("FunctionName"))  ,
CustomParamNameFunction   
)
INSTANTIATE_TEST_SUITE_P ( CustomParamNameFunctionP  ,
CustomFunctionNamingTest  ,
Values(std::string("FunctionNameP"))  ,
CustomParamNameFunction 
)
TEST_P ( CustomLambdaNamingTest  ,
CustomTestNames   
)

Definition at line 895 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( CustomParamNameLambda  ,
CustomLambdaNamingTest  ,
Values(std::string("LambdaName"))  ,
[] (const ::testing::TestParamInfo< std::string > &inf){return inf.param;}   
)
TEST ( CustomNamingTest  ,
CheckNameRegistry   
)

Definition at line 903 of file googletest-param-test-test.cc.

TEST_P ( CustomIntegerNamingTest  ,
TestsReportCorrectNames   
)

Definition at line 925 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( PrintToString  ,
CustomIntegerNamingTest  ,
Range(0, 5)  ,
::testing::  PrintToStringParamName() 
)
std::ostream& operator<< ( std::ostream &  stream,
const CustomStruct val 
)

Definition at line 943 of file googletest-param-test-test.cc.

TEST_P ( CustomStructNamingTest  ,
TestsReportCorrectNames   
)

Definition at line 950 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( PrintToString  ,
CustomStructNamingTest  ,
Values(CustomStruct(0), CustomStruct(1))  ,
::testing::  PrintToStringParamName() 
)
TEST_P ( StatefulNamingTest  ,
TestsReportCorrectNames   
)

Definition at line 980 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( StatefulNamingFunctor  ,
StatefulNamingTest  ,
Range(0, 5)  ,
StatefulNamingFunctor()   
)
TEST_P ( CommentTest  ,
TestsCorrectlyReportUnstreamableParams   
)

Definition at line 1008 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( InstantiationWithComments  ,
CommentTest  ,
Values(Unstreamable(1))   
)
TEST_F ( NonParameterizedBaseTest  ,
FixtureIsInitialized   
)

Definition at line 1039 of file googletest-param-test-test.cc.

TEST_P ( ParameterizedDerivedTest  ,
SeesSequence   
)

Definition at line 1043 of file googletest-param-test-test.cc.

TEST_F ( ParameterizedDeathTest  ,
GetParamDiesFromTestF   
)

Definition at line 1051 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( RangeZeroToFive  ,
ParameterizedDerivedTest  ,
Range(0, 5)   
)
TEST_P ( MyEnumTest  ,
ChecksParamMoreThanZero   
)

Definition at line 1068 of file googletest-param-test-test.cc.

INSTANTIATE_TEST_SUITE_P ( MyEnumTests  ,
MyEnumTest  ,
::testing::  ValuesENUM1, ENUM2, 0 
)
int main ( int  argc,
char **  argv 
)

Definition at line 1104 of file googletest-param-test-test.cc.

Variable Documentation

const int test_generation_params[] = {36, 42, 72}

Definition at line 609 of file googletest-param-test-test.cc.

ParamGenerator<int> extern_gen

Definition at line 43 of file googletest-param-test2-test.cc.