proxygen
testing::AssertionResult Class Reference

#include <gtest.h>

Public Member Functions

 AssertionResult (const AssertionResult &other)
 
template<typename T >
 AssertionResult (const T &success, typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type *=NULL)
 
AssertionResultoperator= (AssertionResult other)
 
 operator bool () const
 
AssertionResult operator! () const
 
const char * message () const
 
const char * failure_message () const
 
template<typename T >
AssertionResultoperator<< (const T &value)
 
AssertionResultoperator<< (::std::ostream &(*basic_manipulator)(::std::ostream &stream))
 
 AssertionResult (const AssertionResult &other)
 
template<typename T >
 AssertionResult (const T &success, typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type *=NULL)
 
AssertionResultoperator= (AssertionResult other)
 
 operator bool () const
 
AssertionResult operator! () const
 
const char * message () const
 
const char * failure_message () const
 
template<typename T >
AssertionResultoperator<< (const T &value)
 
AssertionResultoperator<< (::std::ostream &(*basic_manipulator)(::std::ostream &stream))
 
 AssertionResult (const AssertionResult &other)
 
template<typename T >
 AssertionResult (const T &success, typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type *=NULL)
 
AssertionResultoperator= (AssertionResult other)
 
 operator bool () const
 
AssertionResult operator! () const
 
const char * message () const
 
const char * failure_message () const
 
template<typename T >
AssertionResultoperator<< (const T &value)
 
AssertionResultoperator<< (::std::ostream &(*basic_manipulator)(::std::ostream &stream))
 

Private Member Functions

void AppendMessage (const Message &a_message)
 
void swap (AssertionResult &other)
 
void AppendMessage (const Message &a_message)
 
void swap (AssertionResult &other)
 
void AppendMessage (const Message &a_message)
 
void swap (AssertionResult &other)
 

Private Attributes

bool success_
 
internal::scoped_ptr< ::std::stringmessage_
 

Detailed Description

Definition at line 256 of file gtest.h.

Constructor & Destructor Documentation

testing::AssertionResult::AssertionResult ( const AssertionResult other)

Definition at line 987 of file gtest.cc.

Referenced by testing::AssertionFailure(), testing::AssertionSuccess(), and testing::internal::ShouldRunTestCase().

988  : success_(other.success_),
989  message_(other.message_.get() != NULL ?
990  new ::std::string(*other.message_) :
991  static_cast< ::std::string*>(NULL)) {
992 }
STL namespace.
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
const char * string
Definition: Conv.cpp:212
template<typename T >
testing::AssertionResult::AssertionResult ( const T success,
typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type = NULL 
)
inlineexplicit

Definition at line 272 of file gtest.h.

References GTEST_DISABLE_MSC_WARNINGS_POP_.

277  : success_(success) {}
testing::AssertionResult::AssertionResult ( const AssertionResult other)
template<typename T >
testing::AssertionResult::AssertionResult ( const T success,
typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type = NULL 
)
inlineexplicit

Definition at line 272 of file gtest.h.

References GTEST_DISABLE_MSC_WARNINGS_POP_.

277  : success_(success) {}
testing::AssertionResult::AssertionResult ( const AssertionResult other)
template<typename T >
testing::AssertionResult::AssertionResult ( const T success,
typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type = NULL 
)
inlineexplicit

Definition at line 272 of file gtest.h.

References GTEST_DISABLE_MSC_WARNINGS_POP_.

277  : success_(success) {}

Member Function Documentation

void testing::AssertionResult::AppendMessage ( const Message a_message)
inlineprivate

Definition at line 320 of file gtest.h.

References testing::Message::GetString(), string, and folly::f14::swap().

320  {
321  if (message_.get() == NULL)
323  message_->append(a_message.GetString().c_str());
324  }
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
const char * string
Definition: Conv.cpp:212
void testing::AssertionResult::AppendMessage ( const Message a_message)
inlineprivate

Definition at line 320 of file gtest.h.

References testing::AssertionFailure(), testing::AssertionSuccess(), testing::Message::GetString(), GTEST_API_, string, and folly::f14::swap().

320  {
321  if (message_.get() == NULL)
323  message_->append(a_message.GetString().c_str());
324  }
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
const char * string
Definition: Conv.cpp:212
void testing::AssertionResult::AppendMessage ( const Message a_message)
inlineprivate

Definition at line 320 of file gtest.h.

References testing::AssertionFailure(), testing::AssertionSuccess(), testing::Message::GetString(), GTEST_API_, string, and folly::f14::swap().

320  {
321  if (message_.get() == NULL)
323  message_->append(a_message.GetString().c_str());
324  }
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
const char * string
Definition: Conv.cpp:212
const char* testing::AssertionResult::failure_message ( ) const
inline

Definition at line 302 of file gtest.h.

References message.

302 { return message(); }
const char * message() const
Definition: gtest.h:297
const char* testing::AssertionResult::failure_message ( ) const
inline

Definition at line 302 of file gtest.h.

References message.

302 { return message(); }
const char * message() const
Definition: gtest.h:297
const char* testing::AssertionResult::failure_message ( ) const
inline

Definition at line 302 of file gtest.h.

References message.

302 { return message(); }
const char * message() const
Definition: gtest.h:297
const char* testing::AssertionResult::message ( ) const
inline

Definition at line 297 of file gtest.h.

Referenced by testing::AssertionFailure(), testing::internal::GetBoolAssertionFailureMessage(), and TEST().

297  {
298  return message_.get() != NULL ? message_->c_str() : "";
299  }
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
const char* testing::AssertionResult::message ( ) const
inline

Definition at line 297 of file gtest.h.

297  {
298  return message_.get() != NULL ? message_->c_str() : "";
299  }
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
const char* testing::AssertionResult::message ( ) const
inline

Definition at line 297 of file gtest.h.

297  {
298  return message_.get() != NULL ? message_->c_str() : "";
299  }
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
testing::AssertionResult::operator bool ( ) const
inline

Definition at line 288 of file gtest.h.

References proxygen::operator!().

288 { return success_; } // NOLINT
testing::AssertionResult::operator bool ( ) const
inline

Definition at line 288 of file gtest.h.

References proxygen::operator!().

288 { return success_; } // NOLINT
testing::AssertionResult::operator bool ( ) const
inline

Definition at line 288 of file gtest.h.

References proxygen::operator!().

288 { return success_; } // NOLINT
AssertionResult testing::AssertionResult::operator! ( ) const
AssertionResult testing::AssertionResult::operator! ( ) const
AssertionResult testing::AssertionResult::operator! ( ) const

Definition at line 1002 of file gtest.cc.

References testing::internal::scoped_ptr< T >::get(), message_, and success_.

Referenced by testing::internal::ShouldRunTestCase().

1002  {
1003  AssertionResult negation(!success_);
1004  if (message_.get() != NULL)
1005  negation << *message_;
1006  return negation;
1007 }
AssertionResult(const AssertionResult &other)
Definition: gtest.cc:987
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
template<typename T >
AssertionResult& testing::AssertionResult::operator<< ( const T value)
inline

Definition at line 305 of file gtest.h.

305  {
306  AppendMessage(Message() << value);
307  return *this;
308  }
void AppendMessage(const Message &a_message)
Definition: gtest.h:320
static const char *const value
Definition: Conv.cpp:50
template<typename T >
AssertionResult& testing::AssertionResult::operator<< ( const T value)
inline

Definition at line 305 of file gtest.h.

305  {
306  AppendMessage(Message() << value);
307  return *this;
308  }
void AppendMessage(const Message &a_message)
Definition: gtest.h:320
static const char *const value
Definition: Conv.cpp:50
template<typename T >
AssertionResult& testing::AssertionResult::operator<< ( const T value)
inline

Definition at line 305 of file gtest.h.

305  {
306  AppendMessage(Message() << value);
307  return *this;
308  }
void AppendMessage(const Message &a_message)
Definition: gtest.h:320
static const char *const value
Definition: Conv.cpp:50
AssertionResult& testing::AssertionResult::operator<< ( ::std::ostream &(*)(::std::ostream &stream basic_manipulator)
inline

Definition at line 312 of file gtest.h.

313  {
314  AppendMessage(Message() << basic_manipulator);
315  return *this;
316  }
void AppendMessage(const Message &a_message)
Definition: gtest.h:320
AssertionResult& testing::AssertionResult::operator<< ( ::std::ostream &(*)(::std::ostream &stream basic_manipulator)
inline

Definition at line 312 of file gtest.h.

313  {
314  AppendMessage(Message() << basic_manipulator);
315  return *this;
316  }
void AppendMessage(const Message &a_message)
Definition: gtest.h:320
AssertionResult& testing::AssertionResult::operator<< ( ::std::ostream &(*)(::std::ostream &stream basic_manipulator)
inline

Definition at line 312 of file gtest.h.

313  {
314  AppendMessage(Message() << basic_manipulator);
315  return *this;
316  }
void AppendMessage(const Message &a_message)
Definition: gtest.h:320
AssertionResult& testing::AssertionResult::operator= ( AssertionResult  other)
inline

Definition at line 282 of file gtest.h.

References folly::f14::swap().

282  {
283  swap(other);
284  return *this;
285  }
void swap(AssertionResult &other)
Definition: gtest.cc:995
AssertionResult& testing::AssertionResult::operator= ( AssertionResult  other)
inline

Definition at line 282 of file gtest.h.

References folly::f14::swap().

282  {
283  swap(other);
284  return *this;
285  }
void swap(AssertionResult &other)
Definition: gtest.cc:995
AssertionResult& testing::AssertionResult::operator= ( AssertionResult  other)
inline

Definition at line 282 of file gtest.h.

References folly::f14::swap().

282  {
283  swap(other);
284  return *this;
285  }
void swap(AssertionResult &other)
Definition: gtest.cc:995
void testing::AssertionResult::swap ( AssertionResult other)
private
void testing::AssertionResult::swap ( AssertionResult other)
private

Definition at line 995 of file gtest.cc.

References message_, success_, and folly::f14::swap().

Referenced by testing::internal::ShouldRunTestCase().

995  {
996  using std::swap;
997  swap(success_, other.success_);
998  swap(message_, other.message_);
999 }
void swap(AssertionResult &other)
Definition: gtest.cc:995
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:335
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
void testing::AssertionResult::swap ( AssertionResult other)
private

Member Data Documentation

internal::scoped_ptr<::std::string > testing::AssertionResult::message_
private

Definition at line 335 of file gtest.h.

Referenced by operator!(), testing::internal::ShouldRunTestCase(), and swap().

bool testing::AssertionResult::success_
private

Definition at line 330 of file gtest.h.

Referenced by operator!(), testing::internal::ShouldRunTestCase(), and swap().


The documentation for this class was generated from the following files: