Xmipp  v3.23.11-Nereus
Classes | Namespaces | Macros | Typedefs | Functions | Variables
gtest.h File Reference
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <limits>
#include <memory>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#include "gtest/gtest-assertion-result.h"
#include "gtest/gtest-death-test.h"
#include "gtest/gtest-matchers.h"
#include "gtest/gtest-message.h"
#include "gtest/gtest-param-test.h"
#include "gtest/gtest-printers.h"
#include "gtest/gtest-test-part.h"
#include "gtest/gtest-typed-test.h"
#include "gtest/gtest_pred_impl.h"
#include "gtest/gtest_prod.h"
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
Include dependency graph for gtest.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  testing::internal::GTestNonCopyable
 
class  testing::Test
 
class  testing::TestProperty
 
class  testing::TestResult
 
class  testing::TestInfo
 
class  testing::TestSuite
 
class  testing::Environment
 
class  testing::TestEventListener
 
class  testing::EmptyTestEventListener
 
class  testing::TestEventListeners
 
class  testing::UnitTest
 
struct  testing::internal::faketype
 
class  testing::internal::EqHelper
 
class  testing::internal::AssertHelper
 
class  testing::WithParamInterface< T >
 
class  testing::TestWithParam< T >
 
class  testing::ScopedTrace
 

Namespaces

 testing
 
 testing::internal
 

Macros

#define GTEST_IMPL_CMP_HELPER_(op_name, op)
 
#define GTEST_SKIP()   GTEST_SKIP_("")
 
#define ADD_FAILURE()   GTEST_NONFATAL_FAILURE_("Failed")
 
#define ADD_FAILURE_AT(file, line)
 
#define GTEST_FAIL()   GTEST_FATAL_FAILURE_("Failed")
 
#define GTEST_FAIL_AT(file, line)
 
#define FAIL()   GTEST_FAIL()
 
#define GTEST_SUCCEED()   GTEST_SUCCESS_("Succeeded")
 
#define SUCCEED()   GTEST_SUCCEED()
 
#define EXPECT_THROW(statement, expected_exception)   GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
 
#define EXPECT_NO_THROW(statement)   GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
 
#define EXPECT_ANY_THROW(statement)   GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
 
#define ASSERT_THROW(statement, expected_exception)   GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
 
#define ASSERT_NO_THROW(statement)   GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
 
#define ASSERT_ANY_THROW(statement)   GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
 
#define GTEST_EXPECT_TRUE(condition)
 
#define GTEST_EXPECT_FALSE(condition)
 
#define GTEST_ASSERT_TRUE(condition)   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, GTEST_FATAL_FAILURE_)
 
#define GTEST_ASSERT_FALSE(condition)
 
#define EXPECT_TRUE(condition)   GTEST_EXPECT_TRUE(condition)
 
#define EXPECT_FALSE(condition)   GTEST_EXPECT_FALSE(condition)
 
#define ASSERT_TRUE(condition)   GTEST_ASSERT_TRUE(condition)
 
#define ASSERT_FALSE(condition)   GTEST_ASSERT_FALSE(condition)
 
#define EXPECT_EQ(val1, val2)   EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
 
#define EXPECT_NE(val1, val2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
 
#define EXPECT_LE(val1, val2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
 
#define EXPECT_LT(val1, val2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
 
#define EXPECT_GE(val1, val2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
 
#define EXPECT_GT(val1, val2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
 
#define GTEST_ASSERT_EQ(val1, val2)   ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
 
#define GTEST_ASSERT_NE(val1, val2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
 
#define GTEST_ASSERT_LE(val1, val2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
 
#define GTEST_ASSERT_LT(val1, val2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
 
#define GTEST_ASSERT_GE(val1, val2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
 
#define GTEST_ASSERT_GT(val1, val2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
 
#define ASSERT_EQ(val1, val2)   GTEST_ASSERT_EQ(val1, val2)
 
#define ASSERT_NE(val1, val2)   GTEST_ASSERT_NE(val1, val2)
 
#define ASSERT_LE(val1, val2)   GTEST_ASSERT_LE(val1, val2)
 
#define ASSERT_LT(val1, val2)   GTEST_ASSERT_LT(val1, val2)
 
#define ASSERT_GE(val1, val2)   GTEST_ASSERT_GE(val1, val2)
 
#define ASSERT_GT(val1, val2)   GTEST_ASSERT_GT(val1, val2)
 
#define EXPECT_STREQ(s1, s2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
 
#define EXPECT_STRNE(s1, s2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
 
#define EXPECT_STRCASEEQ(s1, s2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
 
#define EXPECT_STRCASENE(s1, s2)   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
 
#define ASSERT_STREQ(s1, s2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
 
#define ASSERT_STRNE(s1, s2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
 
#define ASSERT_STRCASEEQ(s1, s2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
 
#define ASSERT_STRCASENE(s1, s2)   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
 
#define EXPECT_FLOAT_EQ(val1, val2)
 
#define EXPECT_DOUBLE_EQ(val1, val2)
 
#define ASSERT_FLOAT_EQ(val1, val2)
 
#define ASSERT_DOUBLE_EQ(val1, val2)
 
#define EXPECT_NEAR(val1, val2, abs_error)
 
#define ASSERT_NEAR(val1, val2, abs_error)
 
#define ASSERT_NO_FATAL_FAILURE(statement)   GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
 
#define EXPECT_NO_FATAL_FAILURE(statement)   GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
 
#define SCOPED_TRACE(message)
 
#define GTEST_TEST(test_suite_name, test_name)
 
#define TEST(test_suite_name, test_name)   GTEST_TEST(test_suite_name, test_name)
 
#define GTEST_TEST_F(test_fixture, test_name)
 
#define TEST_F(test_fixture, test_name)   GTEST_TEST_F(test_fixture, test_name)
 

Typedefs

using testing::TestCase = TestSuite
 
typedef internal::TimeInMillis testing::TimeInMillis
 

Functions

 GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) GTEST_DECLARE_bool_(also_run_disabled_tests)
 
 GTEST_DECLARE_bool_ (break_on_failure)
 
 GTEST_DECLARE_bool_ (catch_exceptions)
 
 GTEST_DECLARE_string_ (color)
 
 GTEST_DECLARE_bool_ (fail_fast)
 
 GTEST_DECLARE_string_ (filter)
 
 GTEST_DECLARE_bool_ (install_failure_signal_handler)
 
 GTEST_DECLARE_bool_ (list_tests)
 
 GTEST_DECLARE_string_ (output)
 
 GTEST_DECLARE_bool_ (brief)
 
 GTEST_DECLARE_bool_ (print_time)
 
 GTEST_DECLARE_bool_ (print_utf8)
 
 GTEST_DECLARE_int32_ (random_seed)
 
 GTEST_DECLARE_int32_ (repeat)
 
 GTEST_DECLARE_bool_ (recreate_environments_when_repeating)
 
 GTEST_DECLARE_bool_ (show_internal_stack_frames)
 
 GTEST_DECLARE_bool_ (shuffle)
 
 GTEST_DECLARE_int32_ (stack_trace_depth)
 
 GTEST_DECLARE_bool_ (throw_on_failure)
 
 GTEST_DECLARE_string_ (stream_result_to)
 
class UnitTestImpl * testing::internal::GetUnitTestImpl ()
 
void testing::internal::ReportFailureInUnknownLocation (TestPartResult::Type result_type, const std::string &message)
 
std::set< std::string > * testing::internal::GetIgnoredParameterizedTestSuites ()
 
Environment * testing::AddGlobalTestEnvironment (Environment *env)
 
GTEST_API_ void testing::InitGoogleTest (int *argc, char **argv)
 
GTEST_API_ void testing::InitGoogleTest (int *argc, wchar_t **argv)
 
GTEST_API_ void testing::InitGoogleTest ()
 
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperEQFailure (const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
 
bool testing::internal::operator== (faketype, faketype)
 
bool testing::internal::operator!= (faketype, faketype)
 
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperEQ (const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
 
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperOpFailure (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRCASEEQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRCASENE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
 
GTEST_API_ AssertionResult testing::IsSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
 
GTEST_API_ AssertionResult testing::IsSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
 
GTEST_API_ AssertionResult testing::IsNotSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
 
GTEST_API_ AssertionResult testing::IsNotSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
 
GTEST_API_ AssertionResult testing::IsSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
 
GTEST_API_ AssertionResult testing::IsNotSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
 
template<typename RawType >
AssertionResult testing::internal::CmpHelperFloatingPointEQ (const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
 
GTEST_API_ AssertionResult testing::internal::DoubleNearPredFormat (const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
 
GTEST_API_ AssertionResult testing::FloatLE (const char *expr1, const char *expr2, float val1, float val2)
 
GTEST_API_ AssertionResult testing::DoubleLE (const char *expr1, const char *expr2, double val1, double val2)
 
template<typename T1 , typename T2 >
constexpr bool testing::StaticAssertTypeEq () noexcept
 
GTEST_API_ std::string testing::TempDir ()
 
GTEST_API_ std::string testing::SrcDir ()
 
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)
 
int RUN_ALL_TESTS () GTEST_MUST_USE_RESULT_
 

Variables

const int testing::kMaxStackTraceDepth = 100
 

Macro Definition Documentation

◆ ADD_FAILURE

#define ADD_FAILURE ( )    GTEST_NONFATAL_FAILURE_("Failed")

Definition at line 1730 of file gtest.h.

◆ ADD_FAILURE_AT

#define ADD_FAILURE_AT (   file,
  line 
)
Value:
GTEST_MESSAGE_AT_(file, line, "Failed", \
::testing::TestPartResult::kNonFatalFailure)
#define GTEST_MESSAGE_AT_(file, line, message, result_type)

Definition at line 1734 of file gtest.h.

◆ ASSERT_ANY_THROW

#define ASSERT_ANY_THROW (   statement)    GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)

Definition at line 1780 of file gtest.h.

◆ ASSERT_DOUBLE_EQ

#define ASSERT_DOUBLE_EQ (   val1,
  val2 
)
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
val1, val2)
#define ASSERT_PRED_FORMAT2(pred_format, v1, v2)

Definition at line 1976 of file gtest.h.

◆ ASSERT_EQ

#define ASSERT_EQ (   val1,
  val2 
)    GTEST_ASSERT_EQ(val1, val2)

Definition at line 1893 of file gtest.h.

◆ ASSERT_FALSE

#define ASSERT_FALSE (   condition)    GTEST_ASSERT_FALSE(condition)

Definition at line 1814 of file gtest.h.

◆ ASSERT_FLOAT_EQ

#define ASSERT_FLOAT_EQ (   val1,
  val2 
)
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
val1, val2)
#define ASSERT_PRED_FORMAT2(pred_format, v1, v2)

Definition at line 1972 of file gtest.h.

◆ ASSERT_GE

#define ASSERT_GE (   val1,
  val2 
)    GTEST_ASSERT_GE(val1, val2)

Definition at line 1909 of file gtest.h.

◆ ASSERT_GT

#define ASSERT_GT (   val1,
  val2 
)    GTEST_ASSERT_GT(val1, val2)

Definition at line 1913 of file gtest.h.

◆ ASSERT_LE

#define ASSERT_LE (   val1,
  val2 
)    GTEST_ASSERT_LE(val1, val2)

Definition at line 1901 of file gtest.h.

◆ ASSERT_LT

#define ASSERT_LT (   val1,
  val2 
)    GTEST_ASSERT_LT(val1, val2)

Definition at line 1905 of file gtest.h.

◆ ASSERT_NE

#define ASSERT_NE (   val1,
  val2 
)    GTEST_ASSERT_NE(val1, val2)

Definition at line 1897 of file gtest.h.

◆ ASSERT_NEAR

#define ASSERT_NEAR (   val1,
  val2,
  abs_error 
)
Value:
abs_error)
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3)

Definition at line 1984 of file gtest.h.

◆ ASSERT_NO_FATAL_FAILURE

#define ASSERT_NO_FATAL_FAILURE (   statement)    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)

Definition at line 2035 of file gtest.h.

◆ ASSERT_NO_THROW

#define ASSERT_NO_THROW (   statement)    GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)

Definition at line 1778 of file gtest.h.

◆ ASSERT_STRCASEEQ

#define ASSERT_STRCASEEQ (   s1,
  s2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)

Definition at line 1945 of file gtest.h.

◆ ASSERT_STRCASENE

#define ASSERT_STRCASENE (   s1,
  s2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)

Definition at line 1947 of file gtest.h.

◆ ASSERT_STREQ

#define ASSERT_STREQ (   s1,
  s2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)

Definition at line 1941 of file gtest.h.

◆ ASSERT_STRNE

#define ASSERT_STRNE (   s1,
  s2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)

Definition at line 1943 of file gtest.h.

◆ ASSERT_THROW

#define ASSERT_THROW (   statement,
  expected_exception 
)    GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)

Definition at line 1776 of file gtest.h.

◆ ASSERT_TRUE

#define ASSERT_TRUE (   condition)    GTEST_ASSERT_TRUE(condition)

Definition at line 1810 of file gtest.h.

◆ EXPECT_ANY_THROW

#define EXPECT_ANY_THROW (   statement)    GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)

Definition at line 1774 of file gtest.h.

◆ EXPECT_DOUBLE_EQ

#define EXPECT_DOUBLE_EQ (   val1,
  val2 
)
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
val1, val2)
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)

Definition at line 1968 of file gtest.h.

◆ EXPECT_EQ

#define EXPECT_EQ (   val1,
  val2 
)    EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)

Definition at line 1863 of file gtest.h.

◆ EXPECT_FALSE

#define EXPECT_FALSE (   condition)    GTEST_EXPECT_FALSE(condition)

Definition at line 1806 of file gtest.h.

◆ EXPECT_FLOAT_EQ

#define EXPECT_FLOAT_EQ (   val1,
  val2 
)
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
val1, val2)
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)

Definition at line 1964 of file gtest.h.

◆ EXPECT_GE

#define EXPECT_GE (   val1,
  val2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

Definition at line 1871 of file gtest.h.

◆ EXPECT_GT

#define EXPECT_GT (   val1,
  val2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

Definition at line 1873 of file gtest.h.

◆ EXPECT_LE

#define EXPECT_LE (   val1,
  val2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

Definition at line 1867 of file gtest.h.

◆ EXPECT_LT

#define EXPECT_LT (   val1,
  val2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

Definition at line 1869 of file gtest.h.

◆ EXPECT_NE

#define EXPECT_NE (   val1,
  val2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

Definition at line 1865 of file gtest.h.

◆ EXPECT_NEAR

#define EXPECT_NEAR (   val1,
  val2,
  abs_error 
)
Value:
abs_error)
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3)

Definition at line 1980 of file gtest.h.

◆ EXPECT_NO_FATAL_FAILURE

#define EXPECT_NO_FATAL_FAILURE (   statement)    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)

Definition at line 2037 of file gtest.h.

◆ EXPECT_NO_THROW

#define EXPECT_NO_THROW (   statement)    GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)

Definition at line 1772 of file gtest.h.

◆ EXPECT_STRCASEEQ

#define EXPECT_STRCASEEQ (   s1,
  s2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)

Definition at line 1936 of file gtest.h.

◆ EXPECT_STRCASENE

#define EXPECT_STRCASENE (   s1,
  s2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)

Definition at line 1938 of file gtest.h.

◆ EXPECT_STREQ

#define EXPECT_STREQ (   s1,
  s2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)

Definition at line 1932 of file gtest.h.

◆ EXPECT_STRNE

#define EXPECT_STRNE (   s1,
  s2 
)    EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)

Definition at line 1934 of file gtest.h.

◆ EXPECT_THROW

#define EXPECT_THROW (   statement,
  expected_exception 
)    GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)

Definition at line 1770 of file gtest.h.

◆ EXPECT_TRUE

#define EXPECT_TRUE (   condition)    GTEST_EXPECT_TRUE(condition)

Definition at line 1802 of file gtest.h.

◆ FAIL

#define FAIL ( )    GTEST_FAIL()

Definition at line 1749 of file gtest.h.

◆ GTEST_ASSERT_EQ

#define GTEST_ASSERT_EQ (   val1,
  val2 
)    ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)

Definition at line 1876 of file gtest.h.

◆ GTEST_ASSERT_FALSE

#define GTEST_ASSERT_FALSE (   condition)
Value:
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail)
#define GTEST_FATAL_FAILURE_(message)

Definition at line 1794 of file gtest.h.

◆ GTEST_ASSERT_GE

#define GTEST_ASSERT_GE (   val1,
  val2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

Definition at line 1884 of file gtest.h.

◆ GTEST_ASSERT_GT

#define GTEST_ASSERT_GT (   val1,
  val2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

Definition at line 1886 of file gtest.h.

◆ GTEST_ASSERT_LE

#define GTEST_ASSERT_LE (   val1,
  val2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

Definition at line 1880 of file gtest.h.

◆ GTEST_ASSERT_LT

#define GTEST_ASSERT_LT (   val1,
  val2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

Definition at line 1882 of file gtest.h.

◆ GTEST_ASSERT_NE

#define GTEST_ASSERT_NE (   val1,
  val2 
)    ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

Definition at line 1878 of file gtest.h.

◆ GTEST_ASSERT_TRUE

#define GTEST_ASSERT_TRUE (   condition)    GTEST_TEST_BOOLEAN_(condition, #condition, false, true, GTEST_FATAL_FAILURE_)

Definition at line 1792 of file gtest.h.

◆ GTEST_EXPECT_FALSE

#define GTEST_EXPECT_FALSE (   condition)
Value:
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
#define GTEST_NONFATAL_FAILURE_(message)
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail)

Definition at line 1789 of file gtest.h.

◆ GTEST_EXPECT_TRUE

#define GTEST_EXPECT_TRUE (   condition)
Value:
GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
#define GTEST_NONFATAL_FAILURE_(message)
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail)

Definition at line 1786 of file gtest.h.

◆ GTEST_FAIL

#define GTEST_FAIL ( )    GTEST_FATAL_FAILURE_("Failed")

Definition at line 1739 of file gtest.h.

◆ GTEST_FAIL_AT

#define GTEST_FAIL_AT (   file,
  line 
)
Value:
return GTEST_MESSAGE_AT_(file, line, "Failed", \
::testing::TestPartResult::kFatalFailure)
#define GTEST_MESSAGE_AT_(file, line, message, result_type)

Definition at line 1742 of file gtest.h.

◆ GTEST_IMPL_CMP_HELPER_

#define GTEST_IMPL_CMP_HELPER_ (   op_name,
  op 
)
Value:
template <typename T1, typename T2> \
AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
const T1& val1, const T2& val2) { \
if (val1 op val2) { \
return AssertionSuccess(); \
} else { \
return CmpHelperOpFailure(expr1, expr2, val1, val2, #op); \
} \
}
AssertionResult CmpHelperOpFailure(const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
Definition: gtest.h:1423

Definition at line 1438 of file gtest.h.

◆ GTEST_SKIP

#define GTEST_SKIP ( )    GTEST_SKIP_("")

Definition at line 1710 of file gtest.h.

◆ GTEST_SUCCEED

#define GTEST_SUCCEED ( )    GTEST_SUCCESS_("Succeeded")

Definition at line 1753 of file gtest.h.

◆ GTEST_TEST

#define GTEST_TEST (   test_suite_name,
  test_name 
)
Value:
GTEST_TEST_(test_suite_name, test_name, ::testing::Test, \
#define GTEST_TEST_(test_suite_name, test_name, parent_class, parent_id)
GTEST_API_ TypeId GetTestTypeId()

Definition at line 2164 of file gtest.h.

◆ GTEST_TEST_F

#define GTEST_TEST_F (   test_fixture,
  test_name 
)
Value:
GTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>())
#define GTEST_TEST_(test_suite_name, test_name, parent_class, parent_id)

Definition at line 2199 of file gtest.h.

◆ SCOPED_TRACE

#define SCOPED_TRACE (   message)
Value:
::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)( \
__FILE__, __LINE__, (message))
#define GTEST_CONCAT_TOKEN_(foo, bar)

Definition at line 2099 of file gtest.h.

◆ SUCCEED

#define SUCCEED ( )    GTEST_SUCCEED()

Definition at line 1758 of file gtest.h.

◆ TEST

#define TEST (   test_suite_name,
  test_name 
)    GTEST_TEST(test_suite_name, test_name)

Definition at line 2171 of file gtest.h.

◆ TEST_F

#define TEST_F (   test_fixture,
  test_name 
)    GTEST_TEST_F(test_fixture, test_name)

Definition at line 2203 of file gtest.h.

Function Documentation

◆ GTEST_DECLARE_bool_() [1/12]

GTEST_DECLARE_bool_ ( break_on_failure  )

◆ GTEST_DECLARE_bool_() [2/12]

GTEST_DECLARE_bool_ ( catch_exceptions  )

◆ GTEST_DECLARE_bool_() [3/12]

GTEST_DECLARE_bool_ ( fail_fast  )

◆ GTEST_DECLARE_bool_() [4/12]

GTEST_DECLARE_bool_ ( install_failure_signal_handler  )

◆ GTEST_DECLARE_bool_() [5/12]

GTEST_DECLARE_bool_ ( list_tests  )

◆ GTEST_DECLARE_bool_() [6/12]

GTEST_DECLARE_bool_ ( brief  )

◆ GTEST_DECLARE_bool_() [7/12]

GTEST_DECLARE_bool_ ( print_time  )

◆ GTEST_DECLARE_bool_() [8/12]

GTEST_DECLARE_bool_ ( print_utf8  )

◆ GTEST_DECLARE_bool_() [9/12]

GTEST_DECLARE_bool_ ( recreate_environments_when_repeating  )

◆ GTEST_DECLARE_bool_() [10/12]

GTEST_DECLARE_bool_ ( show_internal_stack_frames  )

◆ GTEST_DECLARE_bool_() [11/12]

GTEST_DECLARE_bool_ ( shuffle  )

◆ GTEST_DECLARE_bool_() [12/12]

GTEST_DECLARE_bool_ ( throw_on_failure  )

◆ GTEST_DECLARE_int32_() [1/3]

GTEST_DECLARE_int32_ ( random_seed  )

◆ GTEST_DECLARE_int32_() [2/3]

GTEST_DECLARE_int32_ ( repeat  )

◆ GTEST_DECLARE_int32_() [3/3]

GTEST_DECLARE_int32_ ( stack_trace_depth  )

◆ GTEST_DECLARE_string_() [1/4]

GTEST_DECLARE_string_ ( color  )

◆ GTEST_DECLARE_string_() [2/4]

GTEST_DECLARE_string_ ( filter  )

◆ GTEST_DECLARE_string_() [3/4]

GTEST_DECLARE_string_ ( output  )

◆ GTEST_DECLARE_string_() [4/4]

GTEST_DECLARE_string_ ( stream_result_to  )

◆ GTEST_DISABLE_MSC_WARNINGS_PUSH_()

GTEST_DISABLE_MSC_WARNINGS_PUSH_ ( 4251  )

Definition at line 50 of file gmock-cardinalities.h.

53  {
54 
55 // To implement a cardinality Foo, define:
56 // 1. a class FooCardinality that implements the
57 // CardinalityInterface interface, and
58 // 2. a factory function that creates a Cardinality object from a
59 // const FooCardinality*.
60 //
61 // The two-level delegation design follows that of Matcher, providing
62 // consistency for extension developers. It also eases ownership
63 // management as Cardinality objects can now be copied like plain values.
64 
65 // The implementation of a cardinality.
66 class CardinalityInterface {
67  public:
68  virtual ~CardinalityInterface() {}
69 
70  // Conservative estimate on the lower/upper bound of the number of
71  // calls allowed.
72  virtual int ConservativeLowerBound() const { return 0; }
73  virtual int ConservativeUpperBound() const { return INT_MAX; }
74 
75  // Returns true if and only if call_count calls will satisfy this
76  // cardinality.
77  virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
78 
79  // Returns true if and only if call_count calls will saturate this
80  // cardinality.
81  virtual bool IsSaturatedByCallCount(int call_count) const = 0;
82 
83  // Describes self to an ostream.
84  virtual void DescribeTo(::std::ostream* os) const = 0;
85 };
86 
87 // A Cardinality is a copyable and IMMUTABLE (except by assignment)
88 // object that specifies how many times a mock function is expected to
89 // be called. The implementation of Cardinality is just a std::shared_ptr
90 // to const CardinalityInterface. Don't inherit from Cardinality!
91 class GTEST_API_ Cardinality {
92  public:
93  // Constructs a null cardinality. Needed for storing Cardinality
94  // objects in STL containers.
95  Cardinality() {}
96 
97  // Constructs a Cardinality from its implementation.
98  explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
99 
100  // Conservative estimate on the lower/upper bound of the number of
101  // calls allowed.
102  int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
103  int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
104 
105  // Returns true if and only if call_count calls will satisfy this
106  // cardinality.
107  bool IsSatisfiedByCallCount(int call_count) const {
108  return impl_->IsSatisfiedByCallCount(call_count);
109  }
110 
111  // Returns true if and only if call_count calls will saturate this
112  // cardinality.
113  bool IsSaturatedByCallCount(int call_count) const {
114  return impl_->IsSaturatedByCallCount(call_count);
115  }
116 
117  // Returns true if and only if call_count calls will over-saturate this
118  // cardinality, i.e. exceed the maximum number of allowed calls.
119  bool IsOverSaturatedByCallCount(int call_count) const {
120  return impl_->IsSaturatedByCallCount(call_count) &&
121  !impl_->IsSatisfiedByCallCount(call_count);
122  }
123 
124  // Describes self to an ostream
125  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
126 
127  // Describes the given actual call count to an ostream.
128  static void DescribeActualCallCountTo(int actual_call_count,
129  ::std::ostream* os);
130 
131  private:
132  std::shared_ptr<const CardinalityInterface> impl_;
133 };
134 
135 // Creates a cardinality that allows at least n calls.
136 GTEST_API_ Cardinality AtLeast(int n);
137 
138 // Creates a cardinality that allows at most n calls.
139 GTEST_API_ Cardinality AtMost(int n);
140 
141 // Creates a cardinality that allows any number of calls.
142 GTEST_API_ Cardinality AnyNumber();
143 
144 // Creates a cardinality that allows between min and max calls.
145 GTEST_API_ Cardinality Between(int min, int max);
146 
147 // Creates a cardinality that allows exactly n calls.
148 GTEST_API_ Cardinality Exactly(int n);
149 
150 // Creates a cardinality from its implementation.
151 inline Cardinality MakeCardinality(const CardinalityInterface* c) {
152  return Cardinality(c);
153 }
154 
155 } // namespace testing
void min(Image< double > &op1, const Image< double > &op2)
doublereal * c
#define GTEST_API_
Definition: gtest-port.h:793
void max(Image< double > &op1, const Image< double > &op2)
int * n

◆ RUN_ALL_TESTS()

int RUN_ALL_TESTS ( )
inline

Definition at line 2314 of file gtest.h.

2314 { return ::testing::UnitTest::GetInstance()->Run(); }