testing Namespace Reference

## Namespaces

| internal
| internal2

## Classes

class | EmptyTestEventListener
class | Environment
class | Message
struct | PrintToStringParamName
class | ScopedTrace
class | Test
class | TestEventListener
class | TestEventListeners
class | TestInfo
struct | TestParamInfo
class | TestProperty
class | TestResult
class | TestSuite
class | TestWithParam
class | UnitTest
class | WithParamInterface

## Typedefs

typedef internal::TimeInMillis | TimeInMillis

## Functions

| GTEST_DEFINE_string_ (death_test_style, internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle), "Indicates how to run a death test in a forked child process: " "\hreadsafe\(child process re-executes the test binary " "from the beginning, running only the specific death test) or " "\ast\(child process runs the death test immediately " "after forking).")

GTEST_DEFINE_bool_ (death_test_use_fork, internal::BoolFromGTestEnv("death_test_use_fork", false), "Instructs to use fork()/_exit() instead of clone() in death tests. " "Ignored and always uses fork() on POSIX systems where clone() is not " "implemented. Useful when running under valgrind or similar tools if " "those do not support clone(). Valgrind 3.3.1 will just fail if " "it sees an unsupported combination of clone() flags. " "It is not recommended to use this flag w/o valgrind though it will " "work in 99% of the cases. Once valgrind is fixed, this flag will " "most likely be removed.")

std::ostream & | operator<< (std::ostream &os, const TestPartResult &result)
std::ostream & | operator<< (std::ostream &os, const Message &sb)
template<typename T >
::std::string | PrintToString (const T &value)
| GTEST_DECLARE_string_ (death_test_style)
template<class Container >
internal::ParamGenerator< typename Container::value_type > | ValuesIn (const Container &container)
template<typename T , typename IncrementT >
internal::ParamGenerator< T > | Range (T start, T end, IncrementT step)
template<typename T >
internal::ParamGenerator< T > | Range (T start, T end)
template<typename ForwardIterator >
internal::ParamGenerator< typename ::testing::internal::IteratorTraits< ForwardIterator >::value_type > | ValuesIn (ForwardIterator begin, ForwardIterator end)
template<typename T , size_t N>
internal::ParamGenerator< T > | ValuesIn (const T(&array)[N])
template<typename... T>
internal::ValueArray< T... > | Values (T... v)
internal::ParamGenerator< bool > | Bool ()
template<typename Generator1 , typename Generator2 >
internal::CartesianProductHolder2< Generator1, Generator2 > | Combine (const Generator1 &g1, const Generator2 &g2)
template<typename Generator1 , typename Generator2 , typename Generator3 >
internal::CartesianProductHolder3< Generator1, Generator2, Generator3 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 >
internal::CartesianProductHolder4< Generator1, Generator2, Generator3, Generator4 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 >
internal::CartesianProductHolder5< Generator1, Generator2, Generator3, Generator4, Generator5 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4, const Generator5 &g5)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 >
internal::CartesianProductHolder6< Generator1, Generator2, Generator3, Generator4, Generator5, Generator6 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4, const Generator5 &g5, const Generator6 &g6)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 >
internal::CartesianProductHolder7< Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4, const Generator5 &g5, const Generator6 &g6, const Generator7 &g7)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 , typename Generator8 >
internal::CartesianProductHolder8< Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4, const Generator5 &g5, const Generator6 &g6, const Generator7 &g7, const Generator8 &g8)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 , typename Generator8 , typename Generator9 >
internal::CartesianProductHolder9< Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4, const Generator5 &g5, const Generator6 &g6, const Generator7 &g7, const Generator8 &g8, const Generator9 &g9)
template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 , typename Generator8 , typename Generator9 , typename Generator10 >
internal::CartesianProductHolder10< Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, Generator10 > | Combine (const Generator1 &g1, const Generator2 &g2, const Generator3 &g3, const Generator4 &g4, const Generator5 &g5, const Generator6 &g6, const Generator7 &g7, const Generator8 &g8, const Generator9 &g9, const Generator10 &g10)
template<typename Pred , typename T1 >
AssertionResult | AssertPred1Helper (const char *pred_text, const char *e1, Pred pred, const T1 &v1)
template<typename Pred , typename T1 , typename T2 >
AssertionResult | AssertPred2Helper (const char *pred_text, const char *e1, const char *e2, Pred pred, const T1 &v1, const T2 &v2)
template<typename Pred , typename T1 , typename T2 , typename T3 >
AssertionResult | AssertPred3Helper (const char *pred_text, const char *e1, const char *e2, const char *e3, Pred pred, const T1 &v1, const T2 &v2, const T3 &v3)
template<typename Pred , typename T1 , typename T2 , typename T3 , typename T4 >
AssertionResult | AssertPred4Helper (const char *pred_text, const char *e1, const char *e2, const char *e3, const char *e4, Pred pred, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
template<typename Pred , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
AssertionResult | AssertPred5Helper (const char *pred_text, const char *e1, const char *e2, const char *e3, const char *e4, const char *e5, Pred pred, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5)
Environment * | AddGlobalTestEnvironment (Environment *env)
GTEST_API_ void | InitGoogleTest (int *argc, char **argv)
GTEST_API_ void | InitGoogleTest (int *argc, wchar_t **argv)
GTEST_API_ AssertionResult | IsSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
GTEST_API_ AssertionResult | IsSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
GTEST_API_ AssertionResult | IsNotSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
GTEST_API_ AssertionResult | IsNotSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
GTEST_API_ AssertionResult | IsSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
GTEST_API_ AssertionResult | IsNotSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
GTEST_API_ AssertionResult | IsSubstring (const char *needle_expr, const char *haystack_expr, const ::std::wstring &needle, const ::std::wstring &haystack)
GTEST_API_ AssertionResult | IsNotSubstring (const char *needle_expr, const char *haystack_expr, const ::std::wstring &needle, const ::std::wstring &haystack)
GTEST_API_ AssertionResult | FloatLE (const char *expr1, const char *expr2, float val1, float val2)
GTEST_API_ AssertionResult | DoubleLE (const char *expr1, const char *expr2, double val1, double val2)
template<typename T1 , typename T2 >
bool | StaticAssertTypeEq ()
GTEST_API_ std::string | TempDir ()
template<int &... ExplicitParameterBarrier, typename Factory >
TestInfo * | RegisterTest (const char *test_suite_name, const char *test_name, const char *type_param, const char *value_param, const char *file, int line, Factory factory)

## Variables

class GTEST_API_ testing::ScopedTrace | GTEST_ATTRIBUTE_UNUSED_

## Typedef Documentation

## TimeInMillis

typedef internal::TimeInMillis testing::TimeInMillis

Definition at line 15127 of file gtest.h.

## Function Documentation

## AddGlobalTestEnvironment()

Environment* testing::AddGlobalTestEnvironment | ( | Environment * | env | ) |

inline

Definition at line 16067 of file gtest.h.

## AssertPred1Helper()

template<typename Pred , typename T1 >

AssertionResult testing::AssertPred1Helper | ( | const char * | pred_text,
|  | const char * | e1,
|  | Pred | pred,
|  | const T1 & | v1
| ) |  |

Definition at line 14715 of file gtest.h.

## AssertPred2Helper()

template<typename Pred , typename T1 , typename T2 >

AssertionResult testing::AssertPred2Helper | ( | const char * | pred_text,
|  | const char * | e1,
|  | const char * | e2,
|  | Pred | pred,
|  | const T1 & | v1,
|  | const T2 & | v2
| ) |  |

Definition at line 14758 of file gtest.h.

## AssertPred3Helper()

template<typename Pred , typename T1 , typename T2 , typename T3 >

AssertionResult testing::AssertPred3Helper | ( | const char * | pred_text,
|  | const char * | e1,
|  | const char * | e2,
|  | const char * | e3,
|  | Pred | pred,
|  | const T1 & | v1,
|  | const T2 & | v2,
|  | const T3 & | v3
| ) |  |

Definition at line 14808 of file gtest.h.

## AssertPred4Helper()

template<typename Pred , typename T1 , typename T2 , typename T3 , typename T4 >

AssertionResult testing::AssertPred4Helper | ( | const char * | pred_text,
|  | const char * | e1,
|  | const char * | e2,
|  | const char * | e3,
|  | const char * | e4,
|  | Pred | pred,
|  | const T1 & | v1,
|  | const T2 & | v2,
|  | const T3 & | v3,
|  | const T4 & | v4
| ) |  |

Definition at line 14864 of file gtest.h.

## AssertPred5Helper()

template<typename Pred , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >

AssertionResult testing::AssertPred5Helper | ( | const char * | pred_text,
|  | const char * | e1,
|  | const char * | e2,
|  | const char * | e3,
|  | const char * | e4,
|  | const char * | e5,
|  | Pred | pred,
|  | const T1 & | v1,
|  | const T2 & | v2,
|  | const T3 & | v3,
|  | const T4 & | v4,
|  | const T5 & | v5
| ) |  |

Definition at line 14926 of file gtest.h.

## Bool()

internal::ParamGenerator<bool> testing::Bool | ( |  | ) |

inline

Definition at line 13520 of file gtest.h.

## Combine() [1/9]

template<typename Generator1 , typename Generator2 >

internal::CartesianProductHolder2<Generator1, Generator2> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2
| ) |  |

Definition at line 13571 of file gtest.h.

## Combine() [2/9]

template<typename Generator1 , typename Generator2 , typename Generator3 >

internal::CartesianProductHolder3<Generator1, Generator2, Generator3> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3
| ) |  |

Definition at line 13578 of file gtest.h.

## Combine() [3/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 >

internal::CartesianProductHolder4<Generator1, Generator2, Generator3, Generator4> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4
| ) |  |

Definition at line 13587 of file gtest.h.

## Combine() [4/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 >

internal::CartesianProductHolder5<Generator1, Generator2, Generator3, Generator4, Generator5> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4,
|  | const Generator5 & | g5
| ) |  |

Definition at line 13598 of file gtest.h.

## Combine() [5/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 >

internal::CartesianProductHolder6<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4,
|  | const Generator5 & | g5,
|  | const Generator6 & | g6
| ) |  |

Definition at line 13609 of file gtest.h.

## Combine() [6/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 >

internal::CartesianProductHolder7<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4,
|  | const Generator5 & | g5,
|  | const Generator6 & | g6,
|  | const Generator7 & | g7
| ) |  |

Definition at line 13621 of file gtest.h.

## Combine() [7/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 , typename Generator8 >

internal::CartesianProductHolder8<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4,
|  | const Generator5 & | g5,
|  | const Generator6 & | g6,
|  | const Generator7 & | g7,
|  | const Generator8 & | g8
| ) |  |

Definition at line 13634 of file gtest.h.

## Combine() [8/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 , typename Generator8 , typename Generator9 >

internal::CartesianProductHolder9<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4,
|  | const Generator5 & | g5,
|  | const Generator6 & | g6,
|  | const Generator7 & | g7,
|  | const Generator8 & | g8,
|  | const Generator9 & | g9
| ) |  |

Definition at line 13648 of file gtest.h.

## Combine() [9/9]

template<typename Generator1 , typename Generator2 , typename Generator3 , typename Generator4 , typename Generator5 , typename Generator6 , typename Generator7 , typename Generator8 , typename Generator9 , typename Generator10 >

internal::CartesianProductHolder10<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, Generator10> testing::Combine | ( | const Generator1 & | g1,
|  | const Generator2 & | g2,
|  | const Generator3 & | g3,
|  | const Generator4 & | g4,
|  | const Generator5 & | g5,
|  | const Generator6 & | g6,
|  | const Generator7 & | g7,
|  | const Generator8 & | g8,
|  | const Generator9 & | g9,
|  | const Generator10 & | g10
| ) |  |

Definition at line 13663 of file gtest.h.

## DoubleLE()

GTEST_API_ AssertionResult testing::DoubleLE | ( | const char * | expr1,
|  | const char * | expr2,
|  | double | val1,
|  | double | val2
| ) |  |

## FloatLE()

GTEST_API_ AssertionResult testing::FloatLE | ( | const char * | expr1,
|  | const char * | expr2,
|  | float | val1,
|  | float | val2
| ) |  |

## GTEST_DECLARE_string_()

testing::GTEST_DECLARE_string_ | ( | death_test_style |  | ) |

## GTEST_DEFINE_bool_()

testing::GTEST_DEFINE_bool_ | ( | death_test_use_fork | ,
|  | internal::BoolFromGTestEnv("death_test_use_fork", false) | ,

"Instructs to use fork()/_exit() instead of clone() in death tests. " "Ignored and always uses fork() on POSIX systems where clone() is not " "implemented. Useful when running under valgrind or similar tools if " "those do not support clone(). Valgrind 3.3.1 will just fail if " "it sees an unsupported combination of clone() flags. " "It is not recommended to use this flag w/o valgrind though it will " "work in 99% of the cases. Once valgrind is

fixed,

|  | this flag will " "most likely be removed." |
| ) |  |

## GTEST_DEFINE_string_()

testing::GTEST_DEFINE_string_ | ( | death_test_style | ,
|  | internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle) | ,
|  | "Indicates how to run a death test in a forked child process: " "\eadsafe\hild process re-executes the test binary " "from the beginning, running only the specific death test) or " "\t\hild process runs the death test immediately " "after forking)." |
| ) |  |

## InitGoogleTest() [1/2]

GTEST_API_ void testing::InitGoogleTest | ( | int * | argc,
|  | char ** | argv
| ) |  |

## InitGoogleTest() [2/2]

GTEST_API_ void testing::InitGoogleTest | ( | int * | argc,
|  | wchar_t ** | argv
| ) |  |

## IsNotSubstring() [1/4]

GTEST_API_ AssertionResult testing::IsNotSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const char * | needle,
|  | const char * | haystack
| ) |  |

## IsNotSubstring() [2/4]

GTEST_API_ AssertionResult testing::IsNotSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const wchar_t * | needle,
|  | const wchar_t * | haystack
| ) |  |

## IsNotSubstring() [3/4]

GTEST_API_ AssertionResult testing::IsNotSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const ::std::string & | needle,
|  | const ::std::string & | haystack
| ) |  |

## IsNotSubstring() [4/4]

GTEST_API_ AssertionResult testing::IsNotSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const ::std::wstring & | needle,
|  | const ::std::wstring & | haystack
| ) |  |

## IsSubstring() [1/4]

GTEST_API_ AssertionResult testing::IsSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const char * | needle,
|  | const char * | haystack
| ) |  |

## IsSubstring() [2/4]

GTEST_API_ AssertionResult testing::IsSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const wchar_t * | needle,
|  | const wchar_t * | haystack
| ) |  |

## IsSubstring() [3/4]

GTEST_API_ AssertionResult testing::IsSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const ::std::string & | needle,
|  | const ::std::string & | haystack
| ) |  |

## IsSubstring() [4/4]

GTEST_API_ AssertionResult testing::IsSubstring | ( | const char * | needle_expr,
|  | const char * | haystack_expr,
|  | const ::std::wstring & | needle,
|  | const ::std::wstring & | haystack
| ) |  |

## operator<<() [1/2]

std::ostream& testing::operator<< | ( | std::ostream & | os,
|  | const Message & | sb
| ) |  |

inline

Definition at line 2758 of file gtest.h.

## operator<<() [2/2]

std::ostream& testing::operator<< | ( | std::ostream & | os,
|  | const TestPartResult & | result
| ) |  |

Definition at line 11501 of file gtest-all.cc.

## PrintToString()

template<typename T >

::std::string testing::PrintToString | ( | const T & | value | ) |

Definition at line 8969 of file gtest.h.

## Range() [1/2]

template<typename T , typename IncrementT >

internal::ParamGenerator<T> testing::Range | ( | T | start,
|  | T | end,
|  | IncrementT | step
| ) |  |

Definition at line 13389 of file gtest.h.

## Range() [2/2]

template<typename T >

internal::ParamGenerator<T> testing::Range | ( | T | start,
|  | T | end
| ) |  |

Definition at line 13395 of file gtest.h.

## RegisterTest()

template<int &... ExplicitParameterBarrier, typename Factory >

TestInfo* testing::RegisterTest | ( | const char * | test_suite_name,
|  | const char * | test_name,
|  | const char * | type_param,
|  | const char * | value_param,
|  | const char * | file,
|  | int | line,
|  | Factory | factory
| ) |  |

Definition at line 17063 of file gtest.h.

## StaticAssertTypeEq()

template<typename T1 , typename T2 >

bool testing::StaticAssertTypeEq | ( |  | ) |

Definition at line 16927 of file gtest.h.

## TempDir()

GTEST_API_ std::string testing::TempDir | ( |  | ) |

## Values()

template<typename... T>

internal::ValueArray<T...> testing::Values | ( | T... | v | ) |

Definition at line 13496 of file gtest.h.

## ValuesIn() [1/3]

template<class Container >

internal::ParamGenerator< typename Container::value_type > testing::ValuesIn | ( | const Container & | container | ) |

Definition at line 13470 of file gtest.h.

## ValuesIn() [2/3]

template<typename ForwardIterator >

internal::ParamGenerator< typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> testing::ValuesIn | ( | ForwardIterator | begin,
|  | ForwardIterator | end
| ) |  |

Definition at line 13457 of file gtest.h.

## ValuesIn() [3/3]

template<typename T , size_t N>

internal::ParamGenerator<T> testing::ValuesIn | ( | const T(&) | array[N] | ) |

Definition at line 13465 of file gtest.h.

## Variable Documentation

## GTEST_ATTRIBUTE_UNUSED_

class GTEST_API_ testing::ScopedTrace testing::GTEST_ATTRIBUTE_UNUSED_