proxygen
testing::TestPartResult Class Reference

#include <gtest-test-part.h>

Public Types

enum  Type {
  kSuccess, kNonFatalFailure, kFatalFailure, kSuccess,
  kNonFatalFailure, kFatalFailure, kSuccess, kNonFatalFailure,
  kFatalFailure
}
 
enum  Type {
  kSuccess, kNonFatalFailure, kFatalFailure, kSuccess,
  kNonFatalFailure, kFatalFailure, kSuccess, kNonFatalFailure,
  kFatalFailure
}
 
enum  Type {
  kSuccess, kNonFatalFailure, kFatalFailure, kSuccess,
  kNonFatalFailure, kFatalFailure, kSuccess, kNonFatalFailure,
  kFatalFailure
}
 

Public Member Functions

 TestPartResult (Type a_type, const char *a_file_name, int a_line_number, const char *a_message)
 
Type type () const
 
const char * file_name () const
 
int line_number () const
 
const char * summary () const
 
const char * message () const
 
bool passed () const
 
bool failed () const
 
bool nonfatally_failed () const
 
bool fatally_failed () const
 
 TestPartResult (Type a_type, const char *a_file_name, int a_line_number, const char *a_message)
 
Type type () const
 
const char * file_name () const
 
int line_number () const
 
const char * summary () const
 
const char * message () const
 
bool passed () const
 
bool failed () const
 
bool nonfatally_failed () const
 
bool fatally_failed () const
 
 TestPartResult (Type a_type, const char *a_file_name, int a_line_number, const char *a_message)
 
Type type () const
 
const char * file_name () const
 
int line_number () const
 
const char * summary () const
 
const char * message () const
 
bool passed () const
 
bool failed () const
 
bool nonfatally_failed () const
 
bool fatally_failed () const
 

Static Private Member Functions

static std::string ExtractSummary (const char *message)
 
static std::string ExtractSummary (const char *message)
 
static std::string ExtractSummary (const char *message)
 

Private Attributes

Type type_
 
std::string file_name_
 
int line_number_
 
std::string summary_
 
std::string message_
 

Detailed Description

Definition at line 47 of file gtest-test-part.h.

Member Enumeration Documentation

Enumerator
kSuccess 
kNonFatalFailure 
kFatalFailure 
kSuccess 
kNonFatalFailure 
kFatalFailure 
kSuccess 
kNonFatalFailure 
kFatalFailure 

Definition at line 51 of file gtest-test-part.h.

51  {
52  kSuccess, // Succeeded.
53  kNonFatalFailure, // Failed but the test can continue.
54  kFatalFailure // Failed and the test should be terminated.
55  };
Enumerator
kSuccess 
kNonFatalFailure 
kFatalFailure 
kSuccess 
kNonFatalFailure 
kFatalFailure 
kSuccess 
kNonFatalFailure 
kFatalFailure 

Definition at line 51 of file gtest-test-part.h.

51  {
52  kSuccess, // Succeeded.
53  kNonFatalFailure, // Failed but the test can continue.
54  kFatalFailure // Failed and the test should be terminated.
55  };
Enumerator
kSuccess 
kNonFatalFailure 
kFatalFailure 
kSuccess 
kNonFatalFailure 
kFatalFailure 
kSuccess 
kNonFatalFailure 
kFatalFailure 

Definition at line 51 of file gtest-test-part.h.

51  {
52  kSuccess, // Succeeded.
53  kNonFatalFailure, // Failed but the test can continue.
54  kFatalFailure // Failed and the test should be terminated.
55  };

Constructor & Destructor Documentation

testing::TestPartResult::TestPartResult ( Type  a_type,
const char *  a_file_name,
int  a_line_number,
const char *  a_message 
)
inline

Definition at line 60 of file gtest-test-part.h.

64  : type_(a_type),
65  file_name_(a_file_name == NULL ? "" : a_file_name),
66  line_number_(a_line_number),
67  summary_(ExtractSummary(a_message)),
68  message_(a_message) {
69  }
static std::string ExtractSummary(const char *message)
testing::TestPartResult::TestPartResult ( Type  a_type,
const char *  a_file_name,
int  a_line_number,
const char *  a_message 
)
inline

Definition at line 60 of file gtest-test-part.h.

64  : type_(a_type),
65  file_name_(a_file_name == NULL ? "" : a_file_name),
66  line_number_(a_line_number),
67  summary_(ExtractSummary(a_message)),
68  message_(a_message) {
69  }
static std::string ExtractSummary(const char *message)
testing::TestPartResult::TestPartResult ( Type  a_type,
const char *  a_file_name,
int  a_line_number,
const char *  a_message 
)
inline

Definition at line 60 of file gtest-test-part.h.

64  : type_(a_type),
65  file_name_(a_file_name == NULL ? "" : a_file_name),
66  line_number_(a_line_number),
67  summary_(ExtractSummary(a_message)),
68  message_(a_message) {
69  }
static std::string ExtractSummary(const char *message)

Member Function Documentation

std::string testing::TestPartResult::ExtractSummary ( const char *  message)
staticprivate

Definition at line 51 of file gtest-test-part.cc.

References testing::internal::kStackTraceMarker, and string.

51  {
52  const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
53  return stack_trace == NULL ? message :
54  std::string(message, stack_trace);
55 }
Definition: test.c:42
GTEST_API_ const char kStackTraceMarker[]
Definition: gtest.cc:184
const char * string
Definition: Conv.cpp:212
static std::string testing::TestPartResult::ExtractSummary ( const char *  message)
staticprivate
static std::string testing::TestPartResult::ExtractSummary ( const char *  message)
staticprivate
bool testing::TestPartResult::failed ( ) const
inline

Definition at line 94 of file gtest-test-part.h.

References type_.

bool testing::TestPartResult::failed ( ) const
inline

Definition at line 94 of file gtest-test-part.h.

References type_.

bool testing::TestPartResult::fatally_failed ( ) const
inline
bool testing::TestPartResult::fatally_failed ( ) const
inline
bool testing::TestPartResult::fatally_failed ( ) const
inline
const char* testing::TestPartResult::file_name ( ) const
inline

Definition at line 76 of file gtest-test-part.h.

76  {
77  return file_name_.empty() ? NULL : file_name_.c_str();
78  }
const char* testing::TestPartResult::file_name ( ) const
inline

Definition at line 76 of file gtest-test-part.h.

76  {
77  return file_name_.empty() ? NULL : file_name_.c_str();
78  }
int testing::TestPartResult::line_number ( ) const
inline

Definition at line 82 of file gtest-test-part.h.

int testing::TestPartResult::line_number ( ) const
inline

Definition at line 82 of file gtest-test-part.h.

const char* testing::TestPartResult::message ( ) const
inline

Definition at line 88 of file gtest-test-part.h.

88 { return message_.c_str(); }
const char* testing::TestPartResult::message ( ) const
inline

Definition at line 88 of file gtest-test-part.h.

88 { return message_.c_str(); }
bool testing::TestPartResult::nonfatally_failed ( ) const
inline
bool testing::TestPartResult::nonfatally_failed ( ) const
inline
bool testing::TestPartResult::nonfatally_failed ( ) const
inline
bool testing::TestPartResult::passed ( ) const
inline

Definition at line 91 of file gtest-test-part.h.

References type_.

bool testing::TestPartResult::passed ( ) const
inline

Definition at line 91 of file gtest-test-part.h.

References type_.

bool testing::TestPartResult::passed ( ) const
inline

Definition at line 91 of file gtest-test-part.h.

References type_.

const char* testing::TestPartResult::summary ( ) const
inline
const char* testing::TestPartResult::summary ( ) const
inline

Definition at line 85 of file gtest-test-part.h.

85 { return summary_.c_str(); }
const char* testing::TestPartResult::summary ( ) const
inline

Definition at line 85 of file gtest-test-part.h.

85 { return summary_.c_str(); }
Type testing::TestPartResult::type ( ) const
inline

Definition at line 72 of file gtest-test-part.h.

References type_.

72 { return type_; }
Type testing::TestPartResult::type ( ) const
inline

Definition at line 72 of file gtest-test-part.h.

References type_.

72 { return type_; }

Member Data Documentation

std::string testing::TestPartResult::file_name_
private

Definition at line 111 of file gtest-test-part.h.

int testing::TestPartResult::line_number_
private

Definition at line 114 of file gtest-test-part.h.

std::string testing::TestPartResult::message_
private

Definition at line 116 of file gtest-test-part.h.

std::string testing::TestPartResult::summary_
private

Definition at line 115 of file gtest-test-part.h.

Type testing::TestPartResult::type_
private

Definition at line 103 of file gtest-test-part.h.


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