proxygen
testing::internal Namespace Reference

Namespaces

 edit_distance
 
 invoke_argument
 
 posix
 

Classes

class  ActionAdaptor
 
class  ActionHelper
 
class  ActionResultHolder
 
class  ActionResultHolder< void >
 
struct  AddReference
 
struct  AddReference< T & >
 
struct  AllOfResult1
 
struct  AllOfResult10
 
struct  AllOfResult2
 
struct  AllOfResult3
 
struct  AllOfResult4
 
struct  AllOfResult5
 
struct  AllOfResult6
 
struct  AllOfResult7
 
struct  AllOfResult8
 
struct  AllOfResult9
 
struct  AnyEq
 
struct  AnyGe
 
struct  AnyGt
 
struct  AnyLe
 
struct  AnyLt
 
class  AnyMatcherImpl
 
struct  AnyNe
 
struct  AnyOfResult1
 
struct  AnyOfResult10
 
struct  AnyOfResult2
 
struct  AnyOfResult3
 
struct  AnyOfResult4
 
struct  AnyOfResult5
 
struct  AnyOfResult6
 
struct  AnyOfResult7
 
struct  AnyOfResult8
 
struct  AnyOfResult9
 
class  AnythingMatcher
 
class  ArgsMatcher
 
class  ArgsMatcherImpl
 
class  AssertHelper
 
class  AssignAction
 
class  Base
 
class  BeginEndDistanceIsMatcher
 
struct  bool_constant
 
struct  BooleanConstant
 
class  BothOfMatcher
 
class  BothOfMatcherImpl
 
class  BoundSecondMatcher
 
class  BuiltInDefaultValue
 
class  BuiltInDefaultValue< ::std::string >
 
class  BuiltInDefaultValue< bool >
 
class  BuiltInDefaultValue< char >
 
class  BuiltInDefaultValue< const T >
 
class  BuiltInDefaultValue< double >
 
class  BuiltInDefaultValue< float >
 
class  BuiltInDefaultValue< Int64 >
 
class  BuiltInDefaultValue< signed char >
 
class  BuiltInDefaultValue< signed int >
 
class  BuiltInDefaultValue< signed long >
 
class  BuiltInDefaultValue< signed short >
 
class  BuiltInDefaultValue< T * >
 
class  BuiltInDefaultValue< UInt64 >
 
class  BuiltInDefaultValue< unsigned char >
 
class  BuiltInDefaultValue< unsigned int >
 
class  BuiltInDefaultValue< unsigned long >
 
class  BuiltInDefaultValue< unsigned short >
 
class  BuiltInDefaultValue< void >
 
struct  BuiltInDefaultValueGetter
 
struct  BuiltInDefaultValueGetter< T, false >
 
struct  ByMoveWrapper
 
struct  CallableTraits
 
struct  CallableTraits< ResType(*)(ArgType)>
 
class  Castable
 
struct  CastAndAppendTransform
 
struct  CodeLocation
 
class  ComparisonBase
 
struct  CompileAssert
 
struct  CompileAssertTypesEqual
 
struct  CompileAssertTypesEqual< T, T >
 
class  ConstAndNonConstCastable
 
class  ConstCastable
 
struct  ConstCharPtr
 
class  ContainerEqMatcher
 
class  ContainsMatcher
 
class  ContainsMatcherImpl
 
struct  DecayArray
 
struct  DecayArray< T[]>
 
struct  DecayArray< T[N]>
 
class  DefaultGlobalTestPartResultReporter
 
class  DefaultPerThreadTestPartResultReporter
 
class  Derived
 
class  DoBothAction
 
class  DoDefaultAction
 
class  DummyMatchResultListener
 
class  EachMatcher
 
class  EachMatcherImpl
 
class  EitherOfMatcher
 
class  EitherOfMatcherImpl
 
class  ElementsAreArrayMatcher
 
class  ElementsAreMatcher
 
class  ElementsAreMatcherImpl
 
struct  EnableIf
 
struct  EnableIf< true >
 
class  EndsWithMatcher
 
class  EnvironmentInvocationCatcher
 
class  Eq2Matcher
 
class  EqHelper
 
class  EqHelper< true >
 
class  EqMatcher
 
class  EventRecordingListener
 
struct  ExcessiveArg
 
class  ExpectationBase
 
class  ExpectationTester
 
class  FieldMatcher
 
class  FilePath
 
class  FinalSuccessChecker
 
class  FloatingEqMatcher
 
class  FloatingPoint
 
class  FormatForComparison
 
class  FormatForComparison< char *, OtherOperand >
 
class  FormatForComparison< char *,::std::string >
 
class  FormatForComparison< const char *, OtherOperand >
 
class  FormatForComparison< const char *,::std::string >
 
class  FormatForComparison< const wchar_t *, OtherOperand >
 
class  FormatForComparison< ToPrint[N], OtherOperand >
 
class  FormatForComparison< wchar_t *, OtherOperand >
 
struct  Function
 
struct  Function< R(A1)>
 
struct  Function< R(A1, A2)>
 
struct  Function< R(A1, A2, A3)>
 
struct  Function< R(A1, A2, A3, A4)>
 
struct  Function< R(A1, A2, A3, A4, A5)>
 
struct  Function< R(A1, A2, A3, A4, A5, A6)>
 
struct  Function< R(A1, A2, A3, A4, A5, A6, A7)>
 
struct  Function< R(A1, A2, A3, A4, A5, A6, A7, A8)>
 
struct  Function< R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
 
struct  Function< R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
 
class  FunctionMocker
 
class  FunctionMocker< R(A1)>
 
class  FunctionMocker< R(A1, A2)>
 
class  FunctionMocker< R(A1, A2, A3)>
 
class  FunctionMocker< R(A1, A2, A3, A4)>
 
class  FunctionMocker< R(A1, A2, A3, A4, A5)>
 
class  FunctionMocker< R(A1, A2, A3, A4, A5, A6)>
 
class  FunctionMocker< R(A1, A2, A3, A4, A5, A6, A7)>
 
class  FunctionMocker< R(A1, A2, A3, A4, A5, A6, A7, A8)>
 
class  FunctionMocker< R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
 
class  FunctionMocker< R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
 
class  FunctionMockerBase
 
class  Ge2Matcher
 
class  GeMatcher
 
class  GoogleTestFailureReporter
 
class  Gt2Matcher
 
class  GTestFlagSaver
 
class  GTestLog
 
class  GTestMutexLock
 
class  GtMatcher
 
class  HasNewFatalFailureHelper
 
class  HasSubstrMatcher
 
class  IgnoredValue
 
class  IgnoreResultAction
 
class  ImplicitlyConvertible
 
class  InvokeAction
 
class  InvokeHelper
 
class  InvokeHelper< R,::testing::tuple< A1 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4, A5 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4, A5, A6 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4, A5, A6, A7 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8, A9 > >
 
class  InvokeHelper< R,::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 > >
 
class  InvokeHelper< R,::testing::tuple<> >
 
class  InvokeMethodAction
 
class  InvokeMethodWithoutArgsAction
 
class  InvokeWithoutArgsAction
 
struct  is_pointer
 
struct  is_pointer< T * >
 
struct  is_reference
 
struct  is_reference< T & >
 
struct  IsAProtocolMessage
 
class  IsNullMatcher
 
struct  IteratorTraits
 
struct  IteratorTraits< const T * >
 
struct  IteratorTraits< T * >
 
class  KeyMatcher
 
class  KeyMatcherImpl
 
struct  KindOf
 
struct  KindOf< bool >
 
struct  KindOf< char >
 
struct  KindOf< double >
 
struct  KindOf< float >
 
struct  KindOf< int >
 
struct  KindOf< Int64 >
 
struct  KindOf< long >
 
struct  KindOf< long double >
 
struct  KindOf< short >
 
struct  KindOf< signed char >
 
struct  KindOf< UInt64 >
 
struct  KindOf< unsigned char >
 
struct  KindOf< unsigned int >
 
struct  KindOf< unsigned long >
 
struct  KindOf< unsigned short >
 
struct  KindOf< wchar_t >
 
class  Le2Matcher
 
class  LeMatcher
 
struct  LessByName
 
struct  LessComparator
 
class  linked_ptr
 
class  linked_ptr_internal
 
struct  LinkedPtrLessThan
 
class  ListenerTest
 
struct  LosslessArithmeticConvertibleImpl
 
struct  LosslessArithmeticConvertibleImpl< kBool, bool, kBool, bool >
 
struct  LosslessArithmeticConvertibleImpl< kBool, bool, kFloatingPoint, To >
 
struct  LosslessArithmeticConvertibleImpl< kBool, bool, kInteger, To >
 
struct  LosslessArithmeticConvertibleImpl< kFloatingPoint, From, kBool, bool >
 
struct  LosslessArithmeticConvertibleImpl< kFloatingPoint, From, kInteger, To >
 
struct  LosslessArithmeticConvertibleImpl< kInteger, From, kBool, bool >
 
struct  LosslessArithmeticConvertibleImpl< kInteger, From, kFloatingPoint, To >
 
struct  LosslessArithmeticConvertibleImpl< kInteger, From, kInteger, To >
 
class  Lt2Matcher
 
class  LtMatcher
 
class  MatcherAsPredicate
 
class  MatcherBase
 
class  MatcherCastImpl
 
class  MatcherCastImpl< T, Matcher< T > >
 
class  MatcherCastImpl< T, Matcher< U > >
 
struct  MatcherTuple
 
struct  MatcherTuple< ::testing::tuple< A1 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4, A5 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4, A5, A6 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4, A5, A6, A7 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8, A9 > >
 
struct  MatcherTuple< ::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 > >
 
struct  MatcherTuple< ::testing::tuple<> >
 
class  MatchesRegexMatcher
 
class  MatchMatrix
 
class  MaxBipartiteMatchState
 
class  MockSpec
 
class  Mutex
 
class  NativeArray
 
class  Ne2Matcher
 
class  NeMatcher
 
class  NoDefaultContructor
 
class  NotMatcher
 
class  NotMatcherImpl
 
class  NotNullMatcher
 
class  OnCallSpec
 
class  OsStackTraceGetter
 
class  OsStackTraceGetterInterface
 
class  PairMatchBase
 
class  PairMatcher
 
class  PairMatcherImpl
 
class  PointeeMatcher
 
struct  PointeeOf
 
struct  PointeeOf< T * >
 
class  PointwiseMatcher
 
class  PredicateFormatterFromMatcher
 
class  PrettyUnitTestResultPrinter
 
class  PropertyMatcher
 
class  QuantifierMatcherImpl
 
class  Random
 
class  RE
 
class  ReferenceOrValueWrapper
 
class  ReferenceOrValueWrapper< T & >
 
class  ReferenceWrapper
 
class  RefMatcher
 
class  RefMatcher< T & >
 
struct  RelationToSourceCopy
 
struct  RelationToSourceReference
 
struct  remove_reference
 
struct  remove_reference< T & >
 
struct  RemoveConst
 
struct  RemoveConst< const T >
 
struct  RemoveConst< const T[N]>
 
struct  RemoveConstFromKey
 
struct  RemoveConstFromKey< std::pair< const K, V > >
 
struct  RemoveReference
 
struct  RemoveReference< T & >
 
class  ResultOfMatcher
 
class  ReturnAction
 
class  ReturnNullAction
 
class  ReturnRefAction
 
class  ReturnRefOfCopyAction
 
class  ReturnVoidAction
 
class  scoped_ptr
 
class  ScopedPrematureExitFile
 
class  ScopedTrace
 
class  SelectArgs
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3, k4, k5, k6, k7, k8, k9,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3, k4, k5, k6, k7, k8,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3, k4, k5, k6, k7,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3, k4, k5, k6,-1,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3, k4, k5,-1,-1,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3, k4,-1,-1,-1,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2, k3,-1,-1,-1,-1,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1, k2,-1,-1,-1,-1,-1,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple, k1,-1,-1,-1,-1,-1,-1,-1,-1,-1 >
 
class  SelectArgs< Result, ArgumentTuple,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 >
 
class  SetArgumentPointeeAction
 
class  SetArgumentPointeeAction< N, Proto, true >
 
class  SetErrnoAndReturnAction
 
class  SingleFailureChecker
 
class  SizeIsMatcher
 
class  StartsWithMatcher
 
struct  StaticAssertTypeEqHelper
 
struct  StaticAssertTypeEqHelper< T, T >
 
class  StlContainerView
 
class  StlContainerView< ::testing::tuple< ElementPointer, Size > >
 
class  StlContainerView< Element[N]>
 
class  StreamMatchResultListener
 
class  StrEqualityMatcher
 
class  String
 
class  TestCaseNameIs
 
class  TestEventListenersAccessor
 
class  TestEventRepeater
 
class  TestFactoryBase
 
class  TestFactoryImpl
 
class  TestPropertyKeyIs
 
class  TestResultAccessor
 
class  ThreadLocal
 
class  To
 
struct  TraceInfo
 
class  TransformTupleValuesHelper
 
class  TrulyMatcher
 
class  TupleFields
 
class  TupleFields< Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,-1 >
 
class  TupleFields< Tuple, k0, k1, k2, k3, k4, k5, k6, k7,-1,-1 >
 
class  TupleFields< Tuple, k0, k1, k2, k3, k4, k5, k6,-1,-1,-1 >
 
class  TupleFields< Tuple, k0, k1, k2, k3, k4, k5,-1,-1,-1,-1 >
 
class  TupleFields< Tuple, k0, k1, k2, k3, k4,-1,-1,-1,-1,-1 >
 
class  TupleFields< Tuple, k0, k1, k2, k3,-1,-1,-1,-1,-1,-1 >
 
class  TupleFields< Tuple, k0, k1, k2,-1,-1,-1,-1,-1,-1,-1 >
 
class  TupleFields< Tuple, k0, k1,-1,-1,-1,-1,-1,-1,-1,-1 >
 
class  TupleFields< Tuple, k0,-1,-1,-1,-1,-1,-1,-1,-1,-1 >
 
class  TupleFields< Tuple,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 >
 
struct  TuplePolicy
 
class  TuplePrefix
 
class  TuplePrefix< 0 >
 
struct  type_equals
 
struct  type_equals< T, T >
 
class  TypedExpectation
 
class  TypeIdHelper
 
class  TypeWithSize
 
class  TypeWithSize< 4 >
 
class  TypeWithSize< 8 >
 
class  UnitTestHelper
 
class  UnitTestImpl
 
class  UnitTestOptions
 
class  UnitTestRecordPropertyTestHelper
 
class  UniversalPrinter
 
class  UniversalPrinter< T & >
 
class  UniversalPrinter< T[N]>
 
class  UniversalTersePrinter
 
class  UniversalTersePrinter< char * >
 
class  UniversalTersePrinter< const char * >
 
class  UniversalTersePrinter< T & >
 
class  UniversalTersePrinter< T[N]>
 
class  UniversalTersePrinter< wchar_t * >
 
class  UnorderedElementsAreArrayMatcher
 
class  UnorderedElementsAreMatcher
 
class  UnorderedElementsAreMatcherImpl
 
class  UnorderedElementsAreMatcherImplBase
 
class  UntypedActionResultHolderBase
 
class  UntypedFunctionMockerBase
 
class  UntypedOnCallSpecBase
 
class  WhenDynamicCastToMatcher
 
class  WhenDynamicCastToMatcher< To & >
 
class  WhenDynamicCastToMatcherBase
 
class  WhenSortedByMatcher
 
class  WithArgsAction
 
class  XmlUnitTestResultPrinter
 

Typedefs

typedef ::std::pair< size_t, size_t > ElementMatcherPair
 
typedef ::std::vector< ElementMatcherPairElementMatcherPairs
 
typedef ::std::vector< stringStrings
 
typedef FloatingPoint< float > Float
 
typedef FloatingPoint< double > Double
 
typedef const void * TypeId
 
typedef void(* SetUpTestCaseFunc) ()
 
typedef void(* TearDownTestCaseFunc) ()
 
typedef int IsContainer
 
typedef char IsNotContainer
 
typedef ::std::string string
 
typedef ::std::wstring wstring
 
typedef GTestMutexLock MutexLock
 
typedef bool_constant< false > false_type
 
typedef bool_constant< true > true_type
 
typedef long long BiggestInt
 
typedef TypeWithSize< 4 >::Int Int32
 
typedef TypeWithSize< 4 >::UInt UInt32
 
typedef TypeWithSize< 8 >::Int Int64
 
typedef TypeWithSize< 8 >::UInt UInt64
 
typedef TypeWithSize< 8 >::Int TimeInMillis
 

Enumerations

enum  CallReaction {
  kAllow, kWarn, kFail, kDefault = kWarn,
  kAllow, kWarn, kFail, kDefault = kWarn,
  kAllow, kWarn, kFail, kDefault = kWarn
}
 
enum  TypeKind {
  kBool, kInteger, kFloatingPoint, kOther,
  kBool, kInteger, kFloatingPoint, kOther,
  kBool, kInteger, kFloatingPoint, kOther
}
 
enum  LogSeverity {
  kInfo = 0, kWarning = 1, kInfo = 0, kWarning = 1,
  kInfo = 0, kWarning = 1
}
 
enum  GTestLogSeverity {
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL,
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL,
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL
}
 
enum  CharFormat {
  kAsIs, kHexEscape, kSpecialEscape, kAsIs,
  kHexEscape, kSpecialEscape, kAsIs, kHexEscape,
  kSpecialEscape
}
 
enum  GTestColor {
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW
}
 
enum  CallReaction {
  kAllow, kWarn, kFail, kDefault = kWarn,
  kAllow, kWarn, kFail, kDefault = kWarn,
  kAllow, kWarn, kFail, kDefault = kWarn
}
 
enum  TypeKind {
  kBool, kInteger, kFloatingPoint, kOther,
  kBool, kInteger, kFloatingPoint, kOther,
  kBool, kInteger, kFloatingPoint, kOther
}
 
enum  LogSeverity {
  kInfo = 0, kWarning = 1, kInfo = 0, kWarning = 1,
  kInfo = 0, kWarning = 1
}
 
enum  GTestLogSeverity {
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL,
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL,
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL
}
 
enum  CharFormat {
  kAsIs, kHexEscape, kSpecialEscape, kAsIs,
  kHexEscape, kSpecialEscape, kAsIs, kHexEscape,
  kSpecialEscape
}
 
enum  GTestColor {
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW
}
 
enum  CallReaction {
  kAllow, kWarn, kFail, kDefault = kWarn,
  kAllow, kWarn, kFail, kDefault = kWarn,
  kAllow, kWarn, kFail, kDefault = kWarn
}
 
enum  TypeKind {
  kBool, kInteger, kFloatingPoint, kOther,
  kBool, kInteger, kFloatingPoint, kOther,
  kBool, kInteger, kFloatingPoint, kOther
}
 
enum  LogSeverity {
  kInfo = 0, kWarning = 1, kInfo = 0, kWarning = 1,
  kInfo = 0, kWarning = 1
}
 
enum  GTestLogSeverity {
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL,
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL,
  GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL
}
 
enum  CharFormat {
  kAsIs, kHexEscape, kSpecialEscape, kAsIs,
  kHexEscape, kSpecialEscape, kAsIs, kHexEscape,
  kSpecialEscape
}
 
enum  GTestColor {
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW
}
 

Functions

template<typename T >
void PrintTo (const ReferenceWrapper< T > &ref,::std::ostream *os)
 
void PrintIfNotEmpty (const internal::string &explanation,::std::ostream *os)
 
bool IsReadableTypeName (const string &type_name)
 
template<typename Value , typename T >
bool MatchPrintAndExplain (Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
 
template<typename MatcherTuple , typename ValueTuple >
bool TupleMatches (const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
 
template<typename MatcherTuple , typename ValueTuple >
void ExplainMatchFailureTupleTo (const MatcherTuple &matchers, const ValueTuple &values,::std::ostream *os)
 
template<typename Tuple , typename Func , typename OutIter >
OutIter TransformTupleValues (Func f, const Tuple &t, OutIter out)
 
bool CaseInsensitiveCStringEquals (const char *lhs, const char *rhs)
 
bool CaseInsensitiveCStringEquals (const wchar_t *lhs, const wchar_t *rhs)
 
template<typename StringType >
bool CaseInsensitiveStringEquals (const StringType &s1, const StringType &s2)
 
template<typename M >
PredicateFormatterFromMatcher< MMakePredicateFormatterFromMatcher (M matcher)
 
GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching (const MatchMatrix &g)
 
GTEST_API_ bool FindPairing (const MatchMatrix &matrix, MatchResultListener *listener)
 
template<typename Tuple2Matcher , typename Second >
BoundSecondMatcher< Tuple2Matcher, Second > MatcherBindSecond (const Tuple2Matcher &tm, const Second &second)
 
GTEST_API_ string FormatMatcherDescription (bool negation, const char *matcher_name, const Strings &param_values)
 
template<typename InputIterator , typename OutputIterator >
OutputIterator CopyElements (InputIterator first, InputIterator last, OutputIterator output)
 
GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_ (g_gmock_mutex)
 
GTEST_API_ void LogWithLocation (testing::internal::LogSeverity severity, const char *file, int line, const string &message)
 
void ReportUninterestingCall (CallReaction reaction, const string &msg)
 
GTEST_API_ string ConvertIdentifierNameToWords (const char *id_name)
 
template<typename Pointer >
const Pointer::element_type * GetRawPointer (const Pointer &p)
 
template<typename Element >
Element * GetRawPointer (Element *p)
 
template<typename From , typename To >
void Assert (bool condition, const char *file, int line)
 
void Expect (bool condition, const char *file, int line, const string &msg)
 
void Expect (bool condition, const char *file, int line)
 
GTEST_API_ bool LogIsVisible (LogSeverity severity)
 
GTEST_API_ void Log (LogSeverity severity, const string &message, int stack_frames_to_skip)
 
template<typename T >
T Invalid ()
 
GTEST_API_ FailureReporterInterface * GetFailureReporter ()
 
static GTEST_DEFINE_STATIC_MUTEX_ (g_log_mutex)
 
GTEST_API_ string JoinAsTuple (const Strings &fields)
 
static void LogElementMatcherPairVec (const ElementMatcherPairs &pairs,::std::ostream *stream)
 
GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_ (g_gmock_mutex)
 
static const char * ParseGoogleMockFlagValue (const char *str, const char *flag, bool def_optional)
 
static bool ParseGoogleMockBoolFlag (const char *str, const char *flag, bool *value)
 
template<typename String >
static bool ParseGoogleMockStringFlag (const char *str, const char *flag, String *value)
 
template<typename CharType >
void InitGoogleMockImpl (int *argc, CharType **argv)
 
template<typename T >
std::string StreamableToString (const T &streamable)
 
template<typename T1 , typename T2 >
std::string FormatForComparisonFailureMessage (const T1 &value, const T2 &)
 
template<typename T >
void UniversalPrint (const T &value,::std::ostream *os)
 
template<typename C >
void DefaultPrintTo (IsContainer, false_type, const C &container,::std::ostream *os)
 
template<typename T >
void DefaultPrintTo (IsNotContainer, true_type, T *p,::std::ostream *os)
 
template<typename T >
void DefaultPrintTo (IsNotContainer, false_type, const T &value,::std::ostream *os)
 
template<typename T >
void PrintTo (const T &value,::std::ostream *os)
 
GTEST_API_ void PrintTo (unsigned char c,::std::ostream *os)
 
GTEST_API_ void PrintTo (signed char c,::std::ostream *os)
 
void PrintTo (char c,::std::ostream *os)
 
void PrintTo (bool x,::std::ostream *os)
 
GTEST_API_ void PrintTo (wchar_t wc,::std::ostream *os)
 
GTEST_API_ void PrintTo (const char *s,::std::ostream *os)
 
void PrintTo (char *s,::std::ostream *os)
 
void PrintTo (const signed char *s,::std::ostream *os)
 
void PrintTo (signed char *s,::std::ostream *os)
 
void PrintTo (const unsigned char *s,::std::ostream *os)
 
void PrintTo (unsigned char *s,::std::ostream *os)
 
GTEST_API_ void PrintTo (const wchar_t *s,::std::ostream *os)
 
void PrintTo (wchar_t *s,::std::ostream *os)
 
template<typename T >
void PrintRawArrayTo (const T a[], size_t count,::std::ostream *os)
 
GTEST_API_ void PrintStringTo (const ::std::string &s,::std::ostream *os)
 
void PrintTo (const ::std::string &s,::std::ostream *os)
 
template<typename T1 , typename T2 >
void PrintTo (const ::std::pair< T1, T2 > &value,::std::ostream *os)
 
template<typename T >
void UniversalPrintArray (const T *begin, size_t len,::std::ostream *os)
 
GTEST_API_ void UniversalPrintArray (const char *begin, size_t len,::std::ostream *os)
 
GTEST_API_ void UniversalPrintArray (const wchar_t *begin, size_t len,::std::ostream *os)
 
template<typename T >
void UniversalTersePrint (const T &value,::std::ostream *os)
 
class UnitTestImplGetUnitTestImpl ()
 
void ReportFailureInUnknownLocation (TestPartResult::Type result_type, const std::string &message)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperEQFailure (const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperEQ (const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
 
GTEST_API_ AssertionResult CmpHelperEQ (const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperOpFailure (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperNE (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2)
 
GTEST_API_ AssertionResult CmpHelperNE (const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperLE (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2)
 
GTEST_API_ AssertionResult CmpHelperLE (const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperLT (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2)
 
GTEST_API_ AssertionResult CmpHelperLT (const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperGE (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2)
 
GTEST_API_ AssertionResult CmpHelperGE (const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
 
template<typename T1 , typename T2 >
AssertionResult CmpHelperGT (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2)
 
GTEST_API_ AssertionResult CmpHelperGT (const char *expr1, const char *expr2, BiggestInt val1, BiggestInt val2)
 
GTEST_API_ AssertionResult CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult CmpHelperSTRCASENE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
 
GTEST_API_ AssertionResult CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
 
template<typename RawType >
AssertionResult CmpHelperFloatingPointEQ (const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
 
GTEST_API_ AssertionResult DoubleNearPredFormat (const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
 
 GTEST_DECLARE_string_ (internal_run_death_test)
 
char IsNullLiteralHelper (Secret *p)
 
char(& IsNullLiteralHelper (...))[2]
 
GTEST_API_ std::string AppendUserMessage (const std::string &gtest_msg, const Message &user_msg)
 
GTEST_API_ std::string DiffStrings (const std::string &left, const std::string &right, size_t *total_line_count)
 
GTEST_API_ AssertionResult EqFailure (const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
 
GTEST_API_ std::string GetBoolAssertionFailureMessage (const AssertionResult &assertion_result, const char *expression_text, const char *actual_predicate_value, const char *expected_predicate_value)
 
template<typename T >
TypeId GetTypeId ()
 
GTEST_API_ TypeId GetTestTypeId ()
 
GTEST_API_ TestInfoMakeAndRegisterTestInfo (const char *test_case_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestCaseFunc set_up_tc, TearDownTestCaseFunc tear_down_tc, TestFactoryBase *factory)
 
GTEST_API_ bool SkipPrefix (const char *prefix, const char **pstr)
 
GTEST_API_ std::string GetCurrentOsStackTraceExceptTop (UnitTest *unit_test, int skip_count)
 
GTEST_API_ bool AlwaysTrue ()
 
bool AlwaysFalse ()
 
template<class C >
IsContainer IsContainerTest (int, typename C::iterator *=NULL, typename C::const_iterator *=NULL)
 
template<class C >
IsNotContainer IsContainerTest (long)
 
template<typename T , typename U >
bool ArrayEq (const T *lhs, size_t size, const U *rhs)
 
template<typename T , typename U >
bool ArrayEq (const T &lhs, const U &rhs)
 
template<typename T , typename U , size_t N>
bool ArrayEq (const T(&lhs)[N], const U(&rhs)[N])
 
template<typename Iter , typename Element >
Iter ArrayAwareFind (Iter begin, Iter end, const Element &elem)
 
template<typename T , typename U >
void CopyArray (const T *from, size_t size, U *to)
 
template<typename T , typename U >
void CopyArray (const T &from, U *to)
 
template<typename T , typename U , size_t N>
void CopyArray (const T(&from)[N], U(*to)[N])
 
GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_ (g_linked_ptr_mutex)
 
template<typename T >
bool operator== (T *ptr, const linked_ptr< T > &x)
 
template<typename T >
bool operator!= (T *ptr, const linked_ptr< T > &x)
 
template<typename T >
linked_ptr< Tmake_linked_ptr (T *ptr)
 
bool IsTrue (bool condition)
 
::std::string FormatFileLocation (const char *file, int line)
 
::std::string FormatCompilerIndependentFileLocation (const char *file, int line)
 
void LogToStderr ()
 
void FlushInfoLog ()
 
template<typename T >
const Tmove (const T &t)
 
template<typename To >
To ImplicitCast_ (To x)
 
template<typename To , typename From >
To DownCast_ (From *f)
 
template<class Derived , class Base >
DerivedCheckedDowncastToActualType (Base *base)
 
void CaptureStdout ()
 
std::string GetCapturedStdout ()
 
void CaptureStderr ()
 
std::string GetCapturedStderr ()
 
std::string TempDir ()
 
size_t GetFileSize (FILE *file)
 
std::string ReadEntireFile (FILE *file)
 
const ::std::vector< testing::internal::string > & GetArgvs ()
 
size_t GetThreadCount ()
 
bool IsAlpha (char ch)
 
bool IsAlNum (char ch)
 
bool IsDigit (char ch)
 
bool IsLower (char ch)
 
bool IsSpace (char ch)
 
bool IsUpper (char ch)
 
bool IsXDigit (char ch)
 
bool IsXDigit (wchar_t ch)
 
char ToLower (char ch)
 
char ToUpper (char ch)
 
std::string StripTrailingSpaces (std::string str)
 
bool ParseInt32 (const Message &src_text, const char *str, Int32 *value)
 
bool BoolFromGTestEnv (const char *flag, bool default_val)
 
Int32 Int32FromGTestEnv (const char *flag, Int32 default_val)
 
std::string StringFromGTestEnv (const char *flag, const char *default_val)
 
GTEST_API_ std::string StringStreamToString (::std::stringstream *stream)
 
template<typename T >
std::string GetTypeName ()
 
 GTEST_DEFINE_string_ (internal_run_death_test,"","Indicates the file, line number, temporal index of ""the single death test to run, and a file descriptor to ""which a success code may be sent, all separated by ""the '|' characters. This flag is specified if and only if the current ""process is a sub-process launched for running a thread-safe ""death test. FOR INTERNAL USE ONLY.")
 
static bool IsPathSeparator (char c)
 
GTEST_API_ TimeInMillis GetTimeInMillis ()
 
GTEST_API_ bool ShouldUseColor (bool stdout_is_tty)
 
GTEST_API_ std::string FormatTimeInMillisAsSeconds (TimeInMillis ms)
 
GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601 (TimeInMillis ms)
 
GTEST_API_ bool ParseInt32Flag (const char *str, const char *flag, Int32 *value)
 
int GetRandomSeedFromFlag (Int32 random_seed_flag)
 
int GetNextRandomSeed (int seed)
 
GTEST_API_ std::string CodePointToUtf8 (UInt32 code_point)
 
GTEST_API_ std::string WideStringToUtf8 (const wchar_t *str, int num_chars)
 
void WriteToShardStatusFileIfNeeded ()
 
GTEST_API_ bool ShouldShard (const char *total_shards_str, const char *shard_index_str, bool in_subprocess_for_death_test)
 
GTEST_API_ Int32 Int32FromEnvOrDie (const char *env_var, Int32 default_val)
 
GTEST_API_ bool ShouldRunTestOnShard (int total_shards, int shard_index, int test_id)
 
template<class Container , typename Predicate >
int CountIf (const Container &c, Predicate predicate)
 
template<class Container , typename Functor >
void ForEach (const Container &c, Functor functor)
 
template<typename E >
GetElementOr (const std::vector< E > &v, int i, E default_value)
 
template<typename E >
void ShuffleRange (internal::Random *random, int begin, int end, std::vector< E > *v)
 
template<typename E >
void Shuffle (internal::Random *random, std::vector< E > *v)
 
template<typename T >
static void Delete (T *x)
 
GTEST_API_ FilePath GetCurrentExecutableName ()
 
GTEST_API_ void ParseGoogleTestFlagsOnly (int *argc, char **argv)
 
GTEST_API_ void ParseGoogleTestFlagsOnly (int *argc, wchar_t **argv)
 
static std::string FlagToEnvVar (const char *flag)
 
bool IsPrintableAscii (wchar_t c)
 
template<typename UnsignedChar , typename Char >
static CharFormat PrintAsCharLiteralTo (Char c, ostream *os)
 
static CharFormat PrintAsStringLiteralTo (wchar_t c, ostream *os)
 
static CharFormat PrintAsStringLiteralTo (char c, ostream *os)
 
template<typename UnsignedChar , typename Char >
void PrintCharAndCodeTo (Char c, ostream *os)
 
void PrintTo (wchar_t wc, ostream *os)
 
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo (const CharType *begin, size_t len, ostream *os)
 
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void UniversalPrintCharArray (const CharType *begin, size_t len, ostream *os)
 
void UniversalPrintArray (const char *begin, size_t len, ostream *os)
 
void UniversalPrintArray (const wchar_t *begin, size_t len, ostream *os)
 
void PrintTo (const char *s, ostream *os)
 
void PrintTo (const wchar_t *s, ostream *os)
 
void PrintStringTo (const ::std::string &s, ostream *os)
 
static bool GTestIsInitialized ()
 
static int SumOverTestCaseList (const std::vector< TestCase * > &case_list, int(TestCase::*method)() const)
 
static bool TestCasePassed (const TestCase *test_case)
 
static bool TestCaseFailed (const TestCase *test_case)
 
static bool ShouldRunTestCase (const TestCase *test_case)
 
GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_ (g_linked_ptr_mutex)
 
AssertionResult HasOneFailure (const char *, const char *, const char *, const TestPartResultArray &results, TestPartResult::Type type, const string &substr)
 
void SplitString (const ::std::string &str, char delimiter,::std::vector< ::std::string > *dest)
 
template<typename RawType >
AssertionResult FloatingPointLE (const char *expr1, const char *expr2, RawType val1, RawType val2)
 
UInt32 ChopLowBits (UInt32 *bits, int n)
 
bool IsUtf16SurrogatePair (wchar_t first, wchar_t second)
 
UInt32 CreateCodePointFromUtf16SurrogatePair (wchar_t first, wchar_t second)
 
template<class T , typename Result >
Result HandleSehExceptionsInMethodIfSupported (T *object, Result(T::*method)(), const char *location)
 
template<class T , typename Result >
Result HandleExceptionsInMethodIfSupported (T *object, Result(T::*method)(), const char *location)
 
static std::string PrintTestPartResultToString (const TestPartResult &test_part_result)
 
static void PrintTestPartResult (const TestPartResult &test_part_result)
 
const char * GetAnsiColorCode (GTestColor color)
 
void ColoredPrintf (GTestColor color, const char *fmt,...)
 
void PrintFullTestCommentIfPresent (const TestInfo &test_info)
 
static bool PortableLocaltime (time_t seconds, struct tm *out)
 
static void SetUpEnvironment (Environment *env)
 
static void TearDownEnvironment (Environment *env)
 
static void PrintOnOneLine (const char *str, int max_length)
 
const char * ParseFlagValue (const char *str, const char *flag, bool def_optional)
 
bool ParseBoolFlag (const char *str, const char *flag, bool *value)
 
bool ParseStringFlag (const char *str, const char *flag, std::string *value)
 
static bool HasGoogleTestFlagPrefix (const char *str)
 
static void PrintColorEncoded (const char *str)
 
bool ParseGoogleTestFlag (const char *const arg)
 
template<typename CharType >
void ParseGoogleTestFlagsOnlyImpl (int *argc, CharType **argv)
 
template<typename CharType >
void InitGoogleTestImpl (int *argc, CharType **argv)
 
 TEST_F (ListenerTest, DoesFoo)
 
 TEST_F (ListenerTest, DoesBar)
 
 TEST (IsXDigitTest, WorksForNarrowAscii)
 
 TEST (IsXDigitTest, ReturnsFalseForNarrowNonAscii)
 
 TEST (IsXDigitTest, WorksForWideAscii)
 
 TEST (IsXDigitTest, ReturnsFalseForWideNonAscii)
 
 TEST (ImplicitCastTest, ConvertsPointers)
 
 TEST (ImplicitCastTest, CanUseInheritance)
 
 TEST (ImplicitCastTest, CanUseNonConstCastOperator)
 
 TEST (ImplicitCastTest, CanUseConstCastOperatorOnConstValues)
 
 TEST (ImplicitCastTest, CanSelectBetweenConstAndNonConstCasrAppropriately)
 
 TEST (ImplicitCastTest, CanUseImplicitConstructor)
 
 TEST (IteratorTraitsTest, WorksForSTLContainerIterators)
 
 TEST (IteratorTraitsTest, WorksForPointerToNonConst)
 
 TEST (IteratorTraitsTest, WorksForPointerToConst)
 
 TEST (ScopedPtrTest, DefinesElementType)
 
 TEST (GtestCheckSyntaxTest, BehavesLikeASingleStatement)
 
 TEST (GtestCheckSyntaxTest, WorksWithSwitch)
 
 TEST (FormatFileLocationTest, FormatsFileLocation)
 
 TEST (FormatFileLocationTest, FormatsUnknownFile)
 
 TEST (FormatFileLocationTest, FormatsUknownLine)
 
 TEST (FormatFileLocationTest, FormatsUknownFileAndLine)
 
 TEST (FormatCompilerIndependentFileLocationTest, FormatsFileLocation)
 
 TEST (FormatCompilerIndependentFileLocationTest, FormatsUknownFile)
 
 TEST (FormatCompilerIndependentFileLocationTest, FormatsUknownLine)
 
 TEST (FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine)
 
 TEST (GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads)
 
 TEST (GtestCheckDeathTest, DiesWithCorrectOutputOnFailure)
 
 TEST (RegexEngineSelectionTest, SelectsCorrectRegexEngine)
 
 TEST (CaptureTest, CapturesStdout)
 
 TEST (CaptureTest, CapturesStderr)
 
 TEST (CaptureTest, CapturesStdoutAndStderr)
 
 TEST (CaptureDeathTest, CannotReenterStdoutCapture)
 
 TEST (ThreadLocalTest, DefaultConstructorInitializesToDefaultValues)
 
 TEST (ThreadLocalTest, SingleParamConstructorInitializesToParam)
 
 TEST (ThreadLocalTest, ValueDefaultContructorIsNotRequiredForParamVersion)
 
 TEST (ThreadLocalTest, GetAndPointerReturnSameValue)
 
 TEST (ThreadLocalTest, PointerAndConstPointerReturnSameValue)
 
 TEST (ApiTest, UnitTestImmutableAccessorsWork)
 
AssertionResult IsNull (const char *str)
 
 TEST (ApiTest, TestCaseImmutableAccessorsWork)
 
 TEST (ApiTest, TestCaseDisabledAccessorsWork)
 
 TEST (ApiTest, DISABLED_Dummy1)
 
 TEST (DISABLED_Test, Dummy2)
 
static GTEST_DEFINE_STATIC_MUTEX_ (g_log_mutex)
 
static void LogElementMatcherPairVec (const ElementMatcherPairs &pairs,::std::ostream *stream)
 
static const char * ParseGoogleMockFlagValue (const char *str, const char *flag, bool def_optional)
 
static bool ParseGoogleMockBoolFlag (const char *str, const char *flag, bool *value)
 
template<typename String >
static bool ParseGoogleMockStringFlag (const char *str, const char *flag, String *value)
 
static bool IsPathSeparator (char c)
 
template<typename T >
static void Delete (T *x)
 
static std::string FlagToEnvVar (const char *flag)
 
template<typename UnsignedChar , typename Char >
static CharFormat PrintAsCharLiteralTo (Char c, ostream *os)
 
static CharFormat PrintAsStringLiteralTo (wchar_t c, ostream *os)
 
static CharFormat PrintAsStringLiteralTo (char c, ostream *os)
 
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo (const CharType *begin, size_t len, ostream *os)
 
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void UniversalPrintCharArray (const CharType *begin, size_t len, ostream *os)
 
static bool GTestIsInitialized ()
 
static int SumOverTestCaseList (const std::vector< TestCase * > &case_list, int(TestCase::*method)() const)
 
static bool TestCasePassed (const TestCase *test_case)
 
static bool TestCaseFailed (const TestCase *test_case)
 
static bool ShouldRunTestCase (const TestCase *test_case)
 
static std::string PrintTestPartResultToString (const TestPartResult &test_part_result)
 
static void PrintTestPartResult (const TestPartResult &test_part_result)
 
static bool PortableLocaltime (time_t seconds, struct tm *out)
 
static void SetUpEnvironment (Environment *env)
 
static void TearDownEnvironment (Environment *env)
 
static void PrintOnOneLine (const char *str, int max_length)
 
static bool HasGoogleTestFlagPrefix (const char *str)
 
static void PrintColorEncoded (const char *str)
 
static GTEST_DEFINE_STATIC_MUTEX_ (g_log_mutex)
 
static void LogElementMatcherPairVec (const ElementMatcherPairs &pairs,::std::ostream *stream)
 
static const char * ParseGoogleMockFlagValue (const char *str, const char *flag, bool def_optional)
 
static bool ParseGoogleMockBoolFlag (const char *str, const char *flag, bool *value)
 
template<typename String >
static bool ParseGoogleMockStringFlag (const char *str, const char *flag, String *value)
 
static bool IsPathSeparator (char c)
 
template<typename T >
static void Delete (T *x)
 
static std::string FlagToEnvVar (const char *flag)
 
template<typename UnsignedChar , typename Char >
static CharFormat PrintAsCharLiteralTo (Char c, ostream *os)
 
static CharFormat PrintAsStringLiteralTo (wchar_t c, ostream *os)
 
static CharFormat PrintAsStringLiteralTo (char c, ostream *os)
 
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo (const CharType *begin, size_t len, ostream *os)
 
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void UniversalPrintCharArray (const CharType *begin, size_t len, ostream *os)
 
static bool GTestIsInitialized ()
 
static int SumOverTestCaseList (const std::vector< TestCase * > &case_list, int(TestCase::*method)() const)
 
static bool TestCasePassed (const TestCase *test_case)
 
static bool TestCaseFailed (const TestCase *test_case)
 
static bool ShouldRunTestCase (const TestCase *test_case)
 
static std::string PrintTestPartResultToString (const TestPartResult &test_part_result)
 
static void PrintTestPartResult (const TestPartResult &test_part_result)
 
static bool PortableLocaltime (time_t seconds, struct tm *out)
 
static void SetUpEnvironment (Environment *env)
 
static void TearDownEnvironment (Environment *env)
 
static void PrintOnOneLine (const char *str, int max_length)
 
static bool HasGoogleTestFlagPrefix (const char *str)
 
static void PrintColorEncoded (const char *str)
 

Variables

GTEST_API_ ThreadLocal< Sequence * > g_gmock_implicit_sequence
 
const char kInfoVerbosity [] = "info"
 
const char kWarningVerbosity [] = "warning"
 
const char kErrorVerbosity [] = "error"
 
const char kDeathTestStyleFlag [] = "death_test_style"
 
const char kDeathTestUseFork [] = "death_test_use_fork"
 
const char kInternalRunDeathTestFlag [] = "internal_run_death_test"
 
GTEST_API_ const char kStackTraceMarker [] = "\nStack trace:\n"
 
class GTEST_API_ testing::internal::ScopedTrace GTEST_ATTRIBUTE_UNUSED_
 
const BiggestInt kMaxBiggestInt
 
const char kPathSeparator = '/'
 
const char kCurrentDirectoryString [] = "./"
 
GTEST_API_ const TypeId kTestTypeIdInGoogleTest = GetTestTypeId()
 
const char kAlsoRunDisabledTestsFlag [] = "also_run_disabled_tests"
 
const char kBreakOnFailureFlag [] = "break_on_failure"
 
const char kCatchExceptionsFlag [] = "catch_exceptions"
 
const char kColorFlag [] = "color"
 
const char kFilterFlag [] = "filter"
 
const char kListTestsFlag [] = "list_tests"
 
const char kOutputFlag [] = "output"
 
const char kPrintTimeFlag [] = "print_time"
 
const char kRandomSeedFlag [] = "random_seed"
 
const char kRepeatFlag [] = "repeat"
 
const char kShuffleFlag [] = "shuffle"
 
const char kStackTraceDepthFlag [] = "stack_trace_depth"
 
const char kStreamResultToFlag [] = "stream_result_to"
 
const char kThrowOnFailureFlag [] = "throw_on_failure"
 
const char kFlagfileFlag [] = "flagfile"
 
const int kMaxRandomSeed = 99999
 
GTEST_API_ bool g_help_flag = false
 
const int kStdOutFileno = STDOUT_FILENO
 
const int kStdErrFileno = STDERR_FILENO
 
const char kUnknownFile [] = "unknown file"
 
::std::vector< testing::internal::stringg_argvs
 
const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) << 7) - 1
 
const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1
 
const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1
 
const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1
 
static const char kTypeParamLabel [] = "TypeParam"
 
static const char kValueParamLabel [] = "GetParam()"
 
static const char kColorEncodedHelpMessage []
 
const int kTypedTestCases = 0
 
const int kTypedTests = 0
 
static const char kTypeParamLabel [] = "TypeParam"
 
static const char kValueParamLabel [] = "GetParam()"
 
static const char kColorEncodedHelpMessage []
 
static const char kTypeParamLabel [] = "TypeParam"
 
static const char kValueParamLabel [] = "GetParam()"
 
static const char kColorEncodedHelpMessage []
 

Typedef Documentation

typedef long long testing::internal::BiggestInt

Definition at line 2241 of file gtest-port.h.

Definition at line 421 of file gtest-internal.h.

typedef::std::pair< size_t, size_t > testing::internal::ElementMatcherPair

Definition at line 3297 of file gmock-matchers.h.

Definition at line 3298 of file gmock-matchers.h.

Definition at line 2209 of file gtest-port.h.

Definition at line 420 of file gtest-internal.h.

Definition at line 2494 of file gtest-port.h.

Definition at line 2496 of file gtest-port.h.

Definition at line 930 of file gtest-internal.h.

Definition at line 938 of file gtest-internal.h.

Definition at line 2159 of file gtest-port.h.

typedef void(* testing::internal::SetUpTestCaseFunc)()

Definition at line 501 of file gtest-internal.h.

typedef::std::string testing::internal::string

Definition at line 1097 of file gtest-port.h.

typedef::std::vector< string > testing::internal::Strings

Definition at line 859 of file gtest-printers.h.

typedef void(* testing::internal::TearDownTestCaseFunc)()

Definition at line 502 of file gtest-internal.h.

Definition at line 2498 of file gtest-port.h.

Definition at line 2210 of file gtest-port.h.

typedef const void * testing::internal::TypeId

Definition at line 429 of file gtest-internal.h.

Definition at line 2495 of file gtest-port.h.

Definition at line 2497 of file gtest-port.h.

typedef::std::wstring testing::internal::wstring

Definition at line 1103 of file gtest-port.h.

Enumeration Type Documentation

Enumerator
kAllow 
kWarn 
kFail 
kDefault 
kAllow 
kWarn 
kFail 
kDefault 
kAllow 
kWarn 
kFail 
kDefault 

Definition at line 361 of file gmock-spec-builders.h.

361  {
362  kAllow,
363  kWarn,
364  kFail,
365  kDefault = kWarn // By default, warn about uninteresting calls.
366 };
Enumerator
kAllow 
kWarn 
kFail 
kDefault 
kAllow 
kWarn 
kFail 
kDefault 
kAllow 
kWarn 
kFail 
kDefault 

Definition at line 361 of file gmock-spec-builders.h.

361  {
362  kAllow,
363  kWarn,
364  kFail,
365  kDefault = kWarn // By default, warn about uninteresting calls.
366 };
Enumerator
kAllow 
kWarn 
kFail 
kDefault 
kAllow 
kWarn 
kFail 
kDefault 
kAllow 
kWarn 
kFail 
kDefault 

Definition at line 361 of file gmock-spec-builders.h.

361  {
362  kAllow,
363  kWarn,
364  kFail,
365  kDefault = kWarn // By default, warn about uninteresting calls.
366 };
Enumerator
kAsIs 
kHexEscape 
kSpecialEscape 
kAsIs 
kHexEscape 
kSpecialEscape 
kAsIs 
kHexEscape 
kSpecialEscape 

Definition at line 128 of file gtest-printers.cc.

Enumerator
kAsIs 
kHexEscape 
kSpecialEscape 
kAsIs 
kHexEscape 
kSpecialEscape 
kAsIs 
kHexEscape 
kSpecialEscape 

Definition at line 128 of file gtest-printers.cc.

Enumerator
kAsIs 
kHexEscape 
kSpecialEscape 
kAsIs 
kHexEscape 
kSpecialEscape 
kAsIs 
kHexEscape 
kSpecialEscape 

Definition at line 128 of file gtest-printers.cc.

Enumerator
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 

Definition at line 2880 of file gtest.cc.

Enumerator
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 

Definition at line 2880 of file gtest.cc.

Enumerator
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 
COLOR_DEFAULT 
COLOR_RED 
COLOR_GREEN 
COLOR_YELLOW 

Definition at line 2880 of file gtest.cc.

Enumerator
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 

Definition at line 1244 of file gtest-port.h.

Enumerator
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 

Definition at line 1244 of file gtest-port.h.

Enumerator
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 
GTEST_INFO 
GTEST_WARNING 
GTEST_ERROR 
GTEST_FATAL 

Definition at line 1244 of file gtest-port.h.

Enumerator
kInfo 
kWarning 
kInfo 
kWarning 
kInfo 
kWarning 

Definition at line 306 of file gmock-internal-utils.h.

Enumerator
kInfo 
kWarning 
kInfo 
kWarning 
kInfo 
kWarning 

Definition at line 306 of file gmock-internal-utils.h.

Enumerator
kInfo 
kWarning 
kInfo 
kWarning 
kInfo 
kWarning 

Definition at line 306 of file gmock-internal-utils.h.

Enumerator
kBool 
kInteger 
kFloatingPoint 
kOther 
kBool 
kInteger 
kFloatingPoint 
kOther 
kBool 
kInteger 
kFloatingPoint 
kOther 

Definition at line 126 of file gmock-internal-utils.h.

Enumerator
kBool 
kInteger 
kFloatingPoint 
kOther 
kBool 
kInteger 
kFloatingPoint 
kOther 
kBool 
kInteger 
kFloatingPoint 
kOther 

Definition at line 126 of file gmock-internal-utils.h.

Enumerator
kBool 
kInteger 
kFloatingPoint 
kOther 
kBool 
kInteger 
kFloatingPoint 
kOther 
kBool 
kInteger 
kFloatingPoint 
kOther 

Definition at line 126 of file gmock-internal-utils.h.

Function Documentation

bool testing::internal::AlwaysFalse ( )
inline
bool testing::internal::AlwaysTrue ( )

Definition at line 4988 of file gtest.cc.

References IsTrue().

Referenced by AlwaysFalse(), testing::internal::CodeLocation::CodeLocation(), PrintOnOneLine(), ShouldRunTestCase(), SplitString(), TEST(), TEST(), testing::internal::To::To(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

4988  {
4989 #if GTEST_HAS_EXCEPTIONS
4990  // This condition is always false so AlwaysTrue() never actually throws,
4991  // but it makes the compiler think that it may throw.
4992  if (IsTrue(false))
4993  throw ClassUniqueToAlwaysTrue();
4994 #endif // GTEST_HAS_EXCEPTIONS
4995  return true;
4996 }
bool IsTrue(bool condition)
Definition: gtest.cc:4986
std::string testing::internal::AppendUserMessage ( const std::string gtest_msg,
const Message user_msg 
)

Definition at line 2001 of file gtest.cc.

References testing::Message::GetString(), and string.

Referenced by testing::internal::AssertHelper::operator=(), ShouldRunTestCase(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

2002  {
2003  // Appends the user message if it's non-empty.
2004  const std::string user_msg_string = user_msg.GetString();
2005  if (user_msg_string.empty()) {
2006  return gtest_msg;
2007  }
2008 
2009  return gtest_msg + "\n" + user_msg_string;
2010 }
const char * string
Definition: Conv.cpp:212
template<typename Iter , typename Element >
Iter testing::internal::ArrayAwareFind ( Iter  begin,
Iter  end,
const Element &  elem 
)

Definition at line 983 of file gtest-internal.h.

References ArrayEq(), CopyArray(), folly::test::end(), folly::pushmi::operators::from, gen_gtest_pred_impl::Iter(), and folly::to().

Referenced by testing::internal::ContainerEqMatcher< Container >::MatchAndExplain(), TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

983  {
984  for (Iter it = begin; it != end; ++it) {
985  if (internal::ArrayEq(*it, elem))
986  return it;
987  }
988  return end;
989 }
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
def Iter(n, format, sep='')
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N])
template<typename T , typename U >
bool testing::internal::ArrayEq ( const T lhs,
size_t  size,
const U *  rhs 
)

Definition at line 972 of file gtest-internal.h.

References ArrayEq(), i, and folly::size().

Referenced by TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

972  {
973  for (size_t i = 0; i != size; i++) {
974  if (!internal::ArrayEq(lhs[i], rhs[i]))
975  return false;
976  }
977  return true;
978 }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N])
template<typename T , typename U >
bool testing::internal::ArrayEq ( const T lhs,
const U &  rhs 
)
inline

Definition at line 960 of file gtest-internal.h.

References folly::detail::rhs.

960 { return lhs == rhs; }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
template<typename T , typename U , size_t N>
bool testing::internal::ArrayEq ( const T(&)  lhs[N],
const U(&)  rhs[N] 
)
inline

Definition at line 964 of file gtest-internal.h.

Referenced by ArrayAwareFind(), ArrayEq(), and testing::internal::NativeArray< Element >::operator==().

964  {
965  return internal::ArrayEq(lhs, N, rhs);
966 }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N])
bool testing::internal::BoolFromGTestEnv ( const char *  flag,
bool  default_val 
)

Definition at line 1191 of file gtest-port.cc.

References FlagToEnvVar(), testing::internal::posix::GetEnv(), and string.

Referenced by FlagToEnvVar(), and testing::GetDefaultFilter().

1191  {
1192 #if defined(GTEST_GET_BOOL_FROM_ENV_)
1193  return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
1194 #endif // defined(GTEST_GET_BOOL_FROM_ENV_)
1195  const std::string env_var = FlagToEnvVar(flag);
1196  const char* const string_value = posix::GetEnv(env_var.c_str());
1197  return string_value == NULL ?
1198  default_value : strcmp(string_value, "0") != 0;
1199 }
static once_flag flag
Definition: Random.cpp:75
static std::string FlagToEnvVar(const char *flag)
Definition: gtest-port.cc:1134
const char * string
Definition: Conv.cpp:212
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
bool testing::internal::CaseInsensitiveCStringEquals ( const char *  lhs,
const char *  rhs 
)
inline

Definition at line 1090 of file gmock-matchers.h.

References CaseInsensitiveCStringEquals().

Referenced by CmpHelperSTRCASEEQ(), CmpHelperSTRCASENE(), testing::internal::String::EndsWithCaseInsensitive(), and ShouldUseColor().

1090  {
1092 }
bool CaseInsensitiveCStringEquals(const wchar_t *lhs, const wchar_t *rhs)
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool testing::internal::CaseInsensitiveCStringEquals ( const wchar_t *  lhs,
const wchar_t *  rhs 
)
inline

Definition at line 1094 of file gmock-matchers.h.

Referenced by CaseInsensitiveCStringEquals(), CaseInsensitiveStringEquals(), and testing::internal::RefMatcher< T & >::Impl< Super >::DescribeNegationTo().

1095  {
1096  return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
1097 }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
template<typename StringType >
bool testing::internal::CaseInsensitiveStringEquals ( const StringType &  s1,
const StringType &  s2 
)

Definition at line 1102 of file gmock-matchers.h.

References CaseInsensitiveCStringEquals().

Referenced by testing::internal::RefMatcher< T & >::Impl< Super >::DescribeNegationTo(), and testing::internal::StrEqualityMatcher< StringType >::MatchAndExplain().

1103  {
1104  // Are the heads equal?
1105  if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) {
1106  return false;
1107  }
1108 
1109  // Skip the equal heads.
1110  const typename StringType::value_type nul = 0;
1111  const size_t i1 = s1.find(nul), i2 = s2.find(nul);
1112 
1113  // Are we at the end of either s1 or s2?
1114  if (i1 == StringType::npos || i2 == StringType::npos) {
1115  return i1 == i2;
1116  }
1117 
1118  // Are the tails equal?
1119  return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1));
1120 }
bool CaseInsensitiveCStringEquals(const wchar_t *lhs, const wchar_t *rhs)
bool CaseInsensitiveStringEquals(const StringType &s1, const StringType &s2)
template<class Derived , class Base >
Derived * testing::internal::CheckedDowncastToActualType ( Base base)

Definition at line 1392 of file gtest-port.h.

References CaptureStderr(), CaptureStdout(), FILE, GetArgvs(), GetCapturedStderr(), GetCapturedStdout(), GetFileSize(), GTEST_API_, GTEST_CHECK_, GTEST_CHECK_POSIX_SUCCESS_, GTEST_DISALLOW_COPY_AND_ASSIGN_, mutex, Mutex, mutex_, ReadEntireFile(), Run(), string, T, TempDir(), folly::detail::distributed_mutex::time(), type_, and value.

1392  {
1393 #if GTEST_HAS_RTTI
1394  GTEST_CHECK_(typeid(*base) == typeid(Derived));
1395 #endif
1396 
1397 #if GTEST_HAS_DOWNCAST_
1398  return ::down_cast<Derived*>(base);
1399 #elif GTEST_HAS_RTTI
1400  return dynamic_cast<Derived*>(base); // NOLINT
1401 #else
1402  return static_cast<Derived*>(base); // Poor man's downcast.
1403 #endif
1404 }
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
UInt32 testing::internal::ChopLowBits ( UInt32 bits,
int  n 
)
inline

Definition at line 1747 of file gtest.cc.

Referenced by CodePointToUtf8().

1747  {
1748  const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);
1749  *bits >>= n;
1750  return low_bits;
1751 }
TypeWithSize< 4 >::UInt UInt32
Definition: gtest-port.h:2495
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperEQ ( const char *  lhs_expression,
const char *  rhs_expression,
const T1 lhs,
const T2 rhs 
)

Definition at line 1387 of file gtest.h.

References testing::AssertionSuccess(), CmpHelperEQFailure(), GTEST_API_, GTEST_DISABLE_MSC_WARNINGS_POP_, GTEST_DISABLE_MSC_WARNINGS_PUSH_, and folly::detail::rhs.

Referenced by testing::internal::EqHelper< lhs_is_null_literal >::Compare(), testing::internal::EqHelper< true >::Compare(), and testing::UnitTest::impl().

1390  {
1391 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
1392  if (lhs == rhs) {
1393  return AssertionSuccess();
1394  }
1396 
1397  return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
1398 }
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
Definition: gtest-port.h:317
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
if(FOLLY_USE_SYMBOLIZER) add_library(folly_exception_tracer_base ExceptionTracer.cpp StackTrace.cpp) apply_folly_compile_options_to_target(folly_exception_tracer_base) target_link_libraries(folly_exception_tracer_base PUBLIC folly) add_library(folly_exception_tracer ExceptionStackTraceLib.cpp ExceptionTracerLib.cpp) apply_folly_compile_options_to_target(folly_exception_tracer) target_link_libraries(folly_exception_tracer PUBLIC folly_exception_tracer_base) add_library(folly_exception_counter ExceptionCounterLib.cpp) apply_folly_compile_options_to_target(folly_exception_counter) target_link_libraries(folly_exception_counter PUBLIC folly_exception_tracer) install(FILES ExceptionAbi.h ExceptionCounterLib.h ExceptionTracer.h ExceptionTracerLib.h StackTrace.h DESTINATION $
Definition: CMakeLists.txt:1
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
Definition: gtest.h:1375
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition: gtest-port.h:318
AssertionResult testing::internal::CmpHelperEQ ( const char *  lhs_expression,
const char *  rhs_expression,
BiggestInt  lhs,
BiggestInt  rhs 
)

Definition at line 1437 of file gtest.cc.

References testing::AssertionSuccess(), EqFailure(), and FormatForComparisonFailureMessage().

1440  {
1441  if (lhs == rhs) {
1442  return AssertionSuccess();
1443  }
1444 
1445  return EqFailure(lhs_expression,
1446  rhs_expression,
1449  false);
1450 }
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
Definition: gtest.cc:1312
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperEQFailure ( const char *  lhs_expression,
const char *  rhs_expression,
const T1 lhs,
const T2 rhs 
)

Definition at line 1375 of file gtest.h.

References EqFailure(), and FormatForComparisonFailureMessage().

Referenced by CmpHelperEQ(), and testing::UnitTest::impl().

1377  {
1378  return EqFailure(lhs_expression,
1379  rhs_expression,
1382  false);
1383 }
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
Definition: gtest.cc:1312
template<typename RawType >
AssertionResult testing::internal::CmpHelperFloatingPointEQ ( const char *  lhs_expression,
const char *  rhs_expression,
RawType  lhs_value,
RawType  rhs_value 
)

Definition at line 1631 of file gtest.h.

References testing::AssertionSuccess(), folly::digits10(), DoubleNearPredFormat(), EqFailure(), GTEST_API_, folly::detail::rhs, and StringStreamToString().

1634  {
1635  const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
1636 
1637  if (lhs.AlmostEquals(rhs)) {
1638  return AssertionSuccess();
1639  }
1640 
1641  ::std::stringstream lhs_ss;
1643  << lhs_value;
1644 
1645  ::std::stringstream rhs_ss;
1647  << rhs_value;
1648 
1649  return EqFailure(lhs_expression,
1650  rhs_expression,
1651  StringStreamToString(&lhs_ss),
1652  StringStreamToString(&rhs_ss),
1653  false);
1654 }
uint32_t digits10(uint64_t v)
Definition: Conv.h:295
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
Definition: gtest.cc:1312
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
Definition: gtest.cc:1982
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperGE ( const char *  expr1,
const char *  expr2,
const T1 val1,
const T2 val2 
)

Definition at line 1528 of file gtest.h.

AssertionResult testing::internal::CmpHelperGE ( const char *  expr1,
const char *  expr2,
BiggestInt  val1,
BiggestInt  val2 
)

Definition at line 1479 of file gtest.cc.

1490 {
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperGT ( const char *  expr1,
const char *  expr2,
const T1 val1,
const T2 val2 
)

Definition at line 1530 of file gtest.h.

AssertionResult testing::internal::CmpHelperGT ( const char *  expr1,
const char *  expr2,
BiggestInt  val1,
BiggestInt  val2 
)

Definition at line 1482 of file gtest.cc.

1490 {
AssertionResult testing::internal::CmpHelperLE ( const char *  expr1,
const char *  expr2,
BiggestInt  val1,
BiggestInt  val2 
)

Definition at line 1473 of file gtest.cc.

1490 {
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperLE ( const char *  expr1,
const char *  expr2,
const T1 val1,
const T2 val2 
)

Definition at line 1524 of file gtest.h.

AssertionResult testing::internal::CmpHelperLT ( const char *  expr1,
const char *  expr2,
BiggestInt  val1,
BiggestInt  val2 
)

Definition at line 1476 of file gtest.cc.

1490 {
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperLT ( const char *  expr1,
const char *  expr2,
const T1 val1,
const T2 val2 
)

Definition at line 1526 of file gtest.h.

template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperNE ( const char *  expr1,
const char *  expr2,
const T1 val1,
const T2 val2 
)

Definition at line 1522 of file gtest.h.

AssertionResult testing::internal::CmpHelperNE ( const char *  expr1,
const char *  expr2,
BiggestInt  val1,
BiggestInt  val2 
)

Definition at line 1470 of file gtest.cc.

1490 {
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperOpFailure ( const char *  expr1,
const char *  expr2,
const T1 val1,
const T2 val2,
const char *  op 
)

Definition at line 1486 of file gtest.h.

References testing::AssertionFailure(), and FormatForComparisonFailureMessage().

Referenced by testing::internal::EqHelper< true >::Compare().

1488  {
1489  return AssertionFailure()
1490  << "Expected: (" << expr1 << ") " << op << " (" << expr2
1491  << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
1492  << " vs " << FormatForComparisonFailureMessage(val2, val1);
1493 }
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
GTEST_API_ AssertionResult AssertionFailure(const Message &msg)
Definition: gtest.cc:1021
AssertionResult testing::internal::CmpHelperSTRCASEEQ ( const char *  s1_expression,
const char *  s2_expression,
const char *  s1,
const char *  s2 
)

Definition at line 1503 of file gtest.cc.

References testing::AssertionSuccess(), CaseInsensitiveCStringEquals(), EqFailure(), and testing::PrintToString().

1506  {
1508  return AssertionSuccess();
1509  }
1510 
1511  return EqFailure(lhs_expression,
1512  rhs_expression,
1513  PrintToString(lhs),
1514  PrintToString(rhs),
1515  true);
1516 }
::std::string PrintToString(const T &value)
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
Definition: gtest.cc:1312
AssertionResult testing::internal::CmpHelperSTRCASENE ( const char *  s1_expression,
const char *  s2_expression,
const char *  s1,
const char *  s2 
)

Definition at line 1533 of file gtest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), CaseInsensitiveCStringEquals(), and needle.

1536  {
1537  if (!String::CaseInsensitiveCStringEquals(s1, s2)) {
1538  return AssertionSuccess();
1539  } else {
1540  return AssertionFailure()
1541  << "Expected: (" << s1_expression << ") != ("
1542  << s2_expression << ") (ignoring case), actual: \""
1543  << s1 << "\" vs \"" << s2 << "\"";
1544  }
1545 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
AssertionResult testing::internal::CmpHelperSTREQ ( const char *  s1_expression,
const char *  s2_expression,
const char *  s1,
const char *  s2 
)

Definition at line 1487 of file gtest.cc.

References testing::AssertionSuccess(), EqFailure(), and testing::PrintToString().

1490  {
1491  if (String::CStringEquals(lhs, rhs)) {
1492  return AssertionSuccess();
1493  }
1494 
1495  return EqFailure(lhs_expression,
1496  rhs_expression,
1497  PrintToString(lhs),
1498  PrintToString(rhs),
1499  false);
1500 }
::std::string PrintToString(const T &value)
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
Definition: gtest.cc:1312
AssertionResult testing::internal::CmpHelperSTREQ ( const char *  s1_expression,
const char *  s2_expression,
const wchar_t *  s1,
const wchar_t *  s2 
)

Definition at line 1869 of file gtest.cc.

References testing::AssertionSuccess(), EqFailure(), and testing::PrintToString().

1872  {
1873  if (String::WideCStringEquals(lhs, rhs)) {
1874  return AssertionSuccess();
1875  }
1876 
1877  return EqFailure(lhs_expression,
1878  rhs_expression,
1879  PrintToString(lhs),
1880  PrintToString(rhs),
1881  false);
1882 }
::std::string PrintToString(const T &value)
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
Definition: gtest.cc:1312
AssertionResult testing::internal::CmpHelperSTRNE ( const char *  s1_expression,
const char *  s2_expression,
const char *  s1,
const char *  s2 
)

Definition at line 1519 of file gtest.cc.

References testing::AssertionFailure(), and testing::AssertionSuccess().

1522  {
1523  if (!String::CStringEquals(s1, s2)) {
1524  return AssertionSuccess();
1525  } else {
1526  return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
1527  << s2_expression << "), actual: \""
1528  << s1 << "\" vs \"" << s2 << "\"";
1529  }
1530 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
AssertionResult testing::internal::CmpHelperSTRNE ( const char *  s1_expression,
const char *  s2_expression,
const wchar_t *  s1,
const wchar_t *  s2 
)

Definition at line 1885 of file gtest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), and testing::PrintToString().

1888  {
1889  if (!String::WideCStringEquals(s1, s2)) {
1890  return AssertionSuccess();
1891  }
1892 
1893  return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
1894  << s2_expression << "), actual: "
1895  << PrintToString(s1)
1896  << " vs " << PrintToString(s2);
1897 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
::std::string PrintToString(const T &value)
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
std::string testing::internal::CodePointToUtf8 ( UInt32  code_point)

Definition at line 1759 of file gtest.cc.

References ChopLowBits().

Referenced by operator<<(), testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty(), WideStringToUtf8(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

1759  {
1760  if (code_point > kMaxCodePoint4) {
1761  return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";
1762  }
1763 
1764  char str[5]; // Big enough for the largest valid code point.
1765  if (code_point <= kMaxCodePoint1) {
1766  str[1] = '\0';
1767  str[0] = static_cast<char>(code_point); // 0xxxxxxx
1768  } else if (code_point <= kMaxCodePoint2) {
1769  str[2] = '\0';
1770  str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1771  str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
1772  } else if (code_point <= kMaxCodePoint3) {
1773  str[3] = '\0';
1774  str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1775  str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1776  str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
1777  } else { // code_point <= kMaxCodePoint4
1778  str[4] = '\0';
1779  str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1780  str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1781  str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
1782  str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx
1783  }
1784  return str;
1785 }
UInt32 ChopLowBits(UInt32 *bits, int n)
Definition: gtest.cc:1747
const UInt32 kMaxCodePoint3
Definition: gtest.cc:1739
const UInt32 kMaxCodePoint1
Definition: gtest.cc:1733
const UInt32 kMaxCodePoint4
Definition: gtest.cc:1742
const UInt32 kMaxCodePoint2
Definition: gtest.cc:1736
void testing::internal::ColoredPrintf ( GTestColor  color,
const char *  fmt,
  ... 
)

Definition at line 2956 of file gtest.cc.

References AlwaysFalse(), COLOR_DEFAULT, testing::internal::posix::FileNo(), GetAnsiColorCode(), testing::internal::posix::IsATTY(), and ShouldUseColor().

Referenced by testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(), testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(), testing::internal::PrettyUnitTestResultPrinter::OnTestCaseEnd(), testing::internal::PrettyUnitTestResultPrinter::OnTestCaseStart(), testing::internal::PrettyUnitTestResultPrinter::OnTestEnd(), testing::internal::PrettyUnitTestResultPrinter::OnTestIterationEnd(), testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart(), testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd(), testing::internal::PrettyUnitTestResultPrinter::OnTestStart(), PrintColorEncoded(), testing::internal::PrettyUnitTestResultPrinter::PrintFailedTests(), ShouldShard(), TearDownEnvironment(), and WriteToShardStatusFileIfNeeded().

2956  {
2957  va_list args;
2958  va_start(args, fmt);
2959 
2960 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
2961  GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
2962  const bool use_color = AlwaysFalse();
2963 #else
2964  static const bool in_color_mode =
2966  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
2967 #endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
2968  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
2969 
2970  if (!use_color) {
2971  vprintf(fmt, args);
2972  va_end(args);
2973  return;
2974  }
2975 
2976 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
2977  !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
2978  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
2979 
2980  // Gets the current text color.
2981  CONSOLE_SCREEN_BUFFER_INFO buffer_info;
2982  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
2983  const WORD old_color_attrs = buffer_info.wAttributes;
2984 
2985  // We need to flush the stream buffers into the console before each
2986  // SetConsoleTextAttribute call lest it affect the text that is already
2987  // printed but has not yet reached the console.
2988  fflush(stdout);
2989  SetConsoleTextAttribute(stdout_handle,
2990  GetColorAttribute(color) | FOREGROUND_INTENSITY);
2991  vprintf(fmt, args);
2992 
2993  fflush(stdout);
2994  // Restores the text color.
2995  SetConsoleTextAttribute(stdout_handle, old_color_attrs);
2996 #else
2997  printf("\033[0;3%sm", GetAnsiColorCode(color));
2998  vprintf(fmt, args);
2999  printf("\033[m"); // Resets the terminal to default.
3000 #endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
3001  va_end(args);
3002 }
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
int FileNo(FILE *file)
Definition: gtest-port.h:2340
const char * GetAnsiColorCode(GTestColor color)
Definition: gtest.cc:2904
GTEST_API_ string testing::internal::ConvertIdentifierNameToWords ( const char *  id_name)

Definition at line 54 of file gmock-internal-utils.cc.

References IsAlNum(), IsAlpha(), IsDigit(), IsLower(), IsUpper(), and ToLower().

Referenced by FormatMatcherDescription().

54  {
55  string result;
56  char prev_char = '\0';
57  for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
58  // We don't care about the current locale as the input is
59  // guaranteed to be a valid C++ identifier name.
60  const bool starts_new_word = IsUpper(*p) ||
61  (!IsAlpha(prev_char) && IsLower(*p)) ||
62  (!IsDigit(prev_char) && IsDigit(*p));
63 
64  if (IsAlNum(*p)) {
65  if (starts_new_word && result != "")
66  result += ' ';
67  result += ToLower(*p);
68  }
69  }
70  return result;
71 }
bool IsDigit(char ch)
Definition: gtest-port.h:2257
char ToLower(char ch)
Definition: gtest-port.h:2277
bool IsAlpha(char ch)
Definition: gtest-port.h:2251
bool IsLower(char ch)
Definition: gtest-port.h:2260
bool IsUpper(char ch)
Definition: gtest-port.h:2266
bool IsAlNum(char ch)
Definition: gtest-port.h:2254
template<typename T , typename U >
void testing::internal::CopyArray ( const T from,
size_t  size,
U *  to 
)

Definition at line 1012 of file gtest-internal.h.

References CopyArray(), i, and folly::size().

Referenced by TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

1012  {
1013  for (size_t i = 0; i != size; i++) {
1014  internal::CopyArray(from[i], to + i);
1015  }
1016 }
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
void CopyArray(const T(&from)[N], U(*to)[N])
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::from_fn from
template<typename T , typename U >
void testing::internal::CopyArray ( const T from,
U *  to 
)
inline

Definition at line 1000 of file gtest-internal.h.

References folly::pushmi::operators::from.

1000 { *to = from; }
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::from_fn from
template<typename T , typename U , size_t N>
void testing::internal::CopyArray ( const T(&)  from[N],
U(*)  to[N] 
)
inline

Definition at line 1004 of file gtest-internal.h.

Referenced by ArrayAwareFind(), CopyArray(), and testing::internal::NativeArray< Element >::InitCopy().

1004  {
1005  internal::CopyArray(from, N, *to);
1006 }
void CopyArray(const T(&from)[N], U(*to)[N])
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::from_fn from
template<typename InputIterator , typename OutputIterator >
OutputIterator testing::internal::CopyElements ( InputIterator  first,
InputIterator  last,
OutputIterator  output 
)
inline

Definition at line 98 of file gmock-more-actions.h.

References folly::gen::first, and gmock_output_test::output.

Referenced by testing::ACTION_TEMPLATE(), and testing::internal::InvokeMethodAction< Class, MethodPtr >::Perform().

100  {
101  for (; first != last; ++first, ++output) {
102  *output = *first;
103  }
104  return output;
105 }
constexpr detail::First first
Definition: Base-inl.h:2553
template<class Container , typename Predicate >
int testing::internal::CountIf ( const Container &  c,
Predicate  predicate 
)
inline
UInt32 testing::internal::CreateCodePointFromUtf16SurrogatePair ( wchar_t  first,
wchar_t  second 
)
inline

Definition at line 1800 of file gtest.cc.

References folly::gen::first.

Referenced by WideStringToUtf8().

1801  {
1802  const UInt32 mask = (1 << 10) - 1;
1803  return (sizeof(wchar_t) == 2) ?
1804  (((first & mask) << 10) | (second & mask)) + 0x10000 :
1805  // This function should not be called when the condition is
1806  // false, but we provide a sensible default in case it is.
1807  static_cast<UInt32>(first);
1808 }
TypeWithSize< 4 >::UInt UInt32
Definition: gtest-port.h:2495
constexpr detail::First first
Definition: Base-inl.h:2553
template<typename C >
void testing::internal::DefaultPrintTo ( IsContainer  ,
false_type  ,
const C container,
::std::ostream *  os 
)

Definition at line 370 of file gtest-printers.h.

References count, and UniversalPrint().

372  {
373  const size_t kMaxCount = 32; // The maximum number of elements to print.
374  *os << '{';
375  size_t count = 0;
376  for (typename C::const_iterator it = container.begin();
377  it != container.end(); ++it, ++count) {
378  if (count > 0) {
379  *os << ',';
380  if (count == kMaxCount) { // Enough has been printed.
381  *os << " ...";
382  break;
383  }
384  }
385  *os << ' ';
386  // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
387  // handle *it being a native array.
388  internal::UniversalPrint(*it, os);
389  }
390 
391  if (count > 0) {
392  *os << ' ';
393  }
394  *os << '}';
395 }
void UniversalPrint(const T &value,::std::ostream *os)
int * count
template<typename T >
void testing::internal::DefaultPrintTo ( IsNotContainer  ,
true_type  ,
T p,
::std::ostream *  os 
)

Definition at line 404 of file gtest-printers.h.

References IsTrue().

406  {
407  if (p == NULL) {
408  *os << "NULL";
409  } else {
410  // C++ doesn't allow casting from a function pointer to any object
411  // pointer.
412  //
413  // IsTrue() silences warnings: "Condition is always true",
414  // "unreachable code".
416  // T is not a function type. We just call << to print p,
417  // relying on ADL to pick up user-defined << for their pointer
418  // types, if any.
419  *os << p;
420  } else {
421  // T is a function type, so '*os << p' doesn't do what we want
422  // (it just prints p as bool). We want to print p as a const
423  // void*. However, we cannot cast it to const void* directly,
424  // even using reinterpret_cast, as earlier versions of gcc
425  // (e.g. 3.4.5) cannot compile the cast when p is a function
426  // pointer. Casting to UInt64 first solves the problem.
427  *os << reinterpret_cast<const void*>(
428  reinterpret_cast<internal::UInt64>(p));
429  }
430  }
431 }
bool IsTrue(bool condition)
Definition: gtest.cc:4986
TypeWithSize< 8 >::UInt UInt64
Definition: gtest-port.h:2497
static const char *const value
Definition: Conv.cpp:50
template<typename T >
void testing::internal::DefaultPrintTo ( IsNotContainer  ,
false_type  ,
const T value,
::std::ostream *  os 
)

Definition at line 436 of file gtest-printers.h.

References testing_internal::DefaultPrintNonContainerTo().

Referenced by PrintTo().

438  {
440 }
void DefaultPrintNonContainerTo(const T &value,::std::ostream *os)
static const char *const value
Definition: Conv.cpp:50
template<typename T >
static void testing::internal::Delete ( T x)
static

Definition at line 340 of file gtest-internal-inl.h.

References x.

340  {
341  delete x;
342 }
const int x
template<typename T >
static void testing::internal::Delete ( T x)
static

Definition at line 340 of file gtest-internal-inl.h.

References x.

340  {
341  delete x;
342 }
const int x
template<typename T >
static void testing::internal::Delete ( T x)
static

Definition at line 340 of file gtest-internal-inl.h.

References x.

Referenced by testing::gmock_nice_strict_test::MockBar::str(), and testing::gmock_nice_strict_test::TEST().

340  {
341  delete x;
342 }
const int x
GTEST_API_ std::string testing::internal::DiffStrings ( const std::string left,
const std::string right,
size_t *  total_line_count 
)
AssertionResult testing::internal::DoubleNearPredFormat ( const char *  expr1,
const char *  expr2,
const char *  abs_error_expr,
double  val1,
double  val2,
double  abs_error 
)

Definition at line 1362 of file gtest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), and diff().

Referenced by CmpHelperFloatingPointEQ().

1367  {
1368  const double diff = fabs(val1 - val2);
1369  if (diff <= abs_error) return AssertionSuccess();
1370 
1371  // TODO(wan): do not print the value of an expression if it's
1372  // already a literal.
1373  return AssertionFailure()
1374  << "The difference between " << expr1 << " and " << expr2
1375  << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
1376  << expr1 << " evaluates to " << val1 << ",\n"
1377  << expr2 << " evaluates to " << val2 << ", and\n"
1378  << abs_error_expr << " evaluates to " << abs_error << ".";
1379 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
uint64_t diff(uint64_t a, uint64_t b)
Definition: FutexTest.cpp:135
template<typename To , typename From >
To testing::internal::DownCast_ ( From *  f)
inline

Definition at line 1367 of file gtest-port.h.

References f, GTEST_CHECK_, GTEST_INTENTIONAL_CONST_COND_POP_, GTEST_INTENTIONAL_CONST_COND_PUSH_, and folly::to().

1367  { // so we only accept pointers
1368  // Ensures that To is a sub-type of From *. This test is here only
1369  // for compile-time type checking, and has no overhead in an
1370  // optimized build at run-time, as it will be optimized away
1371  // completely.
1373  if (false) {
1375  const To to = NULL;
1376  ::testing::internal::ImplicitCast_<From*>(to);
1377  }
1378 
1379 #if GTEST_HAS_RTTI
1380  // RTTI: debug mode only!
1381  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
1382 #endif
1383  return static_cast<To>(f);
1384 }
To ImplicitCast_(To x)
Definition: gtest-port.h:1343
auto f
#define GTEST_INTENTIONAL_CONST_COND_POP_()
Definition: gtest-port.h:899
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
if(FOLLY_USE_SYMBOLIZER) add_library(folly_exception_tracer_base ExceptionTracer.cpp StackTrace.cpp) apply_folly_compile_options_to_target(folly_exception_tracer_base) target_link_libraries(folly_exception_tracer_base PUBLIC folly) add_library(folly_exception_tracer ExceptionStackTraceLib.cpp ExceptionTracerLib.cpp) apply_folly_compile_options_to_target(folly_exception_tracer) target_link_libraries(folly_exception_tracer PUBLIC folly_exception_tracer_base) add_library(folly_exception_counter ExceptionCounterLib.cpp) apply_folly_compile_options_to_target(folly_exception_counter) target_link_libraries(folly_exception_counter PUBLIC folly_exception_tracer) install(FILES ExceptionAbi.h ExceptionCounterLib.h ExceptionTracer.h ExceptionTracerLib.h StackTrace.h DESTINATION $
Definition: CMakeLists.txt:1
const
Definition: upload.py:398
#define GTEST_INTENTIONAL_CONST_COND_PUSH_()
Definition: gtest-port.h:897
AssertionResult testing::internal::EqFailure ( const char *  expected_expression,
const char *  actual_expression,
const std::string expected_value,
const std::string actual_value,
bool  ignoring_case 
)

Definition at line 1312 of file gtest.cc.

References testing::AssertionFailure(), and testing::internal::edit_distance::CreateUnifiedDiff().

Referenced by CmpHelperEQ(), CmpHelperEQFailure(), CmpHelperFloatingPointEQ(), CmpHelperSTRCASEEQ(), CmpHelperSTREQ(), testing::UnitTest::impl(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

1316  {
1317  Message msg;
1318  msg << " Expected: " << lhs_expression;
1319  if (lhs_value != lhs_expression) {
1320  msg << "\n Which is: " << lhs_value;
1321  }
1322  msg << "\nTo be equal to: " << rhs_expression;
1323  if (rhs_value != rhs_expression) {
1324  msg << "\n Which is: " << rhs_value;
1325  }
1326 
1327  if (ignoring_case) {
1328  msg << "\nIgnoring case";
1329  }
1330 
1331  if (!lhs_value.empty() && !rhs_value.empty()) {
1332  const std::vector<std::string> lhs_lines =
1333  SplitEscapedString(lhs_value);
1334  const std::vector<std::string> rhs_lines =
1335  SplitEscapedString(rhs_value);
1336  if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {
1337  msg << "\nWith diff:\n"
1338  << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);
1339  }
1340  }
1341 
1342  return AssertionFailure() << msg;
1343 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
GTEST_API_ std::string CreateUnifiedDiff(const std::vector< std::string > &left, const std::vector< std::string > &right, size_t context=2)
Definition: gtest.cc:1203
void testing::internal::Expect ( bool  condition,
const char *  file,
int  line,
const string msg 
)
inline
void testing::internal::Expect ( bool  condition,
const char *  file,
int  line 
)
inline

Definition at line 301 of file gmock-internal-utils.h.

References Expect().

301  {
302  Expect(condition, file, line, "Expectation failed.");
303 }
void Expect(bool condition, const char *file, int line)
template<typename MatcherTuple , typename ValueTuple >
void testing::internal::ExplainMatchFailureTupleTo ( const MatcherTuple matchers,
const ValueTuple &  values,
::std::ostream *  os 
)

Definition at line 810 of file gmock-matchers.h.

Referenced by testing::internal::TuplePrefix< 0 >::ExplainMatchFailuresTo(), testing::internal::TypedExpectation< F >::ExplainMatchResultTo(), and testing::gmock_matchers_test::TEST().

812  {
813  TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
814  matchers, values, os);
815 }
static const char *const value
Definition: Conv.cpp:50
std::vector< int > values(1'000)
GTEST_API_ ElementMatcherPairs testing::internal::FindMaxBipartiteMatching ( const MatchMatrix g)
GTEST_API_ bool testing::internal::FindPairing ( const MatchMatrix matrix,
MatchResultListener listener 
)

Definition at line 328 of file gmock-matchers.cc.

References FindMaxBipartiteMatching(), testing::MatchResultListener::IsInterested(), LogElementMatcherPairVec(), testing::internal::MatchMatrix::RhsSize(), and testing::MatchResultListener::stream().

Referenced by LogElementMatcherPairVec(), testing::internal::UnorderedElementsAreMatcherImpl< Container >::MatchAndExplain(), and testing::internal::MatchMatrix::SpaceIndex().

329  {
331 
332  size_t max_flow = matches.size();
333  bool result = (max_flow == matrix.RhsSize());
334 
335  if (!result) {
336  if (listener->IsInterested()) {
337  *listener << "where no permutation of the elements can "
338  "satisfy all matchers, and the closest match is "
339  << max_flow << " of " << matrix.RhsSize()
340  << " matchers with the pairings:\n";
341  LogElementMatcherPairVec(matches, listener->stream());
342  }
343  return false;
344  }
345 
346  if (matches.size() > 1) {
347  if (listener->IsInterested()) {
348  const char *sep = "where:\n";
349  for (size_t mi = 0; mi < matches.size(); ++mi) {
350  *listener << sep << " - element #" << matches[mi].first
351  << " is matched by matcher #" << matches[mi].second;
352  sep = ",\n";
353  }
354  }
355  }
356  return true;
357 }
::std::vector< ElementMatcherPair > ElementMatcherPairs
static void LogElementMatcherPairVec(const ElementMatcherPairs &pairs,::std::ostream *stream)
GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching(const MatchMatrix &g)
static std::string testing::internal::FlagToEnvVar ( const char *  flag)
static

Definition at line 1134 of file gtest-port.cc.

References BoolFromGTestEnv(), folly::test::end(), flag, FlagToEnvVar(), testing::internal::posix::GetEnv(), testing::Message::GetString(), GTEST_FLAG_PREFIX_, i, Int32FromGTestEnv(), ParseInt32(), string, StringFromGTestEnv(), ToUpper(), and value.

1134  {
1135  const std::string full_flag =
1136  (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
1137 
1138  Message env_var;
1139  for (size_t i = 0; i != full_flag.length(); i++) {
1140  env_var << ToUpper(full_flag.c_str()[i]);
1141  }
1142 
1143  return env_var.GetString();
1144 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
char ToUpper(char ch)
Definition: gtest-port.h:2280
static std::string testing::internal::FlagToEnvVar ( const char *  flag)
static

Definition at line 1134 of file gtest-port.cc.

References BoolFromGTestEnv(), folly::test::end(), flag, FlagToEnvVar(), testing::internal::posix::GetEnv(), testing::Message::GetString(), GTEST_FLAG_PREFIX_, i, Int32FromGTestEnv(), ParseInt32(), string, StringFromGTestEnv(), ToUpper(), and value.

1134  {
1135  const std::string full_flag =
1136  (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
1137 
1138  Message env_var;
1139  for (size_t i = 0; i != full_flag.length(); i++) {
1140  env_var << ToUpper(full_flag.c_str()[i]);
1141  }
1142 
1143  return env_var.GetString();
1144 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
char ToUpper(char ch)
Definition: gtest-port.h:2280
static std::string testing::internal::FlagToEnvVar ( const char *  flag)
static

Definition at line 1134 of file gtest-port.cc.

References flag, testing::Message::GetString(), GTEST_FLAG_PREFIX_, i, string, and ToUpper().

Referenced by BoolFromGTestEnv(), FlagToEnvVar(), Int32FromGTestEnv(), and StringFromGTestEnv().

1134  {
1135  const std::string full_flag =
1136  (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
1137 
1138  Message env_var;
1139  for (size_t i = 0; i != full_flag.length(); i++) {
1140  env_var << ToUpper(full_flag.c_str()[i]);
1141  }
1142 
1143  return env_var.GetString();
1144 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
char ToUpper(char ch)
Definition: gtest-port.h:2280
template<typename RawType >
AssertionResult testing::internal::FloatingPointLE ( const char *  expr1,
const char *  expr2,
RawType  val1,
RawType  val2 
)

Definition at line 1384 of file gtest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), folly::digits10(), folly::detail::rhs, and StringStreamToString().

1387  {
1388  // Returns success if val1 is less than val2,
1389  if (val1 < val2) {
1390  return AssertionSuccess();
1391  }
1392 
1393  // or if val1 is almost equal to val2.
1394  const FloatingPoint<RawType> lhs(val1), rhs(val2);
1395  if (lhs.AlmostEquals(rhs)) {
1396  return AssertionSuccess();
1397  }
1398 
1399  // Note that the above two checks will both fail if either val1 or
1400  // val2 is NaN, as the IEEE floating-point standard requires that
1401  // any predicate involving a NaN must return false.
1402 
1403  ::std::stringstream val1_ss;
1405  << val1;
1406 
1407  ::std::stringstream val2_ss;
1409  << val2;
1410 
1411  return AssertionFailure()
1412  << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"
1413  << " Actual: " << StringStreamToString(&val1_ss) << " vs "
1414  << StringStreamToString(&val2_ss);
1415 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
uint32_t digits10(uint64_t v)
Definition: Conv.h:295
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
Definition: gtest.cc:1982
void testing::internal::FlushInfoLog ( )
inline

Definition at line 1276 of file gtest-port.h.

1276 { fflush(NULL); }
GTEST_API_::std::string testing::internal::FormatCompilerIndependentFileLocation ( const char *  file,
int  line 
)

Definition at line 898 of file gtest-port.cc.

References StreamableToString(), and string.

Referenced by testing::internal::XmlUnitTestResultPrinter::OutputXmlTestInfo(), testing::internal::RE::PartialMatch(), PortableLocaltime(), TEST(), and testing::internal::To::To().

899  {
900  const std::string file_name(file == NULL ? kUnknownFile : file);
901 
902  if (line < 0)
903  return file_name;
904  else
905  return file_name + ":" + StreamableToString(line);
906 }
std::string StreamableToString(const T &streamable)
const char * string
Definition: Conv.cpp:212
const char kUnknownFile[]
Definition: gtest-port.cc:876
std::string testing::internal::FormatEpochTimeInMillisAsIso8601 ( TimeInMillis  ms)

Definition at line 3574 of file gtest.cc.

References testing::internal::String::FormatIntWidth2(), PortableLocaltime(), and StreamableToString().

Referenced by operator<<(), testing::internal::XmlUnitTestResultPrinter::OutputXmlTestInfo(), PortableLocaltime(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

3574  {
3575  struct tm time_struct;
3576  if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
3577  return "";
3578  // YYYY-MM-DDThh:mm:ss
3579  return StreamableToString(time_struct.tm_year + 1900) + "-" +
3580  String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
3581  String::FormatIntWidth2(time_struct.tm_mday) + "T" +
3582  String::FormatIntWidth2(time_struct.tm_hour) + ":" +
3583  String::FormatIntWidth2(time_struct.tm_min) + ":" +
3584  String::FormatIntWidth2(time_struct.tm_sec);
3585 }
std::string StreamableToString(const T &streamable)
static bool PortableLocaltime(time_t seconds, struct tm *out)
Definition: gtest.cc:3556
GTEST_API_::std::string testing::internal::FormatFileLocation ( const char *  file,
int  line 
)
template<typename T1 , typename T2 >
std::string testing::internal::FormatForComparisonFailureMessage ( const T1 value,
const T2  
)
GTEST_API_ string testing::internal::FormatMatcherDescription ( bool  negation,
const char *  matcher_name,
const Strings param_values 
)

Definition at line 127 of file gmock-matchers.cc.

References ConvertIdentifierNameToWords(), and JoinAsTuple().

Referenced by testing::internal::BoundSecondMatcher< Tuple2Matcher, Second >::Impl< T >::MatchAndExplain(), MatcherBindSecond(), and testing::gmock_matchers_test::TEST().

129  {
130  string result = ConvertIdentifierNameToWords(matcher_name);
131  if (param_values.size() >= 1)
132  result += " " + JoinAsTuple(param_values);
133  return negation ? "not (" + result + ")" : result;
134 }
GTEST_API_ string ConvertIdentifierNameToWords(const char *id_name)
GTEST_API_ string JoinAsTuple(const Strings &fields)
std::string testing::internal::FormatTimeInMillisAsSeconds ( TimeInMillis  ms)

Definition at line 3550 of file gtest.cc.

Referenced by testing::internal::XmlUnitTestResultPrinter::EscapeXmlText(), operator<<(), testing::internal::XmlUnitTestResultPrinter::OutputXmlTestInfo(), PortableLocaltime(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

3550  {
3551  ::std::stringstream ss;
3552  ss << (static_cast<double>(ms) * 1e-3);
3553  return ss.str();
3554 }
const char * testing::internal::GetAnsiColorCode ( GTestColor  color)

Definition at line 2904 of file gtest.cc.

References COLOR_GREEN, COLOR_RED, and COLOR_YELLOW.

Referenced by ColoredPrintf().

2904  {
2905  switch (color) {
2906  case COLOR_RED: return "1";
2907  case COLOR_GREEN: return "2";
2908  case COLOR_YELLOW: return "3";
2909  default: return NULL;
2910  };
2911 }
const ::std::vector< testing::internal::string > & testing::internal::GetArgvs ( )

Definition at line 389 of file gtest.cc.

References g_argvs.

Referenced by CheckedDowncastToActualType(), GetCurrentExecutableName(), GTestIsInitialized(), ReadEntireFile(), and ShouldRunTestCase().

389  {
390 #if defined(GTEST_CUSTOM_GET_ARGVS_)
391  return GTEST_CUSTOM_GET_ARGVS_();
392 #else // defined(GTEST_CUSTOM_GET_ARGVS_)
393  return g_argvs;
394 #endif // defined(GTEST_CUSTOM_GET_ARGVS_)
395 }
::std::vector< testing::internal::string > g_argvs
Definition: gtest.cc:387
std::string testing::internal::GetBoolAssertionFailureMessage ( const AssertionResult assertion_result,
const char *  expression_text,
const char *  actual_predicate_value,
const char *  expected_predicate_value 
)

Definition at line 1346 of file gtest.cc.

References testing::Message::GetString(), and testing::AssertionResult::message().

1350  {
1351  const char* actual_message = assertion_result.message();
1352  Message msg;
1353  msg << "Value of: " << expression_text
1354  << "\n Actual: " << actual_predicate_value;
1355  if (actual_message[0] != '\0')
1356  msg << " (" << actual_message << ")";
1357  msg << "\nExpected: " << expected_predicate_value;
1358  return msg.GetString();
1359 }
FilePath testing::internal::GetCurrentExecutableName ( )

Definition at line 399 of file gtest.cc.

References GetArgvs(), testing::internal::FilePath::RemoveDirectoryName(), and testing::internal::FilePath::Set().

Referenced by testing::internal::UnitTestOptions::GetAbsolutePathToOutputFile(), testing::internal::TestPropertyKeyIs::operator()(), ShouldRunTestCase(), and testing::TEST_F().

399  {
400  FilePath result;
401 
402 #if GTEST_OS_WINDOWS
403  result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
404 #else
405  result.Set(FilePath(GetArgvs()[0]));
406 #endif // GTEST_OS_WINDOWS
407 
408  return result.RemoveDirectoryName();
409 }
const ::std::vector< testing::internal::string > & GetArgvs()
Definition: gtest.cc:389
std::string testing::internal::GetCurrentOsStackTraceExceptTop ( UnitTest unit_test,
int  skip_count 
)

Definition at line 4973 of file gtest.cc.

References testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop(), and GetUnitTestImpl().

Referenced by testing::internal::CodeLocation::CodeLocation(), Log(), PrintOnOneLine(), testing::internal::GoogleTestFailureReporter::ReportFailure(), TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

4974  {
4975  // We pass skip_count + 1 to skip this wrapper function in addition
4976  // to what the user really wants to skip.
4977  return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);
4978 }
class UnitTestImpl * GetUnitTestImpl()
std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_
Definition: gtest.cc:796
template<typename E >
E testing::internal::GetElementOr ( const std::vector< E > &  v,
int  i,
default_value 
)
inline
GTEST_API_ FailureReporterInterface * testing::internal::GetFailureReporter ( )

Definition at line 94 of file gmock-internal-utils.cc.

References GTEST_DEFINE_STATIC_MUTEX_().

Referenced by testing::internal::GoogleTestFailureReporter::ReportFailure().

94  {
95  // Points to the global failure reporter used by Google Mock. gcc
96  // guarantees that the following use of failure_reporter is
97  // thread-safe. We may need to add additional synchronization to
98  // protect failure_reporter if we port Google Mock to other
99  // compilers.
100  static FailureReporterInterface* const failure_reporter =
101  new GoogleTestFailureReporter();
102  return failure_reporter;
103 }
size_t testing::internal::GetFileSize ( FILE file)

Definition at line 1076 of file gtest-port.cc.

Referenced by CheckedDowncastToActualType(), and ReadEntireFile().

1076  {
1077  fseek(file, 0, SEEK_END);
1078  return static_cast<size_t>(ftell(file));
1079 }
int testing::internal::GetNextRandomSeed ( int  seed)
inline

Definition at line 152 of file gtest-internal-inl.h.

References GTEST_CHECK_.

Referenced by operator<<(), testing::internal::UnitTestImpl::RunAllTests(), TearDownEnvironment(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

152  {
154  << "Invalid random seed " << seed << " - must be in [1, "
155  << kMaxRandomSeed << "].";
156  const int next_seed = seed + 1;
157  return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
158 }
static const int seed
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
int testing::internal::GetRandomSeedFromFlag ( Int32  random_seed_flag)
inline

Definition at line 136 of file gtest-internal-inl.h.

References GetTimeInMillis().

Referenced by operator<<(), testing::internal::UnitTestImpl::RunAllTests(), TearDownEnvironment(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

136  {
137  const unsigned int raw_seed = (random_seed_flag == 0) ?
138  static_cast<unsigned int>(GetTimeInMillis()) :
139  static_cast<unsigned int>(random_seed_flag);
140 
141  // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
142  // it's easy to type.
143  const int normalized_seed =
144  static_cast<int>((raw_seed - 1U) %
145  static_cast<unsigned int>(kMaxRandomSeed)) + 1;
146  return normalized_seed;
147 }
GTEST_API_ TimeInMillis GetTimeInMillis()
Definition: gtest.cc:806
template<typename Pointer >
const Pointer::element_type * testing::internal::GetRawPointer ( const Pointer &  p)
inline
template<typename Element >
Element * testing::internal::GetRawPointer ( Element *  p)
inline

Definition at line 81 of file gmock-internal-utils.h.

81 { return p; }
TimeInMillis testing::internal::GetTimeInMillis ( )

Definition at line 806 of file gtest.cc.

References folly::pushmi::operators::error(), GTEST_DISABLE_MSC_WARNINGS_POP_, GTEST_DISABLE_MSC_WARNINGS_PUSH_, GTEST_HAS_GETTIMEOFDAY_, and now().

Referenced by GetRandomSeedFromFlag(), testing::TestInfo::Run(), testing::TestCase::Run(), testing::internal::UnitTestImpl::RunAllTests(), ShouldRunTestCase(), TearDownEnvironment(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

806  {
807 #if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)
808  // Difference between 1970-01-01 and 1601-01-01 in milliseconds.
809  // http://analogous.blogspot.com/2005/04/epoch.html
810  const TimeInMillis kJavaEpochToWinFileTimeDelta =
811  static_cast<TimeInMillis>(116444736UL) * 100000UL;
812  const DWORD kTenthMicrosInMilliSecond = 10000;
813 
814  SYSTEMTIME now_systime;
815  FILETIME now_filetime;
816  ULARGE_INTEGER now_int64;
817  // TODO(kenton@google.com): Shouldn't this just use
818  // GetSystemTimeAsFileTime()?
819  GetSystemTime(&now_systime);
820  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
821  now_int64.LowPart = now_filetime.dwLowDateTime;
822  now_int64.HighPart = now_filetime.dwHighDateTime;
823  now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -
824  kJavaEpochToWinFileTimeDelta;
825  return now_int64.QuadPart;
826  }
827  return 0;
828 #elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
829  __timeb64 now;
830 
831  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
832  // (deprecated function) there.
833  // TODO(kenton@google.com): Use GetTickCount()? Or use
834  // SystemTimeToFileTime()
836  _ftime64(&now);
838 
839  return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
840 #elif GTEST_HAS_GETTIMEOFDAY_
841  struct timeval now;
842  gettimeofday(&now, NULL);
843  return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;
844 #else
845 # error "Don't know how to get the current time on your system."
846 #endif
847 }
std::chrono::steady_clock::time_point now()
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
Definition: gtest-port.h:317
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
internal::TimeInMillis TimeInMillis
Definition: gtest.h:480
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition: gtest-port.h:318
std::chrono::nanoseconds time()
template<typename T >
TypeId testing::internal::GetTypeId ( )

Definition at line 447 of file gtest-internal.h.

References GetTestTypeId(), and GTEST_API_.

Referenced by testing::internal::FloatingPoint< RawType >::Max(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

447  {
448  // The compiler is required to allocate a different
449  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
450  // the template. Therefore, the address of dummy_ is guaranteed to
451  // be unique.
452  return &(TypeIdHelper<T>::dummy_);
453 }
template<typename T >
std::string testing::internal::GetTypeName ( )

Definition at line 64 of file gtest-type-util.h.

References bm::free(), name, string, T, and type.

64  {
65 # if GTEST_HAS_RTTI
66 
67  const char* const name = typeid(T).name();
68 # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
69  int status = 0;
70  // gcc's implementation of typeid(T).name() mangles the type name,
71  // so we have to demangle it.
72 # if GTEST_HAS_CXXABI_H_
73  using abi::__cxa_demangle;
74 # endif // GTEST_HAS_CXXABI_H_
75  char* const readable_name = __cxa_demangle(name, 0, 0, &status);
76  const std::string name_str(status == 0 ? readable_name : name);
77  free(readable_name);
78  return name_str;
79 # else
80  return name;
81 # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
82 
83 # else
84 
85  return "<type>";
86 
87 # endif // GTEST_HAS_RTTI
88 }
#define T(v)
Definition: http_parser.c:233
const char * name
Definition: http_parser.c:437
void free()
const char * string
Definition: Conv.cpp:212
GTEST_API_ testing::internal::GTEST_DECLARE_STATIC_MUTEX_ ( g_linked_ptr_mutex  )
GTEST_API_ testing::internal::GTEST_DECLARE_STATIC_MUTEX_ ( g_gmock_mutex  )
testing::internal::GTEST_DECLARE_string_ ( internal_run_death_test  )
GTEST_API_ testing::internal::GTEST_DEFINE_STATIC_MUTEX_ ( g_gmock_mutex  )
static testing::internal::GTEST_DEFINE_STATIC_MUTEX_ ( g_log_mutex  )
static
static testing::internal::GTEST_DEFINE_STATIC_MUTEX_ ( g_log_mutex  )
static
static testing::internal::GTEST_DEFINE_STATIC_MUTEX_ ( g_log_mutex  )
static
GTEST_API_ testing::internal::GTEST_DEFINE_STATIC_MUTEX_ ( g_linked_ptr_mutex  )
testing::internal::GTEST_DEFINE_string_ ( internal_run_death_test  ,
""  ,
"Indicates the  file,
line  number,
temporal index of""the single death test to  run,
and a file descriptor to""which a success code may be  sent,
all separated by""the '|'characters.This flag is specified if and only if the current""process is a sub-process launched for running a thread-safe""death test.FOR INTERNAL USE ONLY."   
)
static bool testing::internal::GTestIsInitialized ( )
static

Definition at line 330 of file gtest.cc.

References GetArgvs().

330 { return GetArgvs().size() > 0; }
const ::std::vector< testing::internal::string > & GetArgvs()
Definition: gtest.cc:389
static bool testing::internal::GTestIsInitialized ( )
static

Definition at line 330 of file gtest.cc.

References GetArgvs().

330 { return GetArgvs().size() > 0; }
const ::std::vector< testing::internal::string > & GetArgvs()
Definition: gtest.cc:389
static bool testing::internal::GTestIsInitialized ( )
static

Definition at line 330 of file gtest.cc.

References GetArgvs().

Referenced by InitGoogleTestImpl(), testing::internal::UnitTestImpl::RunAllTests(), and TearDownEnvironment().

330 { return GetArgvs().size() > 0; }
const ::std::vector< testing::internal::string > & GetArgvs()
Definition: gtest.cc:389
template<class T , typename Result >
Result testing::internal::HandleExceptionsInMethodIfSupported ( T object,
Result(T::*)()  method,
const char *  location 
)

Definition at line 2410 of file gtest.cc.

References GetUnitTestImpl(), HandleSehExceptionsInMethodIfSupported(), testing::TestPartResult::kFatalFailure, and ReportFailureInUnknownLocation().

Referenced by testing::Test::Run(), testing::TestInfo::Run(), testing::TestCase::Run(), testing::UnitTest::Run(), testing::TestPartNonfatallyFailed(), and testing::internal::ScopedPrematureExitFile::~ScopedPrematureExitFile().

2411  {
2412  // NOTE: The user code can affect the way in which Google Test handles
2413  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
2414  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
2415  // after the exception is caught and either report or re-throw the
2416  // exception based on the flag's value:
2417  //
2418  // try {
2419  // // Perform the test method.
2420  // } catch (...) {
2421  // if (GTEST_FLAG(catch_exceptions))
2422  // // Report the exception as failure.
2423  // else
2424  // throw; // Re-throws the original exception.
2425  // }
2426  //
2427  // However, the purpose of this flag is to allow the program to drop into
2428  // the debugger when the exception is thrown. On most platforms, once the
2429  // control enters the catch block, the exception origin information is
2430  // lost and the debugger will stop the program at the point of the
2431  // re-throw in this function -- instead of at the point of the original
2432  // throw statement in the code under test. For this reason, we perform
2433  // the check early, sacrificing the ability to affect Google Test's
2434  // exception handling in the method where the exception is thrown.
2435  if (internal::GetUnitTestImpl()->catch_exceptions()) {
2436 #if GTEST_HAS_EXCEPTIONS
2437  try {
2438  return HandleSehExceptionsInMethodIfSupported(object, method, location);
2439  } catch (const internal::GoogleTestFailureException&) { // NOLINT
2440  // This exception type can only be thrown by a failed Google
2441  // Test assertion with the intention of letting another testing
2442  // framework catch it. Therefore we just re-throw it.
2443  throw;
2444  } catch (const std::exception& e) { // NOLINT
2446  TestPartResult::kFatalFailure,
2447  FormatCxxExceptionMessage(e.what(), location));
2448  } catch (...) { // NOLINT
2450  TestPartResult::kFatalFailure,
2451  FormatCxxExceptionMessage(NULL, location));
2452  }
2453  return static_cast<Result>(0);
2454 #else
2455  return HandleSehExceptionsInMethodIfSupported(object, method, location);
2456 #endif // GTEST_HAS_EXCEPTIONS
2457  } else {
2458  return (object->*method)();
2459  }
2460 }
class UnitTestImpl * GetUnitTestImpl()
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
Definition: gtest.cc:2250
void * object
Definition: AtFork.cpp:32
Result HandleSehExceptionsInMethodIfSupported(T *object, Result(T::*method)(), const char *location)
Definition: gtest.cc:2383
template<class T , typename Result >
Result testing::internal::HandleSehExceptionsInMethodIfSupported ( T object,
Result(T::*)()  method,
const char *  location 
)

Definition at line 2383 of file gtest.cc.

References testing::TestPartResult::kFatalFailure, ReportFailureInUnknownLocation(), and string.

Referenced by HandleExceptionsInMethodIfSupported(), and testing::TestPartNonfatallyFailed().

2384  {
2385 #if GTEST_HAS_SEH
2386  __try {
2387  return (object->*method)();
2388  } __except (internal::UnitTestOptions::GTestShouldProcessSEH( // NOLINT
2389  GetExceptionCode())) {
2390  // We create the exception message on the heap because VC++ prohibits
2391  // creation of objects with destructors on stack in functions using __try
2392  // (see error C2712).
2393  std::string* exception_message = FormatSehExceptionMessage(
2394  GetExceptionCode(), location);
2395  internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
2396  *exception_message);
2397  delete exception_message;
2398  return static_cast<Result>(0);
2399  }
2400 #else
2401  (void)location;
2402  return (object->*method)();
2403 #endif // GTEST_HAS_SEH
2404 }
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
Definition: gtest.cc:2250
void * object
Definition: AtFork.cpp:32
const char * string
Definition: Conv.cpp:212
static bool testing::internal::HasGoogleTestFlagPrefix ( const char *  str)
static

Definition at line 5105 of file gtest.cc.

References GTEST_FLAG_PREFIX_, GTEST_FLAG_PREFIX_DASH_, and SkipPrefix().

5105  {
5106  return (SkipPrefix("--", &str) ||
5107  SkipPrefix("-", &str) ||
5108  SkipPrefix("/", &str)) &&
5109  !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
5110  (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
5112 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
#define GTEST_FLAG_PREFIX_DASH_
Definition: gtest-port.h:287
GTEST_API_ bool SkipPrefix(const char *prefix, const char **pstr)
Definition: gtest.cc:5001
static bool testing::internal::HasGoogleTestFlagPrefix ( const char *  str)
static

Definition at line 5105 of file gtest.cc.

References GTEST_FLAG_PREFIX_, GTEST_FLAG_PREFIX_DASH_, and SkipPrefix().

5105  {
5106  return (SkipPrefix("--", &str) ||
5107  SkipPrefix("-", &str) ||
5108  SkipPrefix("/", &str)) &&
5109  !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
5110  (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
5112 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
#define GTEST_FLAG_PREFIX_DASH_
Definition: gtest-port.h:287
GTEST_API_ bool SkipPrefix(const char *prefix, const char **pstr)
Definition: gtest.cc:5001
static bool testing::internal::HasGoogleTestFlagPrefix ( const char *  str)
static

Definition at line 5105 of file gtest.cc.

References GTEST_FLAG_PREFIX_, GTEST_FLAG_PREFIX_DASH_, and SkipPrefix().

Referenced by ParseGoogleTestFlagsOnlyImpl().

5105  {
5106  return (SkipPrefix("--", &str) ||
5107  SkipPrefix("-", &str) ||
5108  SkipPrefix("/", &str)) &&
5109  !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
5110  (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
5112 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
#define GTEST_FLAG_PREFIX_DASH_
Definition: gtest-port.h:287
GTEST_API_ bool SkipPrefix(const char *prefix, const char **pstr)
Definition: gtest.cc:5001
AssertionResult testing::internal::HasOneFailure ( const char *  ,
const char *  ,
const char *  ,
const TestPartResultArray results,
TestPartResult::Type  type,
const string substr 
)

Definition at line 631 of file gtest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), testing::TestPartResultArray::GetTestPartResult(), i, testing::TestPartResult::kFatalFailure, testing::TestPartResult::message(), testing::TestPartResultArray::size(), string, testing::TestPartResult::type(), and type.

Referenced by ShouldRunTestCase(), and testing::internal::SingleFailureChecker::~SingleFailureChecker().

636  {
637  const std::string expected(type == TestPartResult::kFatalFailure ?
638  "1 fatal failure" :
639  "1 non-fatal failure");
640  Message msg;
641  if (results.size() != 1) {
642  msg << "Expected: " << expected << "\n"
643  << " Actual: " << results.size() << " failures";
644  for (int i = 0; i < results.size(); i++) {
645  msg << "\n" << results.GetTestPartResult(i);
646  }
647  return AssertionFailure() << msg;
648  }
649 
650  const TestPartResult& r = results.GetTestPartResult(0);
651  if (r.type() != type) {
652  return AssertionFailure() << "Expected: " << expected << "\n"
653  << " Actual:\n"
654  << r;
655  }
656 
657  if (strstr(r.message(), substr.c_str()) == NULL) {
658  return AssertionFailure() << "Expected: " << expected << " containing \""
659  << substr << "\"\n"
660  << " Actual:\n"
661  << r;
662  }
663 
664  return AssertionSuccess();
665 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
PskType type
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
const char * string
Definition: Conv.cpp:212
template<typename To >
To testing::internal::ImplicitCast_ ( To  x)
inline

Definition at line 1343 of file gtest-port.h.

References x.

Referenced by foo::StreamableTemplateInFoo< T >::value().

1343 { return x; }
const int x
template<typename CharType >
void testing::internal::InitGoogleMockImpl ( int *  argc,
CharType **  argv 
)

Definition at line 128 of file gmock.cc.

References GMOCK_FLAG, i, testing::InitGoogleTest(), ParseGoogleMockBoolFlag(), ParseGoogleMockStringFlag(), StreamableToString(), and string.

Referenced by testing::InitGoogleMock(), and ParseGoogleMockStringFlag().

128  {
129  // Makes sure Google Test is initialized. InitGoogleTest() is
130  // idempotent, so it's fine if the user has already called it.
131  InitGoogleTest(argc, argv);
132  if (*argc <= 0) return;
133 
134  for (int i = 1; i != *argc; i++) {
135  const std::string arg_string = StreamableToString(argv[i]);
136  const char* const arg = arg_string.c_str();
137 
138  // Do we see a Google Mock flag?
139  if (ParseGoogleMockBoolFlag(arg, "catch_leaked_mocks",
140  &GMOCK_FLAG(catch_leaked_mocks)) ||
141  ParseGoogleMockStringFlag(arg, "verbose", &GMOCK_FLAG(verbose))) {
142  // Yes. Shift the remainder of the argv list left by one. Note
143  // that argv has (*argc + 1) elements, the last one always being
144  // NULL. The following loop moves the trailing NULL element as
145  // well.
146  for (int j = i; j != *argc; j++) {
147  argv[j] = argv[j + 1];
148  }
149 
150  // Decrements the argument count.
151  (*argc)--;
152 
153  // We also need to decrement the iterator as we just removed
154  // an element.
155  i--;
156  }
157  }
158 }
std::string StreamableToString(const T &streamable)
char ** argv
static bool ParseGoogleMockBoolFlag(const char *str, const char *flag, bool *value)
Definition: gmock.cc:91
#define GMOCK_FLAG(name)
Definition: gmock-port.h:70
const char * string
Definition: Conv.cpp:212
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: gtest.cc:5370
static bool ParseGoogleMockStringFlag(const char *str, const char *flag, String *value)
Definition: gmock.cc:110
template<typename CharType >
void testing::internal::InitGoogleTestImpl ( int *  argc,
CharType **  argv 
)

Definition at line 5344 of file gtest.cc.

References g_argvs, GetUnitTestImpl(), GTestIsInitialized(), i, ParseGoogleTestFlagsOnly(), testing::internal::UnitTestImpl::PostFlagParsingInit(), and StreamableToString().

Referenced by testing::InitGoogleTest().

5344  {
5345  // We don't want to run the initialization code twice.
5346  if (GTestIsInitialized()) return;
5347 
5348  if (*argc <= 0) return;
5349 
5350  g_argvs.clear();
5351  for (int i = 0; i != *argc; i++) {
5352  g_argvs.push_back(StreamableToString(argv[i]));
5353  }
5354 
5357 }
class UnitTestImpl * GetUnitTestImpl()
::std::vector< testing::internal::string > g_argvs
Definition: gtest.cc:387
std::string StreamableToString(const T &streamable)
char ** argv
static bool GTestIsInitialized()
Definition: gtest.cc:330
GTEST_API_ void ParseGoogleTestFlagsOnly(int *argc, char **argv)
Definition: gtest.cc:5332
Int32 testing::internal::Int32FromEnvOrDie ( const char *  env_var,
Int32  default_val 
)

Definition at line 4760 of file gtest.cc.

References testing::internal::posix::GetEnv(), and ParseInt32().

Referenced by testing::internal::UnitTestImpl::FilterTests(), testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart(), testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd(), ShouldShard(), TearDownEnvironment(), testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

4760  {
4761  const char* str_val = posix::GetEnv(var);
4762  if (str_val == NULL) {
4763  return default_val;
4764  }
4765 
4766  Int32 result;
4767  if (!ParseInt32(Message() << "The value of environment variable " << var,
4768  str_val, &result)) {
4769  exit(EXIT_FAILURE);
4770  }
4771  return result;
4772 }
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2494
bool ParseInt32(const Message &src_text, const char *str, Int32 *value)
Definition: gtest-port.cc:1149
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
Int32 testing::internal::Int32FromGTestEnv ( const char *  flag,
Int32  default_val 
)

Definition at line 1204 of file gtest-port.cc.

References FlagToEnvVar(), testing::internal::posix::GetEnv(), ParseInt32(), and string.

Referenced by FlagToEnvVar(), and testing::GetDefaultFilter().

1204  {
1205 #if defined(GTEST_GET_INT32_FROM_ENV_)
1206  return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
1207 #endif // defined(GTEST_GET_INT32_FROM_ENV_)
1208  const std::string env_var = FlagToEnvVar(flag);
1209  const char* const string_value = posix::GetEnv(env_var.c_str());
1210  if (string_value == NULL) {
1211  // The environment variable is not set.
1212  return default_value;
1213  }
1214 
1215  Int32 result = default_value;
1216  if (!ParseInt32(Message() << "Environment variable " << env_var,
1217  string_value, &result)) {
1218  printf("The default value %s is used.\n",
1219  (Message() << default_value).GetString().c_str());
1220  fflush(stdout);
1221  return default_value;
1222  }
1223 
1224  return result;
1225 }
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2494
bool ParseInt32(const Message &src_text, const char *str, Int32 *value)
Definition: gtest-port.cc:1149
static once_flag flag
Definition: Random.cpp:75
static std::string FlagToEnvVar(const char *flag)
Definition: gtest-port.cc:1134
const char * string
Definition: Conv.cpp:212
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
template<typename T >
T testing::internal::Invalid ( )
inline

Definition at line 377 of file gmock-internal-utils.h.

References Assert().

Referenced by wangle::EvbHandshakeHelper::start().

377  {
378  Assert(false, "", -1, "Internal error: attempt to return invalid value");
379  // This statement is unreachable, and would never terminate even if it
380  // could be reached. It is provided only to placate compiler warnings
381  // about missing return statements.
382  return Invalid<T>();
383 }
void Assert(bool condition, const char *file, int line)
bool testing::internal::IsAlNum ( char  ch)
inline

Definition at line 2254 of file gtest-port.h.

Referenced by ConvertIdentifierNameToWords().

2254  {
2255  return isalnum(static_cast<unsigned char>(ch)) != 0;
2256 }
auto ch
bool testing::internal::IsAlpha ( char  ch)
inline

Definition at line 2251 of file gtest-port.h.

Referenced by ConvertIdentifierNameToWords().

2251  {
2252  return isalpha(static_cast<unsigned char>(ch)) != 0;
2253 }
auto ch
template<class C >
IsContainer testing::internal::IsContainerTest ( int  ,
typename C::iterator *  = NULL,
typename C::const_iterator *  = NULL 
)

Definition at line 932 of file gtest-internal.h.

Referenced by TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

934  {
935  return 0;
936 }
template<class C >
IsNotContainer testing::internal::IsContainerTest ( long  )

Definition at line 940 of file gtest-internal.h.

940 { return '\0'; }
bool testing::internal::IsDigit ( char  ch)
inline

Definition at line 2257 of file gtest-port.h.

Referenced by ConvertIdentifierNameToWords(), GetUnitTestImpl(), and testing::internal::UnitTestImpl::set_catch_exceptions().

2257  {
2258  return isdigit(static_cast<unsigned char>(ch)) != 0;
2259 }
auto ch
bool testing::internal::IsLower ( char  ch)
inline

Definition at line 2260 of file gtest-port.h.

Referenced by ConvertIdentifierNameToWords().

2260  {
2261  return islower(static_cast<unsigned char>(ch)) != 0;
2262 }
auto ch
char testing::internal::IsNullLiteralHelper ( Secret *  p)
char(& testing::internal::IsNullLiteralHelper (   ...) )[2]
static bool testing::internal::IsPathSeparator ( char  c)
static

Definition at line 90 of file gtest-filepath.cc.

References testing::internal::FilePath::c_str(), testing::internal::FilePath::ConcatPaths(), testing::internal::FilePath::CreateDirectoriesRecursively(), testing::internal::FilePath::CreateFolder(), upload::dest, testing::internal::FilePath::DirectoryExists(), testing::internal::String::EndsWithCaseInsensitive(), testing::internal::FilePath::FileOrDirectoryExists(), testing::internal::FilePath::FilePath(), testing::internal::FilePath::FindLastPathSeparator(), testing::internal::FilePath::GenerateUniqueFileName(), testing::internal::FilePath::GetCurrentDir(), GTEST_PATH_MAX_, testing::internal::FilePath::IsAbsolutePath(), testing::internal::posix::IsDir(), testing::internal::FilePath::IsDirectory(), testing::internal::FilePath::IsEmpty(), IsPathSeparator(), testing::internal::FilePath::IsRootDirectory(), kCurrentDirectoryString, kPathSeparator, testing::internal::FilePath::MakeFileName(), name, testing::internal::FilePath::Normalize(), number, parent, testing::internal::FilePath::pathname_, testing::internal::FilePath::RemoveDirectoryName(), testing::internal::FilePath::RemoveExtension(), testing::internal::FilePath::RemoveFileName(), testing::internal::FilePath::RemoveTrailingPathSeparator(), testing::internal::FilePath::Set(), testing::internal::posix::Stat(), StreamableToString(), testing::internal::FilePath::string(), and string.

90  {
91 #if GTEST_HAS_ALT_PATH_SEP_
92  return (c == kPathSeparator) || (c == kAlternatePathSeparator);
93 #else
94  return c == kPathSeparator;
95 #endif
96 }
char c
const char kPathSeparator
static bool testing::internal::IsPathSeparator ( char  c)
static

Definition at line 90 of file gtest-filepath.cc.

References kPathSeparator.

Referenced by testing::internal::FilePath::IsAbsolutePath(), testing::internal::FilePath::IsDirectory(), IsPathSeparator(), testing::internal::FilePath::IsRootDirectory(), and testing::internal::FilePath::Normalize().

90  {
91 #if GTEST_HAS_ALT_PATH_SEP_
92  return (c == kPathSeparator) || (c == kAlternatePathSeparator);
93 #else
94  return c == kPathSeparator;
95 #endif
96 }
char c
const char kPathSeparator
static bool testing::internal::IsPathSeparator ( char  c)
static

Definition at line 90 of file gtest-filepath.cc.

References testing::internal::FilePath::c_str(), testing::internal::FilePath::ConcatPaths(), testing::internal::FilePath::CreateDirectoriesRecursively(), testing::internal::FilePath::CreateFolder(), upload::dest, testing::internal::FilePath::DirectoryExists(), testing::internal::String::EndsWithCaseInsensitive(), testing::internal::FilePath::FileOrDirectoryExists(), testing::internal::FilePath::FilePath(), testing::internal::FilePath::FindLastPathSeparator(), testing::internal::FilePath::GenerateUniqueFileName(), testing::internal::FilePath::GetCurrentDir(), GTEST_PATH_MAX_, testing::internal::FilePath::IsAbsolutePath(), testing::internal::posix::IsDir(), testing::internal::FilePath::IsDirectory(), testing::internal::FilePath::IsEmpty(), IsPathSeparator(), testing::internal::FilePath::IsRootDirectory(), kCurrentDirectoryString, kPathSeparator, testing::internal::FilePath::MakeFileName(), name, testing::internal::FilePath::Normalize(), number, parent, testing::internal::FilePath::pathname_, testing::internal::FilePath::RemoveDirectoryName(), testing::internal::FilePath::RemoveExtension(), testing::internal::FilePath::RemoveFileName(), testing::internal::FilePath::RemoveTrailingPathSeparator(), testing::internal::FilePath::Set(), testing::internal::posix::Stat(), StreamableToString(), testing::internal::FilePath::string(), and string.

90  {
91 #if GTEST_HAS_ALT_PATH_SEP_
92  return (c == kPathSeparator) || (c == kAlternatePathSeparator);
93 #else
94  return c == kPathSeparator;
95 #endif
96 }
char c
const char kPathSeparator
bool testing::internal::IsPrintableAscii ( wchar_t  c)
inline

Definition at line 137 of file gtest-printers.cc.

Referenced by PrintAsCharLiteralTo().

137  {
138  return 0x20 <= c && c <= 0x7E;
139 }
char c
bool testing::internal::IsReadableTypeName ( const string type_name)
inline

Definition at line 688 of file gmock-matchers.h.

Referenced by testing::SafeMatcherCastImpl< T >::Cast(), MatchPrintAndExplain(), and testing::gmock_matchers_test::TEST().

688  {
689  // We consider a type name readable if it's short or doesn't contain
690  // a template or function type.
691  return (type_name.length() <= 20 ||
692  type_name.find_first_of("<(") == string::npos);
693 }
bool testing::internal::IsSpace ( char  ch)
inline

Definition at line 2263 of file gtest-port.h.

Referenced by testing::internal::CodeLocation::CodeLocation(), testing::IsNotSubstring(), and StripTrailingSpaces().

2263  {
2264  return isspace(static_cast<unsigned char>(ch)) != 0;
2265 }
auto ch
bool testing::internal::IsTrue ( bool  condition)

Definition at line 4986 of file gtest.cc.

Referenced by AlwaysTrue(), DefaultPrintTo(), PrintOnOneLine(), and testing::internal::scoped_ptr< const ::std::string >::reset().

4986 { return condition; }
bool testing::internal::IsUpper ( char  ch)
inline

Definition at line 2266 of file gtest-port.h.

Referenced by ConvertIdentifierNameToWords().

2266  {
2267  return isupper(static_cast<unsigned char>(ch)) != 0;
2268 }
auto ch
bool testing::internal::IsUtf16SurrogatePair ( wchar_t  first,
wchar_t  second 
)
inline

Definition at line 1794 of file gtest.cc.

Referenced by WideStringToUtf8().

1794  {
1795  return sizeof(wchar_t) == 2 &&
1796  (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
1797 }
constexpr detail::First first
Definition: Base-inl.h:2553
bool testing::internal::IsXDigit ( char  ch)
inline

Definition at line 2269 of file gtest-port.h.

Referenced by PrintCharsAsStringTo(), and TEST().

2269  {
2270  return isxdigit(static_cast<unsigned char>(ch)) != 0;
2271 }
auto ch
bool testing::internal::IsXDigit ( wchar_t  ch)
inline

Definition at line 2272 of file gtest-port.h.

References ch.

2272  {
2273  const unsigned char low_byte = static_cast<unsigned char>(ch);
2274  return ch == low_byte && isxdigit(low_byte) != 0;
2275 }
auto ch
GTEST_API_ string testing::internal::JoinAsTuple ( const Strings fields)

Definition at line 105 of file gmock-matchers.cc.

References i.

Referenced by FormatMatcherDescription(), and testing::gmock_matchers_test::TEST().

105  {
106  switch (fields.size()) {
107  case 0:
108  return "";
109  case 1:
110  return fields[0];
111  default:
112  string result = "(" + fields[0];
113  for (size_t i = 1; i < fields.size(); i++) {
114  result += ", ";
115  result += fields[i];
116  }
117  result += ")";
118  return result;
119  }
120 }
GTEST_API_ void testing::internal::Log ( LogSeverity  severity,
const string message,
int  stack_frames_to_skip 
)

Definition at line 131 of file gmock-internal-utils.cc.

References GetCurrentOsStackTraceExceptTop(), testing::UnitTest::GetInstance(), kWarning, LogIsVisible(), and message.

Referenced by testing::internal::ExpectationBase::CheckActionCountIfNotDone(), testing::internal::TypedExpectation< F >::GetCurrentAction(), LogWithLocation(), testing::internal::GoogleTestFailureReporter::ReportFailure(), ReportUninterestingCall(), and testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith().

133  {
134  if (!LogIsVisible(severity))
135  return;
136 
137  // Ensures that logs from different threads don't interleave.
138  MutexLock l(&g_log_mutex);
139 
140  // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a
141  // macro.
142 
143  if (severity == kWarning) {
144  // Prints a GMOCK WARNING marker to make the warnings easily searchable.
145  std::cout << "\nGMOCK WARNING:";
146  }
147  // Pre-pends a new-line to message if it doesn't start with one.
148  if (message.empty() || message[0] != '\n') {
149  std::cout << "\n";
150  }
151  std::cout << message;
152  if (stack_frames_to_skip >= 0) {
153 #ifdef NDEBUG
154  // In opt mode, we have to be conservative and skip no stack frame.
155  const int actual_to_skip = 0;
156 #else
157  // In dbg mode, we can do what the caller tell us to do (plus one
158  // for skipping this function's stack frame).
159  const int actual_to_skip = stack_frames_to_skip + 1;
160 #endif // NDEBUG
161 
162  // Appends a new-line to message if it doesn't end with one.
163  if (!message.empty() && *message.rbegin() != '\n') {
164  std::cout << "\n";
165  }
166  std::cout << "Stack trace:\n"
168  ::testing::UnitTest::GetInstance(), actual_to_skip);
169  }
170  std::cout << ::std::flush;
171 }
Definition: test.c:42
GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(UnitTest *unit_test, int skip_count)
Definition: gtest.cc:4973
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
std::string message
Definition: SPDYCodec.cpp:133
GTEST_API_ bool LogIsVisible(LogSeverity severity)
static UnitTest * GetInstance()
Definition: gtest.cc:3972
static void testing::internal::LogElementMatcherPairVec ( const ElementMatcherPairs pairs,
::std::ostream *  stream 
)
static

Definition at line 312 of file gmock-matchers.cc.

References gen_gtest_pred_impl::Iter(), and stream.

313  {
314  typedef ElementMatcherPairs::const_iterator Iter;
315  ::std::ostream& os = *stream;
316  os << "{";
317  const char *sep = "";
318  for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
319  os << sep << "\n ("
320  << "element #" << it->first << ", "
321  << "matcher #" << it->second << ")";
322  sep = ",";
323  }
324  os << "\n}";
325 }
StreamCodecFactory stream
def Iter(n, format, sep='')
static void testing::internal::LogElementMatcherPairVec ( const ElementMatcherPairs pairs,
::std::ostream *  stream 
)
static

Definition at line 312 of file gmock-matchers.cc.

References b, FindMaxBipartiteMatching(), FindPairing(), GTEST_API_, testing::internal::MatchMatrix::HasEdge(), i, testing::MatchResultListener::IsInterested(), gen_gtest_pred_impl::Iter(), testing::internal::MatchMatrix::LhsSize(), testing::internal::MatchMatrix::RhsSize(), testing::MatchResultListener::stream(), and stream.

Referenced by FindPairing(), and LogElementMatcherPairVec().

313  {
314  typedef ElementMatcherPairs::const_iterator Iter;
315  ::std::ostream& os = *stream;
316  os << "{";
317  const char *sep = "";
318  for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
319  os << sep << "\n ("
320  << "element #" << it->first << ", "
321  << "matcher #" << it->second << ")";
322  sep = ",";
323  }
324  os << "\n}";
325 }
StreamCodecFactory stream
def Iter(n, format, sep='')
static void testing::internal::LogElementMatcherPairVec ( const ElementMatcherPairs pairs,
::std::ostream *  stream 
)
static

Definition at line 312 of file gmock-matchers.cc.

References b, FindMaxBipartiteMatching(), FindPairing(), GTEST_API_, testing::internal::MatchMatrix::HasEdge(), i, testing::MatchResultListener::IsInterested(), gen_gtest_pred_impl::Iter(), testing::internal::MatchMatrix::LhsSize(), LogElementMatcherPairVec(), testing::internal::MatchMatrix::RhsSize(), testing::MatchResultListener::stream(), and stream.

313  {
314  typedef ElementMatcherPairs::const_iterator Iter;
315  ::std::ostream& os = *stream;
316  os << "{";
317  const char *sep = "";
318  for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
319  os << sep << "\n ("
320  << "element #" << it->first << ", "
321  << "matcher #" << it->second << ")";
322  sep = ",";
323  }
324  os << "\n}";
325 }
StreamCodecFactory stream
def Iter(n, format, sep='')
GTEST_API_ bool testing::internal::LogIsVisible ( LogSeverity  severity)

Definition at line 110 of file gmock-internal-utils.cc.

References GMOCK_FLAG, kErrorVerbosity, kInfoVerbosity, and kWarning.

Referenced by Log(), testing::internal::GoogleTestFailureReporter::ReportFailure(), and testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith().

110  {
111  if (GMOCK_FLAG(verbose) == kInfoVerbosity) {
112  // Always show the log if --gmock_verbose=info.
113  return true;
114  } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) {
115  // Always hide it if --gmock_verbose=error.
116  return false;
117  } else {
118  // If --gmock_verbose is neither "info" nor "error", we treat it
119  // as "warning" (its default value).
120  return severity == kWarning;
121  }
122 }
const char kErrorVerbosity[]
#define GMOCK_FLAG(name)
Definition: gmock-port.h:70
void testing::internal::LogToStderr ( )
inline

Definition at line 1275 of file gtest-port.h.

1275 {}
GTEST_API_ void testing::internal::LogWithLocation ( testing::internal::LogSeverity  severity,
const char *  file,
int  line,
const string message 
)

Definition at line 59 of file gmock-spec-builders.cc.

References Log(), and s.

Referenced by testing::internal::TypedExpectation< F >::GetActionForArguments(), testing::internal::MockSpec< R(A1, A2, A3, A4, A5, A6, A7, A8, A9) >::InternalDefaultActionSetAt(), and testing::internal::MockSpec< R(A1, A2, A3, A4, A5, A6, A7, A8, A9) >::InternalExpectedAt().

61  {
62  ::std::ostringstream s;
63  s << file << ":" << line << ": " << message << ::std::endl;
64  Log(severity, s.str(), 0);
65 }
Definition: test.c:42
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
static set< string > s
template<typename T >
linked_ptr< T > testing::internal::make_linked_ptr ( T ptr)

Definition at line 236 of file gtest-linked_ptr.h.

References ptr.

Referenced by testing::internal::linked_ptr< const testing::MatcherInterface< const internal::string & > >::copy().

236  {
237  return linked_ptr<T>(ptr);
238 }
void * ptr
TestInfo * testing::internal::MakeAndRegisterTestInfo ( const char *  test_case_name,
const char *  name,
const char *  type_param,
const char *  value_param,
CodeLocation  code_location,
TypeId  fixture_class_id,
SetUpTestCaseFunc  set_up_tc,
TearDownTestCaseFunc  tear_down_tc,
TestFactoryBase factory 
)

Definition at line 2543 of file gtest.cc.

References testing::internal::UnitTestImpl::AddTestInfo(), testing::internal::CodeLocation::file, FormatFileLocation(), testing::Message::GetString(), GetUnitTestImpl(), testing::internal::CodeLocation::line, testing::TestInfo::name(), testing::TestInfo::name_, testing::TestInfo::test_case_name(), and testing::TestInfo::TestInfo().

Referenced by testing::internal::CodeLocation::CodeLocation(), testing::TestInfo::result(), and testing::TestPartNonfatallyFailed().

2552  {
2553  TestInfo* const test_info =
2554  new TestInfo(test_case_name, name, type_param, value_param,
2555  code_location, fixture_class_id, factory);
2556  GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
2557  return test_info;
2558 }
class UnitTestImpl * GetUnitTestImpl()
const char * name
Definition: http_parser.c:437
void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc, TestInfo *test_info)
template<typename M >
PredicateFormatterFromMatcher< M > testing::internal::MakePredicateFormatterFromMatcher ( M  matcher)
inline

Definition at line 1879 of file gmock-matchers.h.

References move().

Referenced by testing::internal::PredicateFormatterFromMatcher< M >::operator()().

1879  {
1880  return PredicateFormatterFromMatcher<M>(internal::move(matcher));
1881 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<typename Tuple2Matcher , typename Second >
BoundSecondMatcher< Tuple2Matcher, Second > testing::internal::MatcherBindSecond ( const Tuple2Matcher &  tm,
const Second &  second 
)

Definition at line 3612 of file gmock-matchers.h.

References FormatMatcherDescription(), and GTEST_API_.

Referenced by testing::internal::BoundSecondMatcher< Tuple2Matcher, Second >::Impl< T >::MatchAndExplain(), and testing::UnorderedPointwise().

3613  {
3614  return BoundSecondMatcher<Tuple2Matcher, Second>(tm, second);
3615 }
template<typename Value , typename T >
bool testing::internal::MatchPrintAndExplain ( Value value,
const Matcher< T > &  matcher,
MatchResultListener listener 
)

Definition at line 701 of file gmock-matchers.h.

References testing::MatchResultListener::IsInterested(), IsReadableTypeName(), testing::internal::MatcherBase< T >::MatchAndExplain(), testing::internal::MatcherBase< T >::Matches(), PrintIfNotEmpty(), testing::StringMatchResultListener::str(), testing::MatchResultListener::stream(), and UniversalPrint().

Referenced by testing::SafeMatcherCastImpl< T >::Cast(), testing::internal::PointeeMatcher< InnerMatcher >::Impl< Pointer >::MatchAndExplain(), testing::internal::WhenDynamicCastToMatcher< To >::MatchAndExplain(), testing::internal::WhenDynamicCastToMatcher< To & >::MatchAndExplain(), testing::internal::ResultOfMatcher< Callable >::Impl< T >::MatchAndExplain(), testing::internal::FieldMatcher< Class, FieldType >::MatchAndExplainImpl(), testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl(), and testing::internal::PredicateFormatterFromMatcher< M >::operator()().

702  {
703  if (!listener->IsInterested()) {
704  // If the listener is not interested, we do not need to construct the
705  // inner explanation.
706  return matcher.Matches(value);
707  }
708 
709  StringMatchResultListener inner_listener;
710  const bool match = matcher.MatchAndExplain(value, &inner_listener);
711 
712  UniversalPrint(value, listener->stream());
713 #if GTEST_HAS_RTTI
714  const string& type_name = GetTypeName<Value>();
715  if (IsReadableTypeName(type_name))
716  *listener->stream() << " (of type " << type_name << ")";
717 #endif
718  PrintIfNotEmpty(inner_listener.str(), listener->stream());
719 
720  return match;
721 }
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void UniversalPrint(const T &value,::std::ostream *os)
static const char *const value
Definition: Conv.cpp:50
bool IsReadableTypeName(const string &type_name)
template<typename T >
bool testing::internal::operator!= ( T ptr,
const linked_ptr< T > &  x 
)
inline
bool testing::internal::ParseBoolFlag ( const char *  str,
const char *  flag,
bool *  value 
)

Definition at line 5053 of file gtest.cc.

References ParseFlagValue().

Referenced by ParseGoogleTestFlag(), ParseGoogleTestFlagsOnlyImpl(), and PrintOnOneLine().

5053  {
5054  // Gets the value of the flag as a string.
5055  const char* const value_str = ParseFlagValue(str, flag, true);
5056 
5057  // Aborts if the parsing failed.
5058  if (value_str == NULL) return false;
5059 
5060  // Converts the string value to a bool.
5061  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
5062  return true;
5063 }
static once_flag flag
Definition: Random.cpp:75
static const char *const value
Definition: Conv.cpp:50
const char * ParseFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gtest.cc:5015
const char * testing::internal::ParseFlagValue ( const char *  str,
const char *  flag,
bool  def_optional 
)

Definition at line 5015 of file gtest.cc.

References flag, GTEST_FLAG_PREFIX_, and string.

Referenced by ParseBoolFlag(), ParseInt32Flag(), ParseStringFlag(), and PrintOnOneLine().

5017  {
5018  // str and flag must not be NULL.
5019  if (str == NULL || flag == NULL) return NULL;
5020 
5021  // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
5022  const std::string flag_str = std::string("--") + GTEST_FLAG_PREFIX_ + flag;
5023  const size_t flag_len = flag_str.length();
5024  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
5025 
5026  // Skips the flag name.
5027  const char* flag_end = str + flag_len;
5028 
5029  // When def_optional is true, it's OK to not have a "=value" part.
5030  if (def_optional && (flag_end[0] == '\0')) {
5031  return flag_end;
5032  }
5033 
5034  // If def_optional is true and there are more characters after the
5035  // flag name, or if def_optional is false, there must be a '=' after
5036  // the flag name.
5037  if (flag_end[0] != '=') return NULL;
5038 
5039  // Returns the string after "=".
5040  return flag_end + 1;
5041 }
#define GTEST_FLAG_PREFIX_
Definition: gtest-port.h:286
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
static bool testing::internal::ParseGoogleMockBoolFlag ( const char *  str,
const char *  flag,
bool *  value 
)
static

Definition at line 91 of file gmock.cc.

References ParseGoogleMockFlagValue().

92  {
93  // Gets the value of the flag as a string.
94  const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
95 
96  // Aborts if the parsing failed.
97  if (value_str == NULL) return false;
98 
99  // Converts the string value to a bool.
100  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
101  return true;
102 }
static once_flag flag
Definition: Random.cpp:75
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gmock.cc:58
static const char *const value
Definition: Conv.cpp:50
static bool testing::internal::ParseGoogleMockBoolFlag ( const char *  str,
const char *  flag,
bool *  value 
)
static

Definition at line 91 of file gmock.cc.

References ParseGoogleMockFlagValue().

Referenced by InitGoogleMockImpl(), and ParseGoogleMockStringFlag().

92  {
93  // Gets the value of the flag as a string.
94  const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
95 
96  // Aborts if the parsing failed.
97  if (value_str == NULL) return false;
98 
99  // Converts the string value to a bool.
100  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
101  return true;
102 }
static once_flag flag
Definition: Random.cpp:75
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gmock.cc:58
static const char *const value
Definition: Conv.cpp:50
static bool testing::internal::ParseGoogleMockBoolFlag ( const char *  str,
const char *  flag,
bool *  value 
)
static

Definition at line 91 of file gmock.cc.

References ParseGoogleMockFlagValue().

92  {
93  // Gets the value of the flag as a string.
94  const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
95 
96  // Aborts if the parsing failed.
97  if (value_str == NULL) return false;
98 
99  // Converts the string value to a bool.
100  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
101  return true;
102 }
static once_flag flag
Definition: Random.cpp:75
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gmock.cc:58
static const char *const value
Definition: Conv.cpp:50
static const char* testing::internal::ParseGoogleMockFlagValue ( const char *  str,
const char *  flag,
bool  def_optional 
)
static

Definition at line 58 of file gmock.cc.

References flag, and string.

Referenced by ParseGoogleMockBoolFlag(), and ParseGoogleMockStringFlag().

60  {
61  // str and flag must not be NULL.
62  if (str == NULL || flag == NULL) return NULL;
63 
64  // The flag must start with "--gmock_".
65  const std::string flag_str = std::string("--gmock_") + flag;
66  const size_t flag_len = flag_str.length();
67  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
68 
69  // Skips the flag name.
70  const char* flag_end = str + flag_len;
71 
72  // When def_optional is true, it's OK to not have a "=value" part.
73  if (def_optional && (flag_end[0] == '\0')) {
74  return flag_end;
75  }
76 
77  // If def_optional is true and there are more characters after the
78  // flag name, or if def_optional is false, there must be a '=' after
79  // the flag name.
80  if (flag_end[0] != '=') return NULL;
81 
82  // Returns the string after "=".
83  return flag_end + 1;
84 }
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
static const char* testing::internal::ParseGoogleMockFlagValue ( const char *  str,
const char *  flag,
bool  def_optional 
)
static

Definition at line 58 of file gmock.cc.

References flag, and string.

60  {
61  // str and flag must not be NULL.
62  if (str == NULL || flag == NULL) return NULL;
63 
64  // The flag must start with "--gmock_".
65  const std::string flag_str = std::string("--gmock_") + flag;
66  const size_t flag_len = flag_str.length();
67  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
68 
69  // Skips the flag name.
70  const char* flag_end = str + flag_len;
71 
72  // When def_optional is true, it's OK to not have a "=value" part.
73  if (def_optional && (flag_end[0] == '\0')) {
74  return flag_end;
75  }
76 
77  // If def_optional is true and there are more characters after the
78  // flag name, or if def_optional is false, there must be a '=' after
79  // the flag name.
80  if (flag_end[0] != '=') return NULL;
81 
82  // Returns the string after "=".
83  return flag_end + 1;
84 }
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
static const char* testing::internal::ParseGoogleMockFlagValue ( const char *  str,
const char *  flag,
bool  def_optional 
)
static

Definition at line 58 of file gmock.cc.

References flag, and string.

60  {
61  // str and flag must not be NULL.
62  if (str == NULL || flag == NULL) return NULL;
63 
64  // The flag must start with "--gmock_".
65  const std::string flag_str = std::string("--gmock_") + flag;
66  const size_t flag_len = flag_str.length();
67  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
68 
69  // Skips the flag name.
70  const char* flag_end = str + flag_len;
71 
72  // When def_optional is true, it's OK to not have a "=value" part.
73  if (def_optional && (flag_end[0] == '\0')) {
74  return flag_end;
75  }
76 
77  // If def_optional is true and there are more characters after the
78  // flag name, or if def_optional is false, there must be a '=' after
79  // the flag name.
80  if (flag_end[0] != '=') return NULL;
81 
82  // Returns the string after "=".
83  return flag_end + 1;
84 }
static once_flag flag
Definition: Random.cpp:75
const char * string
Definition: Conv.cpp:212
template<typename String >
static bool testing::internal::ParseGoogleMockStringFlag ( const char *  str,
const char *  flag,
String value 
)
static

Definition at line 110 of file gmock.cc.

References ParseGoogleMockFlagValue().

Referenced by InitGoogleMockImpl(), and ParseGoogleMockStringFlag().

111  {
112  // Gets the value of the flag as a string.
113  const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
114 
115  // Aborts if the parsing failed.
116  if (value_str == NULL) return false;
117 
118  // Sets *value to the value of the flag.
119  *value = value_str;
120  return true;
121 }
static once_flag flag
Definition: Random.cpp:75
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gmock.cc:58
static const char *const value
Definition: Conv.cpp:50
template<typename String >
static bool testing::internal::ParseGoogleMockStringFlag ( const char *  str,
const char *  flag,
String value 
)
static

Definition at line 110 of file gmock.cc.

References argv, GMOCK_FLAG, GTEST_API_, i, testing::InitGoogleMock(), InitGoogleMockImpl(), testing::InitGoogleTest(), ParseGoogleMockBoolFlag(), ParseGoogleMockFlagValue(), ParseGoogleMockStringFlag(), StreamableToString(), and string.

111  {
112  // Gets the value of the flag as a string.
113  const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
114 
115  // Aborts if the parsing failed.
116  if (value_str == NULL) return false;
117 
118  // Sets *value to the value of the flag.
119  *value = value_str;
120  return true;
121 }
static once_flag flag
Definition: Random.cpp:75
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gmock.cc:58
static const char *const value
Definition: Conv.cpp:50
template<typename String >
static bool testing::internal::ParseGoogleMockStringFlag ( const char *  str,
const char *  flag,
String value 
)
static

Definition at line 110 of file gmock.cc.

References argv, GMOCK_FLAG, GTEST_API_, i, testing::InitGoogleMock(), InitGoogleMockImpl(), testing::InitGoogleTest(), ParseGoogleMockBoolFlag(), ParseGoogleMockFlagValue(), ParseGoogleMockStringFlag(), StreamableToString(), and string.

111  {
112  // Gets the value of the flag as a string.
113  const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
114 
115  // Aborts if the parsing failed.
116  if (value_str == NULL) return false;
117 
118  // Sets *value to the value of the flag.
119  *value = value_str;
120  return true;
121 }
static once_flag flag
Definition: Random.cpp:75
static const char * ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gmock.cc:58
static const char *const value
Definition: Conv.cpp:50
bool testing::internal::ParseGoogleTestFlag ( const char *const  arg)

Definition at line 5223 of file gtest.cc.

References testing::internal::UnitTestImpl::catch_exceptions(), folly::empty(), testing::internal::posix::FClose(), FILE, folly::pushmi::operators::filter, testing::internal::posix::FOpen(), g_help_flag, GTEST_FLAG, i, kAlsoRunDisabledTestsFlag, kBreakOnFailureFlag, kCatchExceptionsFlag, kColorFlag, kDeathTestStyleFlag, kDeathTestUseFork, kFilterFlag, kInternalRunDeathTestFlag, kListTestsFlag, kOutputFlag, kPrintTimeFlag, kRandomSeedFlag, kRepeatFlag, kShuffleFlag, kStackTraceDepthFlag, kStreamResultToFlag, kThrowOnFailureFlag, folly::gen::lines(), gmock_output_test::output, ParseBoolFlag(), ParseInt32Flag(), ParseStringFlag(), testing::internal::UnitTestImpl::random_seed(), ReadEntireFile(), repeat(), SplitString(), and string.

Referenced by ParseGoogleTestFlagsOnlyImpl().

5223  {
5225  &GTEST_FLAG(also_run_disabled_tests)) ||
5227  &GTEST_FLAG(break_on_failure)) ||
5229  &GTEST_FLAG(catch_exceptions)) ||
5230  ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
5232  &GTEST_FLAG(death_test_style)) ||
5234  &GTEST_FLAG(death_test_use_fork)) ||
5237  &GTEST_FLAG(internal_run_death_test)) ||
5238  ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
5240  ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
5241  ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
5243  ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
5245  &GTEST_FLAG(stack_trace_depth)) ||
5247  &GTEST_FLAG(stream_result_to)) ||
5249  &GTEST_FLAG(throw_on_failure));
5250 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
const char kAlsoRunDisabledTestsFlag[]
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
const char kListTestsFlag[]
const char kStreamResultToFlag[]
const char kFilterFlag[]
const char kBreakOnFailureFlag[]
bool ParseBoolFlag(const char *str, const char *flag, bool *value)
Definition: gtest.cc:5053
const char kRandomSeedFlag[]
const char kShuffleFlag[]
const char kColorFlag[]
void repeat(F const &func)
bool ParseStringFlag(const char *str, const char *flag, std::string *value)
Definition: gtest.cc:5087
const char kRepeatFlag[]
const char kStackTraceDepthFlag[]
const char kCatchExceptionsFlag[]
const char kInternalRunDeathTestFlag[]
const char kOutputFlag[]
const char kPrintTimeFlag[]
const char kThrowOnFailureFlag[]
GTEST_API_ bool ParseInt32Flag(const char *str, const char *flag, Int32 *value)
Definition: gtest.cc:5070
void testing::internal::ParseGoogleTestFlagsOnly ( int *  argc,
char **  argv 
)
void testing::internal::ParseGoogleTestFlagsOnly ( int *  argc,
wchar_t **  argv 
)

Definition at line 5335 of file gtest.cc.

References ParseGoogleTestFlagsOnlyImpl().

5335  {
5337 }
char ** argv
void ParseGoogleTestFlagsOnlyImpl(int *argc, CharType **argv)
Definition: gtest.cc:5279
template<typename CharType >
void testing::internal::ParseGoogleTestFlagsOnlyImpl ( int *  argc,
CharType **  argv 
)

Definition at line 5279 of file gtest.cc.

References g_help_flag, GTEST_FLAG, HasGoogleTestFlagPrefix(), i, kFlagfileFlag, ParseBoolFlag(), ParseGoogleTestFlag(), ParseInt32Flag(), ParseStringFlag(), PrintColorEncoded(), StreamableToString(), and string.

Referenced by ParseGoogleTestFlagsOnly().

5279  {
5280  for (int i = 1; i < *argc; i++) {
5281  const std::string arg_string = StreamableToString(argv[i]);
5282  const char* const arg = arg_string.c_str();
5283 
5287 
5288  bool remove_flag = false;
5289  if (ParseGoogleTestFlag(arg)) {
5290  remove_flag = true;
5291 #if GTEST_USE_OWN_FLAGFILE_FLAG_
5292  } else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {
5293  LoadFlagsFromFile(GTEST_FLAG(flagfile));
5294  remove_flag = true;
5295 #endif // GTEST_USE_OWN_FLAGFILE_FLAG_
5296  } else if (arg_string == "--help" || arg_string == "-h" ||
5297  arg_string == "-?" || arg_string == "/?" ||
5298  HasGoogleTestFlagPrefix(arg)) {
5299  // Both help flag and unrecognized Google Test flags (excluding
5300  // internal ones) trigger help display.
5301  g_help_flag = true;
5302  }
5303 
5304  if (remove_flag) {
5305  // Shift the remainder of the argv list left by one. Note
5306  // that argv has (*argc + 1) elements, the last one always being
5307  // NULL. The following loop moves the trailing NULL element as
5308  // well.
5309  for (int j = i; j != *argc; j++) {
5310  argv[j] = argv[j + 1];
5311  }
5312 
5313  // Decrements the argument count.
5314  (*argc)--;
5315 
5316  // We also need to decrement the iterator as we just removed
5317  // an element.
5318  i--;
5319  }
5320  }
5321 
5322  if (g_help_flag) {
5323  // We print the help here instead of in RUN_ALL_TESTS(), as the
5324  // latter may not be called at all if the user is using Google
5325  // Test with another testing framework.
5327  }
5328 }
GTEST_API_ bool g_help_flag
Definition: gtest.cc:188
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
static bool HasGoogleTestFlagPrefix(const char *str)
Definition: gtest.cc:5105
bool ParseGoogleTestFlag(const char *const arg)
Definition: gtest.cc:5223
bool ParseBoolFlag(const char *str, const char *flag, bool *value)
Definition: gtest.cc:5053
std::string StreamableToString(const T &streamable)
char ** argv
static void PrintColorEncoded(const char *str)
Definition: gtest.cc:5125
bool ParseStringFlag(const char *str, const char *flag, std::string *value)
Definition: gtest.cc:5087
const char * string
Definition: Conv.cpp:212
static const char kColorEncodedHelpMessage[]
Definition: gtest.cc:5159
GTEST_API_ bool ParseInt32Flag(const char *str, const char *flag, Int32 *value)
Definition: gtest.cc:5070
const char kFlagfileFlag[]
bool testing::internal::ParseInt32 ( const Message src_text,
const char *  str,
Int32 value 
)

Definition at line 1149 of file gtest-port.cc.

References folly::test::end(), and testing::Message::GetString().

Referenced by FlagToEnvVar(), Int32FromEnvOrDie(), Int32FromGTestEnv(), ParseInt32Flag(), PrintOnOneLine(), and TearDownEnvironment().

1149  {
1150  // Parses the environment variable as a decimal integer.
1151  char* end = NULL;
1152  const long long_value = strtol(str, &end, 10); // NOLINT
1153 
1154  // Has strtol() consumed all characters in the string?
1155  if (*end != '\0') {
1156  // No - an invalid character was encountered.
1157  Message msg;
1158  msg << "WARNING: " << src_text
1159  << " is expected to be a 32-bit integer, but actually"
1160  << " has value \"" << str << "\".\n";
1161  printf("%s", msg.GetString().c_str());
1162  fflush(stdout);
1163  return false;
1164  }
1165 
1166  // Is the parsed value in the range of an Int32?
1167  const Int32 result = static_cast<Int32>(long_value);
1168  if (long_value == LONG_MAX || long_value == LONG_MIN ||
1169  // The parsed value overflows as a long. (strtol() returns
1170  // LONG_MAX or LONG_MIN when the input overflows.)
1171  result != long_value
1172  // The parsed value overflows as an Int32.
1173  ) {
1174  Message msg;
1175  msg << "WARNING: " << src_text
1176  << " is expected to be a 32-bit integer, but actually"
1177  << " has value " << str << ", which overflows.\n";
1178  printf("%s", msg.GetString().c_str());
1179  fflush(stdout);
1180  return false;
1181  }
1182 
1183  *value = result;
1184  return true;
1185 }
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2494
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
static const char *const value
Definition: Conv.cpp:50
bool testing::internal::ParseInt32Flag ( const char *  str,
const char *  flag,
Int32 value 
)

Definition at line 5070 of file gtest.cc.

References ParseFlagValue(), and ParseInt32().

Referenced by ParseGoogleTestFlag(), ParseGoogleTestFlagsOnlyImpl(), PrintOnOneLine(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

5070  {
5071  // Gets the value of the flag as a string.
5072  const char* const value_str = ParseFlagValue(str, flag, false);
5073 
5074  // Aborts if the parsing failed.
5075  if (value_str == NULL) return false;
5076 
5077  // Sets *value to the value of the flag.
5078  return ParseInt32(Message() << "The value of flag --" << flag,
5079  value_str, value);
5080 }
bool ParseInt32(const Message &src_text, const char *str, Int32 *value)
Definition: gtest-port.cc:1149
static once_flag flag
Definition: Random.cpp:75
static const char *const value
Definition: Conv.cpp:50
const char * ParseFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gtest.cc:5015
bool testing::internal::ParseStringFlag ( const char *  str,
const char *  flag,
std::string value 
)

Definition at line 5087 of file gtest.cc.

References ParseFlagValue().

Referenced by ParseGoogleTestFlag(), ParseGoogleTestFlagsOnlyImpl(), and PrintOnOneLine().

5087  {
5088  // Gets the value of the flag as a string.
5089  const char* const value_str = ParseFlagValue(str, flag, false);
5090 
5091  // Aborts if the parsing failed.
5092  if (value_str == NULL) return false;
5093 
5094  // Sets *value to the value of the flag.
5095  *value = value_str;
5096  return true;
5097 }
static once_flag flag
Definition: Random.cpp:75
static const char *const value
Definition: Conv.cpp:50
const char * ParseFlagValue(const char *str, const char *flag, bool def_optional)
Definition: gtest.cc:5015
static bool testing::internal::PortableLocaltime ( time_t  seconds,
struct tm *  out 
)
static

Definition at line 3556 of file gtest.cc.

References testing::TestCase::ad_hoc_test_result(), testing::UnitTest::ad_hoc_test_result(), ch, folly::netops::close(), folly::netops::connect(), testing::internal::OsStackTraceGetter::CurrentStackTrace(), data, testing::TestResult::elapsed_time(), testing::TestCase::elapsed_time(), testing::UnitTest::elapsed_time(), testing::TestPartResult::failed(), testing::TestCase::failed_test_count(), testing::UnitTest::failed_test_count(), testing::internal::TraceInfo::file, testing::TestPartResult::file_name(), testing::internal::String::FormatByte(), FormatCompilerIndependentFileLocation(), FormatEpochTimeInMillisAsIso8601(), testing::internal::String::FormatIntWidth2(), FormatTimeInMillisAsSeconds(), testing::UnitTest::GetInstance(), testing::GetReservedAttributesForElement(), testing::Message::GetString(), testing::UnitTest::GetTestCase(), testing::TestCase::GetTestInfo(), testing::TestResult::GetTestPartResult(), testing::TestResult::GetTestProperty(), GTEST_CHECK_, GTEST_FLAG, GTEST_LOCK_EXCLUDED_, GTEST_LOG_, GTEST_NAME_, i, testing::TestInfo::is_reportable(), testing::internal::OsStackTraceGetterInterface::kElidedFramesMarker, testing::internal::TraceInfo::line, testing::TestPartResult::line_number(), testing::TestPartResult::message(), testing::internal::TraceInfo::message, testing::UnitTest::mutex_, name, testing::TestInfo::name(), testing::TestCase::name(), testing::internal::XmlUnitTestResultPrinter::OutputXmlAttribute(), testing::internal::XmlUnitTestResultPrinter::OutputXmlCDataSection(), testing::internal::XmlUnitTestResultPrinter::OutputXmlTestInfo(), testing::UnitTest::PopGTestTrace(), PortableLocaltime(), testing::internal::XmlUnitTestResultPrinter::PrintXmlTestCase(), testing::internal::XmlUnitTestResultPrinter::PrintXmlUnitTest(), testing::UnitTest::PushGTestTrace(), testing::UnitTest::random_seed(), testing::TestCase::reportable_disabled_test_count(), testing::UnitTest::reportable_disabled_test_count(), testing::TestCase::reportable_test_count(), testing::UnitTest::reportable_test_count(), testing::TestInfo::result(), testing::internal::ScopedTrace::ScopedTrace(), testing::TestInfo::should_run(), folly::netops::socket(), testing::UnitTest::start_timestamp(), StreamableToString(), string, testing::TestPartResult::summary(), testing::TestResult::test_property_count(), testing::internal::XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(), testing::TestResult::total_part_count(), testing::UnitTest::total_test_case_count(), testing::TestCase::total_test_count(), testing::TestInfo::type_param(), testing::internal::OsStackTraceGetter::UponLeavingGTest(), testing::TestInfo::value_param(), and testing::internal::ScopedTrace::~ScopedTrace().

3556  {
3557 #if defined(_MSC_VER)
3558  return localtime_s(out, &seconds) == 0;
3559 #elif defined(__MINGW32__) || defined(__MINGW64__)
3560  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
3561  // Windows' localtime(), which has a thread-local tm buffer.
3562  struct tm* tm_ptr = localtime(&seconds); // NOLINT
3563  if (tm_ptr == NULL)
3564  return false;
3565  *out = *tm_ptr;
3566  return true;
3567 #else
3568  return localtime_r(&seconds, out) != NULL;
3569 #endif
3570 }
static bool testing::internal::PortableLocaltime ( time_t  seconds,
struct tm *  out 
)
static

Definition at line 3556 of file gtest.cc.

References testing::TestCase::ad_hoc_test_result(), testing::UnitTest::ad_hoc_test_result(), ch, folly::netops::close(), folly::netops::connect(), testing::internal::OsStackTraceGetter::CurrentStackTrace(), data, testing::TestResult::elapsed_time(), testing::TestCase::elapsed_time(), testing::UnitTest::elapsed_time(), testing::TestPartResult::failed(), testing::TestCase::failed_test_count(), testing::UnitTest::failed_test_count(), testing::internal::TraceInfo::file, testing::TestPartResult::file_name(), testing::internal::String::FormatByte(), FormatCompilerIndependentFileLocation(), FormatEpochTimeInMillisAsIso8601(), testing::internal::String::FormatIntWidth2(), FormatTimeInMillisAsSeconds(), testing::UnitTest::GetInstance(), testing::GetReservedAttributesForElement(), testing::Message::GetString(), testing::UnitTest::GetTestCase(), testing::TestCase::GetTestInfo(), testing::TestResult::GetTestPartResult(), testing::TestResult::GetTestProperty(), GTEST_CHECK_, GTEST_FLAG, GTEST_LOCK_EXCLUDED_, GTEST_LOG_, GTEST_NAME_, i, testing::TestInfo::is_reportable(), testing::internal::OsStackTraceGetterInterface::kElidedFramesMarker, testing::internal::TraceInfo::line, testing::TestPartResult::line_number(), testing::TestPartResult::message(), testing::internal::TraceInfo::message, testing::UnitTest::mutex_, name, testing::TestInfo::name(), testing::TestCase::name(), testing::internal::XmlUnitTestResultPrinter::OutputXmlAttribute(), testing::internal::XmlUnitTestResultPrinter::OutputXmlCDataSection(), testing::internal::XmlUnitTestResultPrinter::OutputXmlTestInfo(), testing::UnitTest::PopGTestTrace(), PortableLocaltime(), testing::internal::XmlUnitTestResultPrinter::PrintXmlTestCase(), testing::internal::XmlUnitTestResultPrinter::PrintXmlUnitTest(), testing::UnitTest::PushGTestTrace(), testing::UnitTest::random_seed(), testing::TestCase::reportable_disabled_test_count(), testing::UnitTest::reportable_disabled_test_count(), testing::TestCase::reportable_test_count(), testing::UnitTest::reportable_test_count(), testing::TestInfo::result(), testing::internal::ScopedTrace::ScopedTrace(), testing::TestInfo::should_run(), folly::netops::socket(), testing::UnitTest::start_timestamp(), StreamableToString(), string, testing::TestPartResult::summary(), testing::TestResult::test_property_count(), testing::internal::XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(), testing::TestResult::total_part_count(), testing::UnitTest::total_test_case_count(), testing::TestCase::total_test_count(), testing::TestInfo::type_param(), testing::internal::OsStackTraceGetter::UponLeavingGTest(), testing::TestInfo::value_param(), and testing::internal::ScopedTrace::~ScopedTrace().

3556  {
3557 #if defined(_MSC_VER)
3558  return localtime_s(out, &seconds) == 0;
3559 #elif defined(__MINGW32__) || defined(__MINGW64__)
3560  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
3561  // Windows' localtime(), which has a thread-local tm buffer.
3562  struct tm* tm_ptr = localtime(&seconds); // NOLINT
3563  if (tm_ptr == NULL)
3564  return false;
3565  *out = *tm_ptr;
3566  return true;
3567 #else
3568  return localtime_r(&seconds, out) != NULL;
3569 #endif
3570 }
static bool testing::internal::PortableLocaltime ( time_t  seconds,
struct tm *  out 
)
static

Definition at line 3556 of file gtest.cc.

Referenced by FormatEpochTimeInMillisAsIso8601(), and PortableLocaltime().

3556  {
3557 #if defined(_MSC_VER)
3558  return localtime_s(out, &seconds) == 0;
3559 #elif defined(__MINGW32__) || defined(__MINGW64__)
3560  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
3561  // Windows' localtime(), which has a thread-local tm buffer.
3562  struct tm* tm_ptr = localtime(&seconds); // NOLINT
3563  if (tm_ptr == NULL)
3564  return false;
3565  *out = *tm_ptr;
3566  return true;
3567 #else
3568  return localtime_r(&seconds, out) != NULL;
3569 #endif
3570 }
template<typename UnsignedChar , typename Char >
static CharFormat testing::internal::PrintAsCharLiteralTo ( Char  c,
ostream *  os 
)
static

Definition at line 146 of file gtest-printers.cc.

References c, IsPrintableAscii(), kAsIs, kHexEscape, and kSpecialEscape.

146  {
147  switch (static_cast<wchar_t>(c)) {
148  case L'\0':
149  *os << "\\0";
150  break;
151  case L'\'':
152  *os << "\\'";
153  break;
154  case L'\\':
155  *os << "\\\\";
156  break;
157  case L'\a':
158  *os << "\\a";
159  break;
160  case L'\b':
161  *os << "\\b";
162  break;
163  case L'\f':
164  *os << "\\f";
165  break;
166  case L'\n':
167  *os << "\\n";
168  break;
169  case L'\r':
170  *os << "\\r";
171  break;
172  case L'\t':
173  *os << "\\t";
174  break;
175  case L'\v':
176  *os << "\\v";
177  break;
178  default:
179  if (IsPrintableAscii(c)) {
180  *os << static_cast<char>(c);
181  return kAsIs;
182  } else {
183  *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));
184  return kHexEscape;
185  }
186  }
187  return kSpecialEscape;
188 }
bool IsPrintableAscii(wchar_t c)
char c
template<typename UnsignedChar , typename Char >
static CharFormat testing::internal::PrintAsCharLiteralTo ( Char  c,
ostream *  os 
)
static

Definition at line 146 of file gtest-printers.cc.

References c, IsPrintableAscii(), kAsIs, kHexEscape, and kSpecialEscape.

146  {
147  switch (static_cast<wchar_t>(c)) {
148  case L'\0':
149  *os << "\\0";
150  break;
151  case L'\'':
152  *os << "\\'";
153  break;
154  case L'\\':
155  *os << "\\\\";
156  break;
157  case L'\a':
158  *os << "\\a";
159  break;
160  case L'\b':
161  *os << "\\b";
162  break;
163  case L'\f':
164  *os << "\\f";
165  break;
166  case L'\n':
167  *os << "\\n";
168  break;
169  case L'\r':
170  *os << "\\r";
171  break;
172  case L'\t':
173  *os << "\\t";
174  break;
175  case L'\v':
176  *os << "\\v";
177  break;
178  default:
179  if (IsPrintableAscii(c)) {
180  *os << static_cast<char>(c);
181  return kAsIs;
182  } else {
183  *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));
184  return kHexEscape;
185  }
186  }
187  return kSpecialEscape;
188 }
bool IsPrintableAscii(wchar_t c)
char c
template<typename UnsignedChar , typename Char >
static CharFormat testing::internal::PrintAsCharLiteralTo ( Char  c,
ostream *  os 
)
static

Definition at line 146 of file gtest-printers.cc.

References c, IsPrintableAscii(), kAsIs, kHexEscape, and kSpecialEscape.

146  {
147  switch (static_cast<wchar_t>(c)) {
148  case L'\0':
149  *os << "\\0";
150  break;
151  case L'\'':
152  *os << "\\'";
153  break;
154  case L'\\':
155  *os << "\\\\";
156  break;
157  case L'\a':
158  *os << "\\a";
159  break;
160  case L'\b':
161  *os << "\\b";
162  break;
163  case L'\f':
164  *os << "\\f";
165  break;
166  case L'\n':
167  *os << "\\n";
168  break;
169  case L'\r':
170  *os << "\\r";
171  break;
172  case L'\t':
173  *os << "\\t";
174  break;
175  case L'\v':
176  *os << "\\v";
177  break;
178  default:
179  if (IsPrintableAscii(c)) {
180  *os << static_cast<char>(c);
181  return kAsIs;
182  } else {
183  *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));
184  return kHexEscape;
185  }
186  }
187  return kSpecialEscape;
188 }
bool IsPrintableAscii(wchar_t c)
char c
static CharFormat testing::internal::PrintAsStringLiteralTo ( wchar_t  c,
ostream *  os 
)
static

Definition at line 192 of file gtest-printers.cc.

References c, kAsIs, and kSpecialEscape.

192  {
193  switch (c) {
194  case L'\'':
195  *os << "'";
196  return kAsIs;
197  case L'"':
198  *os << "\\\"";
199  return kSpecialEscape;
200  default:
201  return PrintAsCharLiteralTo<wchar_t>(c, os);
202  }
203 }
char c
static CharFormat testing::internal::PrintAsStringLiteralTo ( wchar_t  c,
ostream *  os 
)
static

Definition at line 192 of file gtest-printers.cc.

References c, kAsIs, and kSpecialEscape.

192  {
193  switch (c) {
194  case L'\'':
195  *os << "'";
196  return kAsIs;
197  case L'"':
198  *os << "\\\"";
199  return kSpecialEscape;
200  default:
201  return PrintAsCharLiteralTo<wchar_t>(c, os);
202  }
203 }
char c
static CharFormat testing::internal::PrintAsStringLiteralTo ( wchar_t  c,
ostream *  os 
)
static

Definition at line 192 of file gtest-printers.cc.

References c, kAsIs, and kSpecialEscape.

192  {
193  switch (c) {
194  case L'\'':
195  *os << "'";
196  return kAsIs;
197  case L'"':
198  *os << "\\\"";
199  return kSpecialEscape;
200  default:
201  return PrintAsCharLiteralTo<wchar_t>(c, os);
202  }
203 }
char c
static CharFormat testing::internal::PrintAsStringLiteralTo ( char  c,
ostream *  os 
)
static

Definition at line 207 of file gtest-printers.cc.

References c, testing::gmock_generated_actions_test::Char(), folly::format(), GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_, GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_, GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_, kHexEscape, PrintCharAndCodeTo(), and PrintTo().

Referenced by PrintAsStringLiteralTo(), and PrintCharsAsStringTo().

207  {
208  return PrintAsStringLiteralTo(
209  static_cast<wchar_t>(static_cast<unsigned char>(c)), os);
210 }
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
char c
static CharFormat testing::internal::PrintAsStringLiteralTo ( char  c,
ostream *  os 
)
static

Definition at line 207 of file gtest-printers.cc.

References PrintAsStringLiteralTo().

207  {
208  return PrintAsStringLiteralTo(
209  static_cast<wchar_t>(static_cast<unsigned char>(c)), os);
210 }
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
char c
static CharFormat testing::internal::PrintAsStringLiteralTo ( char  c,
ostream *  os 
)
static

Definition at line 207 of file gtest-printers.cc.

References c, testing::gmock_generated_actions_test::Char(), folly::format(), GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_, GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_, GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_, kHexEscape, PrintAsStringLiteralTo(), PrintCharAndCodeTo(), and PrintTo().

207  {
208  return PrintAsStringLiteralTo(
209  static_cast<wchar_t>(static_cast<unsigned char>(c)), os);
210 }
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
char c
template<typename UnsignedChar , typename Char >
void testing::internal::PrintCharAndCodeTo ( Char  c,
ostream *  os 
)

Definition at line 217 of file gtest-printers.cc.

References c, folly::format(), and kHexEscape.

Referenced by PrintAsStringLiteralTo().

217  {
218  // First, print c as a literal in the most readable form we can find.
219  *os << ((sizeof(c) > 1) ? "L'" : "'");
220  const CharFormat format = PrintAsCharLiteralTo<UnsignedChar>(c, os);
221  *os << "'";
222 
223  // To aid user debugging, we also print c's code in decimal, unless
224  // it's 0 (in which case c was printed as '\\0', making the code
225  // obvious).
226  if (c == 0)
227  return;
228  *os << " (" << static_cast<int>(c);
229 
230  // For more convenience, we print c's code again in hexidecimal,
231  // unless c was already printed in the form '\x##' or the code is in
232  // [1, 9].
233  if (format == kHexEscape || (1 <= c && c <= 9)) {
234  // Do nothing.
235  } else {
236  *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c));
237  }
238  *os << ")";
239 }
Formatter< false, Args... > format(StringPiece fmt, Args &&...args)
Definition: Format.h:271
char c
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void testing::internal::PrintCharsAsStringTo ( const CharType *  begin,
size_t  len,
ostream *  os 
)
static

Definition at line 262 of file gtest-printers.cc.

References GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_, GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_, GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_, IsXDigit(), kHexEscape, and PrintAsStringLiteralTo().

263  {
264  const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
265  *os << kQuoteBegin;
266  bool is_previous_hex = false;
267  for (size_t index = 0; index < len; ++index) {
268  const CharType cur = begin[index];
269  if (is_previous_hex && IsXDigit(cur)) {
270  // Previous character is of '\x..' form and this character can be
271  // interpreted as another hexadecimal digit in its number. Break string to
272  // disambiguate.
273  *os << "\" " << kQuoteBegin;
274  }
275  is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;
276  }
277  *os << "\"";
278 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void testing::internal::PrintCharsAsStringTo ( const CharType *  begin,
size_t  len,
ostream *  os 
)
static

Definition at line 262 of file gtest-printers.cc.

References GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_, GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_, GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_, IsXDigit(), kHexEscape, and PrintAsStringLiteralTo().

Referenced by PrintStringTo(), PrintTo(), and UniversalPrintCharArray().

263  {
264  const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
265  *os << kQuoteBegin;
266  bool is_previous_hex = false;
267  for (size_t index = 0; index < len; ++index) {
268  const CharType cur = begin[index];
269  if (is_previous_hex && IsXDigit(cur)) {
270  // Previous character is of '\x..' form and this character can be
271  // interpreted as another hexadecimal digit in its number. Break string to
272  // disambiguate.
273  *os << "\" " << kQuoteBegin;
274  }
275  is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;
276  }
277  *os << "\"";
278 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void testing::internal::PrintCharsAsStringTo ( const CharType *  begin,
size_t  len,
ostream *  os 
)
static

Definition at line 262 of file gtest-printers.cc.

References GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_, GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_, GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_, IsXDigit(), kHexEscape, and PrintAsStringLiteralTo().

263  {
264  const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
265  *os << kQuoteBegin;
266  bool is_previous_hex = false;
267  for (size_t index = 0; index < len; ++index) {
268  const CharType cur = begin[index];
269  if (is_previous_hex && IsXDigit(cur)) {
270  // Previous character is of '\x..' form and this character can be
271  // interpreted as another hexadecimal digit in its number. Break string to
272  // disambiguate.
273  *os << "\" " << kQuoteBegin;
274  }
275  is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;
276  }
277  *os << "\"";
278 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
static void testing::internal::PrintColorEncoded ( const char *  str)
static

Definition at line 5125 of file gtest.cc.

References ch, COLOR_DEFAULT, COLOR_GREEN, COLOR_RED, COLOR_YELLOW, ColoredPrintf(), and string.

5125  {
5126  GTestColor color = COLOR_DEFAULT; // The current color.
5127 
5128  // Conceptually, we split the string into segments divided by escape
5129  // sequences. Then we print one segment at a time. At the end of
5130  // each iteration, the str pointer advances to the beginning of the
5131  // next segment.
5132  for (;;) {
5133  const char* p = strchr(str, '@');
5134  if (p == NULL) {
5135  ColoredPrintf(color, "%s", str);
5136  return;
5137  }
5138 
5139  ColoredPrintf(color, "%s", std::string(str, p).c_str());
5140 
5141  const char ch = p[1];
5142  str = p + 2;
5143  if (ch == '@') {
5144  ColoredPrintf(color, "@");
5145  } else if (ch == 'D') {
5146  color = COLOR_DEFAULT;
5147  } else if (ch == 'R') {
5148  color = COLOR_RED;
5149  } else if (ch == 'G') {
5150  color = COLOR_GREEN;
5151  } else if (ch == 'Y') {
5152  color = COLOR_YELLOW;
5153  } else {
5154  --str;
5155  }
5156  }
5157 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
auto ch
const char * string
Definition: Conv.cpp:212
static void testing::internal::PrintColorEncoded ( const char *  str)
static

Definition at line 5125 of file gtest.cc.

References ch, COLOR_DEFAULT, COLOR_GREEN, COLOR_RED, COLOR_YELLOW, ColoredPrintf(), and string.

Referenced by ParseGoogleTestFlagsOnlyImpl().

5125  {
5126  GTestColor color = COLOR_DEFAULT; // The current color.
5127 
5128  // Conceptually, we split the string into segments divided by escape
5129  // sequences. Then we print one segment at a time. At the end of
5130  // each iteration, the str pointer advances to the beginning of the
5131  // next segment.
5132  for (;;) {
5133  const char* p = strchr(str, '@');
5134  if (p == NULL) {
5135  ColoredPrintf(color, "%s", str);
5136  return;
5137  }
5138 
5139  ColoredPrintf(color, "%s", std::string(str, p).c_str());
5140 
5141  const char ch = p[1];
5142  str = p + 2;
5143  if (ch == '@') {
5144  ColoredPrintf(color, "@");
5145  } else if (ch == 'D') {
5146  color = COLOR_DEFAULT;
5147  } else if (ch == 'R') {
5148  color = COLOR_RED;
5149  } else if (ch == 'G') {
5150  color = COLOR_GREEN;
5151  } else if (ch == 'Y') {
5152  color = COLOR_YELLOW;
5153  } else {
5154  --str;
5155  }
5156  }
5157 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
auto ch
const char * string
Definition: Conv.cpp:212
static void testing::internal::PrintColorEncoded ( const char *  str)
static

Definition at line 5125 of file gtest.cc.

References ch, COLOR_DEFAULT, COLOR_GREEN, COLOR_RED, COLOR_YELLOW, ColoredPrintf(), and string.

5125  {
5126  GTestColor color = COLOR_DEFAULT; // The current color.
5127 
5128  // Conceptually, we split the string into segments divided by escape
5129  // sequences. Then we print one segment at a time. At the end of
5130  // each iteration, the str pointer advances to the beginning of the
5131  // next segment.
5132  for (;;) {
5133  const char* p = strchr(str, '@');
5134  if (p == NULL) {
5135  ColoredPrintf(color, "%s", str);
5136  return;
5137  }
5138 
5139  ColoredPrintf(color, "%s", std::string(str, p).c_str());
5140 
5141  const char ch = p[1];
5142  str = p + 2;
5143  if (ch == '@') {
5144  ColoredPrintf(color, "@");
5145  } else if (ch == 'D') {
5146  color = COLOR_DEFAULT;
5147  } else if (ch == 'R') {
5148  color = COLOR_RED;
5149  } else if (ch == 'G') {
5150  color = COLOR_GREEN;
5151  } else if (ch == 'Y') {
5152  color = COLOR_YELLOW;
5153  } else {
5154  --str;
5155  }
5156  }
5157 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
auto ch
const char * string
Definition: Conv.cpp:212
void testing::internal::PrintFullTestCommentIfPresent ( const TestInfo test_info)

Definition at line 3009 of file gtest.cc.

References testing::TestInfo::type_param(), testing::TestCase::type_param(), and testing::TestInfo::value_param().

Referenced by testing::internal::PrettyUnitTestResultPrinter::OnTestEnd(), testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd(), and testing::internal::PrettyUnitTestResultPrinter::PrintFailedTests().

3009  {
3010  const char* const type_param = test_info.type_param();
3011  const char* const value_param = test_info.value_param();
3012 
3013  if (type_param != NULL || value_param != NULL) {
3014  printf(", where ");
3015  if (type_param != NULL) {
3016  printf("%s = %s", kTypeParamLabel, type_param);
3017  if (value_param != NULL)
3018  printf(" and ");
3019  }
3020  if (value_param != NULL) {
3021  printf("%s = %s", kValueParamLabel, value_param);
3022  }
3023  }
3024 }
static const char kValueParamLabel[]
Definition: gtest.cc:3007
static const char kTypeParamLabel[]
Definition: gtest.cc:3006
static void testing::internal::PrintOnOneLine ( const char *  str,
int  max_length 
)
static

Definition at line 4846 of file gtest.cc.

References i.

Referenced by testing::internal::UnitTestImpl::ListTestsMatchingFilter(), and PrintOnOneLine().

4846  {
4847  if (str != NULL) {
4848  for (int i = 0; *str != '\0'; ++str) {
4849  if (i >= max_length) {
4850  printf("...");
4851  break;
4852  }
4853  if (*str == '\n') {
4854  printf("\\n");
4855  i += 2;
4856  } else {
4857  printf("%c", *str);
4858  ++i;
4859  }
4860  }
4861  }
4862 }
template<typename T >
void testing::internal::PrintRawArrayTo ( const T  a[],
size_t  count,
::std::ostream *  os 
)

Definition at line 548 of file gtest-printers.h.

References count, GTEST_API_, i, PrintStringTo(), PrintTo(), string, and UniversalPrint().

Referenced by testing::internal::UniversalPrinter< T >::Print(), and UniversalPrintArray().

548  {
549  UniversalPrint(a[0], os);
550  for (size_t i = 1; i != count; i++) {
551  *os << ", ";
552  UniversalPrint(a[i], os);
553  }
554 }
void UniversalPrint(const T &value,::std::ostream *os)
char a
int * count
void testing::internal::PrintStringTo ( const ::std::string s,
ostream *  os 
)

Definition at line 354 of file gtest-printers.cc.

References PrintCharsAsStringTo().

Referenced by PrintTo(), and UniversalPrintCharArray().

354  {
355  PrintCharsAsStringTo(s.data(), s.size(), os);
356 }
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo(const CharType *begin, size_t len, ostream *os)
static set< string > s
GTEST_API_ void testing::internal::PrintStringTo ( const ::std::string s,
::std::ostream *  os 
)

Referenced by PrintRawArrayTo(), and PrintTo().

static void testing::internal::PrintTestPartResult ( const TestPartResult test_part_result)
static

Definition at line 2860 of file gtest.cc.

References PrintTestPartResultToString(), and string.

2860  {
2861  const std::string& result =
2862  PrintTestPartResultToString(test_part_result);
2863  printf("%s\n", result.c_str());
2864  fflush(stdout);
2865  // If the test program runs in Visual Studio or a debugger, the
2866  // following statements add the test part result message to the Output
2867  // window such that the user can double-click on it to jump to the
2868  // corresponding source code location; otherwise they do nothing.
2869 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
2870  // We don't call OutputDebugString*() on Windows Mobile, as printing
2871  // to stdout is done by OutputDebugString() there already - we don't
2872  // want the same message printed twice.
2873  ::OutputDebugStringA(result.c_str());
2874  ::OutputDebugStringA("\n");
2875 #endif
2876 }
const char * string
Definition: Conv.cpp:212
static std::string PrintTestPartResultToString(const TestPartResult &test_part_result)
Definition: gtest.cc:2850
static void testing::internal::PrintTestPartResult ( const TestPartResult test_part_result)
static

Definition at line 2860 of file gtest.cc.

References PrintTestPartResultToString(), and string.

Referenced by testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd().

2860  {
2861  const std::string& result =
2862  PrintTestPartResultToString(test_part_result);
2863  printf("%s\n", result.c_str());
2864  fflush(stdout);
2865  // If the test program runs in Visual Studio or a debugger, the
2866  // following statements add the test part result message to the Output
2867  // window such that the user can double-click on it to jump to the
2868  // corresponding source code location; otherwise they do nothing.
2869 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
2870  // We don't call OutputDebugString*() on Windows Mobile, as printing
2871  // to stdout is done by OutputDebugString() there already - we don't
2872  // want the same message printed twice.
2873  ::OutputDebugStringA(result.c_str());
2874  ::OutputDebugStringA("\n");
2875 #endif
2876 }
const char * string
Definition: Conv.cpp:212
static std::string PrintTestPartResultToString(const TestPartResult &test_part_result)
Definition: gtest.cc:2850
static void testing::internal::PrintTestPartResult ( const TestPartResult test_part_result)
static

Definition at line 2860 of file gtest.cc.

References PrintTestPartResultToString(), and string.

Referenced by testing::internal::PrettyUnitTestResultPrinter::OnTestPartResult().

2860  {
2861  const std::string& result =
2862  PrintTestPartResultToString(test_part_result);
2863  printf("%s\n", result.c_str());
2864  fflush(stdout);
2865  // If the test program runs in Visual Studio or a debugger, the
2866  // following statements add the test part result message to the Output
2867  // window such that the user can double-click on it to jump to the
2868  // corresponding source code location; otherwise they do nothing.
2869 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
2870  // We don't call OutputDebugString*() on Windows Mobile, as printing
2871  // to stdout is done by OutputDebugString() there already - we don't
2872  // want the same message printed twice.
2873  ::OutputDebugStringA(result.c_str());
2874  ::OutputDebugStringA("\n");
2875 #endif
2876 }
const char * string
Definition: Conv.cpp:212
static std::string PrintTestPartResultToString(const TestPartResult &test_part_result)
Definition: gtest.cc:2850
static std::string testing::internal::PrintTestPartResultToString ( const TestPartResult test_part_result)
static

Definition at line 2850 of file gtest.cc.

References testing::TestPartResult::file_name(), FormatFileLocation(), testing::TestPartResult::line_number(), testing::TestPartResult::message(), testing::TestPartResultTypeToString(), and testing::TestPartResult::type().

2851  {
2852  return (Message()
2853  << internal::FormatFileLocation(test_part_result.file_name(),
2854  test_part_result.line_number())
2855  << " " << TestPartResultTypeToString(test_part_result.type())
2856  << test_part_result.message()).GetString();
2857 }
static const char * TestPartResultTypeToString(TestPartResult::Type type)
Definition: gtest.cc:2830
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
static std::string testing::internal::PrintTestPartResultToString ( const TestPartResult test_part_result)
static

Definition at line 2850 of file gtest.cc.

References testing::TestPartResult::file_name(), FormatFileLocation(), testing::TestPartResult::line_number(), testing::TestPartResult::message(), testing::TestPartResultTypeToString(), and testing::TestPartResult::type().

Referenced by testing::Test::HasSameFixtureClass(), and PrintTestPartResult().

2851  {
2852  return (Message()
2853  << internal::FormatFileLocation(test_part_result.file_name(),
2854  test_part_result.line_number())
2855  << " " << TestPartResultTypeToString(test_part_result.type())
2856  << test_part_result.message()).GetString();
2857 }
static const char * TestPartResultTypeToString(TestPartResult::Type type)
Definition: gtest.cc:2830
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
static std::string testing::internal::PrintTestPartResultToString ( const TestPartResult test_part_result)
static

Definition at line 2850 of file gtest.cc.

References testing::TestPartResult::file_name(), FormatFileLocation(), testing::TestPartResult::line_number(), testing::TestPartResult::message(), testing::TestPartResultTypeToString(), and testing::TestPartResult::type().

Referenced by PrintTestPartResult(), and testing::TestPartNonfatallyFailed().

2851  {
2852  return (Message()
2853  << internal::FormatFileLocation(test_part_result.file_name(),
2854  test_part_result.line_number())
2855  << " " << TestPartResultTypeToString(test_part_result.type())
2856  << test_part_result.message()).GetString();
2857 }
static const char * TestPartResultTypeToString(TestPartResult::Type type)
Definition: gtest.cc:2830
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
void testing::internal::PrintTo ( wchar_t  wc,
ostream *  os 
)

Definition at line 250 of file gtest-printers.cc.

References GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_, GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_, and GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_.

250  {
251  PrintCharAndCodeTo<wchar_t>(wc, os);
252 }
void testing::internal::PrintTo ( const char *  s,
ostream *  os 
)

Definition at line 320 of file gtest-printers.cc.

References PrintCharsAsStringTo(), and s.

320  {
321  if (s == NULL) {
322  *os << "NULL";
323  } else {
324  *os << ImplicitCast_<const void*>(s) << " pointing to ";
325  PrintCharsAsStringTo(s, strlen(s), os);
326  }
327 }
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo(const CharType *begin, size_t len, ostream *os)
static set< string > s
void testing::internal::PrintTo ( const wchar_t *  s,
ostream *  os 
)

Definition at line 337 of file gtest-printers.cc.

References PrintCharsAsStringTo(), PrintStringTo(), s, and string.

Referenced by PrintAsStringLiteralTo(), and UniversalPrintCharArray().

337  {
338  if (s == NULL) {
339  *os << "NULL";
340  } else {
341  *os << ImplicitCast_<const void*>(s) << " pointing to ";
342  PrintCharsAsStringTo(s, std::wcslen(s), os);
343  }
344 }
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo(const CharType *begin, size_t len, ostream *os)
static set< string > s
template<typename T >
void testing::internal::PrintTo ( const T value,
::std::ostream *  os 
)

Definition at line 454 of file gtest-printers.h.

References c, DefaultPrintTo(), GTEST_API_, and PrintTo().

454  {
455  // DefaultPrintTo() is overloaded. The type of its first two
456  // arguments determine which version will be picked. If T is an
457  // STL-style container, the version for container will be called; if
458  // T is a pointer, the pointer version will be called; otherwise the
459  // generic version will be called.
460  //
461  // Note that we check for container types here, prior to we check
462  // for protocol message types in our operator<<. The rationale is:
463  //
464  // For protocol messages, we want to give people a chance to
465  // override Google Mock's format by defining a PrintTo() or
466  // operator<<. For STL containers, other formats can be
467  // incompatible with Google Mock's format for the container
468  // elements; therefore we check for container types here to ensure
469  // that our format is used.
470  //
471  // The second argument of DefaultPrintTo() is needed to bypass a bug
472  // in Symbian's C++ compiler that prevents it from picking the right
473  // overload between:
474  //
475  // PrintTo(const T& x, ...);
476  // PrintTo(T* x, ...);
477  DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
478 }
void DefaultPrintTo(IsNotContainer, false_type, const T &value,::std::ostream *os)
static const char *const value
Definition: Conv.cpp:50
void testing::internal::PrintTo ( unsigned char  c,
::std::ostream *  os 
)

Definition at line 241 of file gtest-printers.cc.

References c.

241  {
242  PrintCharAndCodeTo<unsigned char>(c, os);
243 }
char c
void testing::internal::PrintTo ( signed char  c,
::std::ostream *  os 
)

Definition at line 244 of file gtest-printers.cc.

References c.

244  {
245  PrintCharAndCodeTo<unsigned char>(c, os);
246 }
char c
void testing::internal::PrintTo ( char  c,
::std::ostream *  os 
)
inline

Definition at line 487 of file gtest-printers.h.

References PrintTo().

487  {
488  // When printing a plain char, we always treat it as unsigned. This
489  // way, the output won't be affected by whether the compiler thinks
490  // char is signed or not.
491  PrintTo(static_cast<unsigned char>(c), os);
492 }
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
char c
void testing::internal::PrintTo ( bool  x,
::std::ostream *  os 
)
inline

Definition at line 495 of file gtest-printers.h.

References GTEST_API_, PrintTo(), and s.

495  {
496  *os << (x ? "true" : "false");
497 }
Definition: InvokeTest.cpp:58
GTEST_API_ void testing::internal::PrintTo ( wchar_t  wc,
::std::ostream *  os 
)
GTEST_API_ void testing::internal::PrintTo ( const char *  s,
::std::ostream *  os 
)
void testing::internal::PrintTo ( char *  s,
::std::ostream *  os 
)
inline

Definition at line 510 of file gtest-printers.h.

References PrintTo().

510  {
511  PrintTo(ImplicitCast_<const char*>(s), os);
512 }
static set< string > s
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
void testing::internal::PrintTo ( const signed char *  s,
::std::ostream *  os 
)
inline

Definition at line 516 of file gtest-printers.h.

References PrintTo().

516  {
517  PrintTo(ImplicitCast_<const void*>(s), os);
518 }
static set< string > s
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
void testing::internal::PrintTo ( signed char *  s,
::std::ostream *  os 
)
inline

Definition at line 519 of file gtest-printers.h.

References PrintTo().

519  {
520  PrintTo(ImplicitCast_<const void*>(s), os);
521 }
static set< string > s
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
void testing::internal::PrintTo ( const unsigned char *  s,
::std::ostream *  os 
)
inline

Definition at line 522 of file gtest-printers.h.

References PrintTo().

522  {
523  PrintTo(ImplicitCast_<const void*>(s), os);
524 }
static set< string > s
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
void testing::internal::PrintTo ( unsigned char *  s,
::std::ostream *  os 
)
inline

Definition at line 525 of file gtest-printers.h.

References GTEST_API_, and PrintTo().

525  {
526  PrintTo(ImplicitCast_<const void*>(s), os);
527 }
static set< string > s
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
GTEST_API_ void testing::internal::PrintTo ( const wchar_t *  s,
::std::ostream *  os 
)
void testing::internal::PrintTo ( wchar_t *  s,
::std::ostream *  os 
)
inline

Definition at line 537 of file gtest-printers.h.

References PrintTo().

537  {
538  PrintTo(ImplicitCast_<const wchar_t*>(s), os);
539 }
static set< string > s
void PrintTo(const ::std::pair< T1, T2 > &value,::std::ostream *os)
void testing::internal::PrintTo ( const ::std::string s,
::std::ostream *  os 
)
inline

Definition at line 565 of file gtest-printers.h.

References GTEST_API_, PrintStringTo(), PrintTo(), folly::pushmi::detail::t, and T.

565  {
566  PrintStringTo(s, os);
567 }
GTEST_API_ void PrintStringTo(const ::std::string &s,::std::ostream *os)
static set< string > s
template<typename T1 , typename T2 >
void testing::internal::PrintTo ( const ::std::pair< T1, T2 > &  value,
::std::ostream *  os 
)

Definition at line 676 of file gtest-printers.h.

References GTEST_DISABLE_MSC_WARNINGS_PUSH_, and testing::gtest_printers_test::Print().

Referenced by testing::internal::UniversalPrinter< T >::Print(), PrintRawArrayTo(), and PrintTo().

676  {
677  *os << '(';
678  // We cannot use UniversalPrint(value.first, os) here, as T1 may be
679  // a reference type. The same for printing value.second.
681  *os << ", ";
683  *os << ')';
684 }
static const char *const value
Definition: Conv.cpp:50
template<typename T >
void testing::internal::PrintTo ( const ReferenceWrapper< T > &  ref,
::std::ostream *  os 
)
std::string testing::internal::ReadEntireFile ( FILE file)

Definition at line 1081 of file gtest-port.cc.

References testing::internal::posix::Abort(), buffer(), GetArgvs(), GetFileSize(), and string.

Referenced by CheckedDowncastToActualType(), ParseGoogleTestFlag(), and testing::internal::GTestLog::~GTestLog().

1081  {
1082  const size_t file_size = GetFileSize(file);
1083  char* const buffer = new char[file_size];
1084 
1085  size_t bytes_last_read = 0; // # of bytes read in the last fread()
1086  size_t bytes_read = 0; // # of bytes read so far
1087 
1088  fseek(file, 0, SEEK_SET);
1089 
1090  // Keeps reading the file until we cannot read further or the
1091  // pre-determined file size is reached.
1092  do {
1093  bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
1094  bytes_read += bytes_last_read;
1095  } while (bytes_last_read > 0 && bytes_read < file_size);
1096 
1097  const std::string content(buffer, bytes_read);
1098  delete[] buffer;
1099 
1100  return content;
1101 }
std::vector< uint8_t > buffer(kBufferSize+16)
size_t GetFileSize(FILE *file)
Definition: gtest-port.cc:1076
const char * string
Definition: Conv.cpp:212
void testing::internal::ReportFailureInUnknownLocation ( TestPartResult::Type  result_type,
const std::string message 
)

Definition at line 2250 of file gtest.cc.

References testing::UnitTest::AddTestPartResult(), and testing::UnitTest::GetInstance().

Referenced by HandleExceptionsInMethodIfSupported(), HandleSehExceptionsInMethodIfSupported(), testing::UnitTest::impl(), and testing::TestPartNonfatallyFailed().

2251  {
2252  // This function is a friend of UnitTest and as such has access to
2253  // AddTestPartResult.
2254  UnitTest::GetInstance()->AddTestPartResult(
2255  result_type,
2256  NULL, // No info about the source file where the exception occurred.
2257  -1, // We have no info on which line caused the exception.
2258  message,
2259  ""); // No stack trace, either.
2260 }
Definition: test.c:42
void testing::internal::ReportUninterestingCall ( CallReaction  reaction,
const string msg 
)

Definition at line 247 of file gmock-spec-builders.cc.

References Expect(), GMOCK_FLAG, kAllow, kInfo, kInfoVerbosity, kWarn, kWarning, and Log().

Referenced by testing::internal::FunctionMockerBase< R(A1, A2)>::PrintTriedExpectationsLocked(), and testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith().

247  {
248  // Include a stack trace only if --gmock_verbose=info is specified.
249  const int stack_frames_to_skip =
250  GMOCK_FLAG(verbose) == kInfoVerbosity ? 3 : -1;
251  switch (reaction) {
252  case kAllow:
253  Log(kInfo, msg, stack_frames_to_skip);
254  break;
255  case kWarn:
256  Log(kWarning,
257  msg +
258  "\nNOTE: You can safely ignore the above warning unless this "
259  "call should not happen. Do not suppress it by blindly adding "
260  "an EXPECT_CALL() if you don't mean to enforce the call. "
261  "See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#"
262  "knowing-when-to-expect for details.\n",
263  stack_frames_to_skip);
264  break;
265  default: // FAIL
266  Expect(false, NULL, -1, msg);
267  }
268 }
void Expect(bool condition, const char *file, int line, const string &msg)
#define GMOCK_FLAG(name)
Definition: gmock-port.h:70
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
static void testing::internal::SetUpEnvironment ( Environment env)
static

Definition at line 4539 of file gtest.cc.

References testing::Environment::SetUp().

4539 { env->SetUp(); }
static void testing::internal::SetUpEnvironment ( Environment env)
static

Definition at line 4539 of file gtest.cc.

References testing::Environment::SetUp().

Referenced by testing::internal::UnitTestImpl::RunAllTests(), and TearDownEnvironment().

4539 { env->SetUp(); }
static void testing::internal::SetUpEnvironment ( Environment env)
static

Definition at line 4539 of file gtest.cc.

References testing::Environment::SetUp().

4539 { env->SetUp(); }
static bool testing::internal::ShouldRunTestCase ( const TestCase test_case)
static

Definition at line 356 of file gtest.cc.

References add, AlwaysTrue(), AppendUserMessage(), testing::internal::AssertHelper::AssertHelper(), testing::AssertionFailure(), testing::AssertionResult::AssertionResult(), testing::AssertionSuccess(), testing::internal::edit_distance::CalculateOptimalEdits(), testing::internal::FilePath::ConcatPaths(), CountIf(), testing::internal::String::CStringEquals(), testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop(), data_, testing::internal::DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(), testing::internal::DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(), upload::dest, folly::digits10(), testing::internal::UnitTestImpl::disabled_test_count(), testing::TestCase::disabled_test_count(), folly::pushmi::operators::error(), EXPECT_PRED_FORMAT3, testing::internal::UnitTestImpl::failed_test_case_count(), testing::internal::UnitTestImpl::failed_test_count(), testing::TestCase::failed_test_count(), folly::pushmi::operators::filter, testing::internal::UnitTestOptions::FilterMatchesTest(), g_argvs, testing::internal::FilePath::GenerateUniqueFileName(), testing::internal::scoped_ptr< T >::get(), testing::internal::UnitTestOptions::GetAbsolutePathToOutputFile(), GetArgvs(), GetCurrentExecutableName(), testing::internal::UnitTestImpl::GetGlobalTestPartResultReporter(), testing::UnitTest::GetInstance(), testing::internal::UnitTestOptions::GetOutputFormat(), testing::Message::GetString(), testing::TestPartResultArray::GetTestPartResult(), testing::internal::UnitTestImpl::GetTestPartResultReporterForCurrentThread(), GetTestTypeId(), GetTimeInMillis(), GetUnitTestImpl(), GTEST_API_, GTEST_DEFINE_STATIC_MUTEX_(), GTEST_DISABLE_MSC_WARNINGS_POP_, GTEST_DISABLE_MSC_WARNINGS_PUSH_, GTEST_FLAG, GTEST_HAS_GETTIMEOFDAY_, HasOneFailure(), i, ids_, testing::UnitTest::impl(), testing::ScopedFakeTestPartResultReporter::Init(), testing::internal::FilePath::IsAbsolutePath(), testing::internal::FilePath::IsDirectory(), testing::internal::edit_distance::kAdd, testing::TestPartResult::kFatalFailure, testing::internal::edit_distance::kMatch, testing::internal::edit_distance::kRemove, testing::internal::edit_distance::kReplace, kTestTypeIdInGoogleTest, testing::kUniversalFilter, folly::detail::lock(), testing::internal::UnitTestOptions::MatchesFilter(), testing::TestPartResult::message(), testing::Message::Message(), message, testing::AssertionResult::message_, move(), name, now(), testing::AssertionResult::operator!(), testing::Message::operator<<(), testing::internal::AssertHelper::operator=(), gmock_output_test::output, testing::internal::UnitTestOptions::PatternMatchesString(), testing::internal::FilePath::RemoveDirectoryName(), replace(), testing::internal::UnitTestImpl::reportable_disabled_test_count(), testing::TestCase::reportable_disabled_test_count(), testing::internal::UnitTestImpl::reportable_test_count(), testing::TestCase::reportable_test_count(), testing::ScopedFakeTestPartResultReporter::ReportTestPartResult(), testing::internal::DefaultGlobalTestPartResultReporter::ReportTestPartResult(), testing::internal::DefaultPerThreadTestPartResultReporter::ReportTestPartResult(), folly::detail::rhs, testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(), testing::internal::FilePath::Set(), testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(), testing::internal::UnitTestImpl::SetTestPartResultReporterForCurrentThread(), testing::TestCase::should_run(), ShouldRunTestCase(), testing::internal::String::ShowWideCString(), testing::internal::SingleFailureChecker::SingleFailureChecker(), testing::TestPartResultArray::size(), SplitString(), testing::internal::FilePath::string(), string, StringStreamToString(), testing::AssertionResult::success_, testing::internal::UnitTestImpl::successful_test_case_count(), testing::internal::UnitTestImpl::successful_test_count(), testing::TestCase::successful_test_count(), SumOverTestCaseList(), testing::AssertionResult::swap(), folly::f14::swap(), testing::internal::UnitTestImpl::test_case_to_run_count(), testing::internal::UnitTestImpl::test_to_run_count(), testing::TestCase::test_to_run_count(), TestCaseFailed(), TestCasePassed(), testing::internal::UnitTestImpl::total_test_case_count(), testing::internal::UnitTestImpl::total_test_count(), testing::TestCase::total_test_count(), testing::TestPartResult::type(), type, type_, testing::internal::AssertHelper::~AssertHelper(), testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter(), and testing::internal::SingleFailureChecker::~SingleFailureChecker().

356  {
357  return test_case->should_run();
358 }
static bool testing::internal::ShouldRunTestCase ( const TestCase test_case)
static

Definition at line 356 of file gtest.cc.

References add, AlwaysTrue(), AppendUserMessage(), testing::internal::AssertHelper::AssertHelper(), testing::AssertionFailure(), testing::AssertionResult::AssertionResult(), testing::AssertionSuccess(), testing::internal::edit_distance::CalculateOptimalEdits(), testing::internal::FilePath::ConcatPaths(), CountIf(), testing::internal::String::CStringEquals(), testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop(), data_, testing::internal::DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(), testing::internal::DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(), upload::dest, folly::digits10(), testing::internal::UnitTestImpl::disabled_test_count(), testing::TestCase::disabled_test_count(), folly::pushmi::operators::error(), EXPECT_PRED_FORMAT3, testing::internal::UnitTestImpl::failed_test_case_count(), testing::internal::UnitTestImpl::failed_test_count(), testing::TestCase::failed_test_count(), folly::pushmi::operators::filter, testing::internal::UnitTestOptions::FilterMatchesTest(), g_argvs, testing::internal::FilePath::GenerateUniqueFileName(), testing::internal::scoped_ptr< T >::get(), testing::internal::UnitTestOptions::GetAbsolutePathToOutputFile(), GetArgvs(), GetCurrentExecutableName(), testing::internal::UnitTestImpl::GetGlobalTestPartResultReporter(), testing::UnitTest::GetInstance(), testing::internal::UnitTestOptions::GetOutputFormat(), testing::Message::GetString(), testing::TestPartResultArray::GetTestPartResult(), testing::internal::UnitTestImpl::GetTestPartResultReporterForCurrentThread(), GetTestTypeId(), GetTimeInMillis(), GetUnitTestImpl(), GTEST_API_, GTEST_DEFINE_STATIC_MUTEX_(), GTEST_DISABLE_MSC_WARNINGS_POP_, GTEST_DISABLE_MSC_WARNINGS_PUSH_, GTEST_FLAG, GTEST_HAS_GETTIMEOFDAY_, HasOneFailure(), i, ids_, testing::UnitTest::impl(), testing::ScopedFakeTestPartResultReporter::Init(), testing::internal::FilePath::IsAbsolutePath(), testing::internal::FilePath::IsDirectory(), testing::internal::edit_distance::kAdd, testing::TestPartResult::kFatalFailure, testing::internal::edit_distance::kMatch, testing::internal::edit_distance::kRemove, testing::internal::edit_distance::kReplace, kTestTypeIdInGoogleTest, testing::kUniversalFilter, folly::detail::lock(), testing::internal::UnitTestOptions::MatchesFilter(), testing::TestPartResult::message(), testing::Message::Message(), message, testing::AssertionResult::message_, move(), name, now(), testing::AssertionResult::operator!(), testing::Message::operator<<(), testing::internal::AssertHelper::operator=(), gmock_output_test::output, testing::internal::UnitTestOptions::PatternMatchesString(), testing::internal::FilePath::RemoveDirectoryName(), replace(), testing::internal::UnitTestImpl::reportable_disabled_test_count(), testing::TestCase::reportable_disabled_test_count(), testing::internal::UnitTestImpl::reportable_test_count(), testing::TestCase::reportable_test_count(), testing::ScopedFakeTestPartResultReporter::ReportTestPartResult(), testing::internal::DefaultGlobalTestPartResultReporter::ReportTestPartResult(), testing::internal::DefaultPerThreadTestPartResultReporter::ReportTestPartResult(), folly::detail::rhs, testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(), testing::internal::FilePath::Set(), testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(), testing::internal::UnitTestImpl::SetTestPartResultReporterForCurrentThread(), testing::TestCase::should_run(), ShouldRunTestCase(), testing::internal::String::ShowWideCString(), testing::internal::SingleFailureChecker::SingleFailureChecker(), testing::TestPartResultArray::size(), SplitString(), testing::internal::FilePath::string(), string, StringStreamToString(), testing::AssertionResult::success_, testing::internal::UnitTestImpl::successful_test_case_count(), testing::internal::UnitTestImpl::successful_test_count(), testing::TestCase::successful_test_count(), SumOverTestCaseList(), testing::AssertionResult::swap(), folly::f14::swap(), testing::internal::UnitTestImpl::test_case_to_run_count(), testing::internal::UnitTestImpl::test_to_run_count(), testing::TestCase::test_to_run_count(), TestCaseFailed(), TestCasePassed(), testing::internal::UnitTestImpl::total_test_case_count(), testing::internal::UnitTestImpl::total_test_count(), testing::TestCase::total_test_count(), testing::TestPartResult::type(), type, type_, testing::internal::AssertHelper::~AssertHelper(), testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter(), and testing::internal::SingleFailureChecker::~SingleFailureChecker().

356  {
357  return test_case->should_run();
358 }
static bool testing::internal::ShouldRunTestCase ( const TestCase test_case)
static

Definition at line 356 of file gtest.cc.

References testing::TestCase::should_run().

Referenced by ShouldRunTestCase(), and testing::internal::UnitTestImpl::test_case_to_run_count().

356  {
357  return test_case->should_run();
358 }
bool testing::internal::ShouldRunTestOnShard ( int  total_shards,
int  shard_index,
int  test_id 
)
bool testing::internal::ShouldShard ( const char *  total_shards_str,
const char *  shard_index_str,
bool  in_subprocess_for_death_test 
)

Definition at line 4715 of file gtest.cc.

References COLOR_RED, ColoredPrintf(), testing::Message::GetString(), and Int32FromEnvOrDie().

Referenced by testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart(), testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd(), testing::internal::UnitTestImpl::RunAllTests(), TearDownEnvironment(), testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

4717  {
4718  if (in_subprocess_for_death_test) {
4719  return false;
4720  }
4721 
4722  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
4723  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);
4724 
4725  if (total_shards == -1 && shard_index == -1) {
4726  return false;
4727  } else if (total_shards == -1 && shard_index != -1) {
4728  const Message msg = Message()
4729  << "Invalid environment variables: you have "
4730  << kTestShardIndex << " = " << shard_index
4731  << ", but have left " << kTestTotalShards << " unset.\n";
4732  ColoredPrintf(COLOR_RED, msg.GetString().c_str());
4733  fflush(stdout);
4734  exit(EXIT_FAILURE);
4735  } else if (total_shards != -1 && shard_index == -1) {
4736  const Message msg = Message()
4737  << "Invalid environment variables: you have "
4738  << kTestTotalShards << " = " << total_shards
4739  << ", but have left " << kTestShardIndex << " unset.\n";
4740  ColoredPrintf(COLOR_RED, msg.GetString().c_str());
4741  fflush(stdout);
4742  exit(EXIT_FAILURE);
4743  } else if (shard_index < 0 || shard_index >= total_shards) {
4744  const Message msg = Message()
4745  << "Invalid environment variables: we require 0 <= "
4746  << kTestShardIndex << " < " << kTestTotalShards
4747  << ", but you have " << kTestShardIndex << "=" << shard_index
4748  << ", " << kTestTotalShards << "=" << total_shards << ".\n";
4749  ColoredPrintf(COLOR_RED, msg.GetString().c_str());
4750  fflush(stdout);
4751  exit(EXIT_FAILURE);
4752  }
4753 
4754  return total_shards > 1;
4755 }
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2494
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
static const char kTestTotalShards[]
Definition: gtest.cc:176
static const char kTestShardIndex[]
Definition: gtest.cc:174
GTEST_API_ Int32 Int32FromEnvOrDie(const char *env_var, Int32 default_val)
Definition: gtest.cc:4760
bool testing::internal::ShouldUseColor ( bool  stdout_is_tty)

Definition at line 2916 of file gtest.cc.

References CaseInsensitiveCStringEquals(), testing::internal::posix::GetEnv(), and GTEST_FLAG.

Referenced by ColoredPrintf(), main(), TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

2916  {
2917  const char* const gtest_color = GTEST_FLAG(color).c_str();
2918 
2919  if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
2920 #if GTEST_OS_WINDOWS
2921  // On Windows the TERM variable is usually not set, but the
2922  // console there does support colors.
2923  return stdout_is_tty;
2924 #else
2925  // On non-Windows platforms, we rely on the TERM variable.
2926  const char* const term = posix::GetEnv("TERM");
2927  const bool term_supports_color =
2928  String::CStringEquals(term, "xterm") ||
2929  String::CStringEquals(term, "xterm-color") ||
2930  String::CStringEquals(term, "xterm-256color") ||
2931  String::CStringEquals(term, "screen") ||
2932  String::CStringEquals(term, "screen-256color") ||
2933  String::CStringEquals(term, "tmux") ||
2934  String::CStringEquals(term, "tmux-256color") ||
2935  String::CStringEquals(term, "rxvt-unicode") ||
2936  String::CStringEquals(term, "rxvt-unicode-256color") ||
2937  String::CStringEquals(term, "linux") ||
2938  String::CStringEquals(term, "cygwin");
2939  return stdout_is_tty && term_supports_color;
2940 #endif // GTEST_OS_WINDOWS
2941  }
2942 
2943  return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
2944  String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
2945  String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
2946  String::CStringEquals(gtest_color, "1");
2947  // We take "yes", "true", "t", and "1" as meaning "yes". If the
2948  // value is neither one of these nor "auto", we treat it as "no" to
2949  // be conservative.
2950 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
template<typename E >
void testing::internal::Shuffle ( internal::Random random,
std::vector< E > *  v 
)
inline

Definition at line 333 of file gtest-internal-inl.h.

References ShuffleRange().

Referenced by operator<<(), testing::TestCase::ShuffleTests(), testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

333  {
334  ShuffleRange(random, 0, static_cast<int>(v->size()), v);
335 }
Integral2 random(Integral1 low, Integral2 up)
void ShuffleRange(internal::Random *random, int begin, int end, std::vector< E > *v)
template<typename E >
void testing::internal::ShuffleRange ( internal::Random random,
int  begin,
int  end,
std::vector< E > *  v 
)

Definition at line 312 of file gtest-internal-inl.h.

References testing::internal::Random::Generate(), GTEST_CHECK_, folly::size(), and folly::f14::swap().

Referenced by operator<<(), PrintOnOneLine(), Shuffle(), testing::internal::UnitTestImpl::ShuffleTests(), testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

313  {
314  const int size = static_cast<int>(v->size());
315  GTEST_CHECK_(0 <= begin && begin <= size)
316  << "Invalid shuffle range start " << begin << ": must be in range [0, "
317  << size << "].";
318  GTEST_CHECK_(begin <= end && end <= size)
319  << "Invalid shuffle range finish " << end << ": must be in range ["
320  << begin << ", " << size << "].";
321 
322  // Fisher-Yates shuffle, from
323  // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
324  for (int range_width = end - begin; range_width >= 2; range_width--) {
325  const int last_in_range = begin + range_width - 1;
326  const int selected = begin + random->Generate(range_width);
327  std::swap((*v)[selected], (*v)[last_in_range]);
328  }
329 }
Integral2 random(Integral1 low, Integral2 up)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
bool testing::internal::SkipPrefix ( const char *  prefix,
const char **  pstr 
)

Definition at line 5001 of file gtest.cc.

Referenced by testing::internal::CodeLocation::CodeLocation(), HasGoogleTestFlagPrefix(), PrintOnOneLine(), TEST(), and testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty().

5001  {
5002  const size_t prefix_len = strlen(prefix);
5003  if (strncmp(*pstr, prefix, prefix_len) == 0) {
5004  *pstr += prefix_len;
5005  return true;
5006  }
5007  return false;
5008 }
bool prefix(Cursor &c, uint32_t expected)
void testing::internal::SplitString ( const ::std::string str,
char  delimiter,
::std::vector< ::std::string > *  dest 
)

Definition at line 922 of file gtest.cc.

References AlwaysTrue().

Referenced by testing::internal::CodeLocation::CodeLocation(), ParseGoogleTestFlag(), and ShouldRunTestCase().

923  {
924  ::std::vector< ::std::string> parsed;
925  ::std::string::size_type pos = 0;
926  while (::testing::internal::AlwaysTrue()) {
927  const ::std::string::size_type colon = str.find(delimiter, pos);
928  if (colon == ::std::string::npos) {
929  parsed.push_back(str.substr(pos));
930  break;
931  } else {
932  parsed.push_back(str.substr(pos, colon - pos));
933  pos = colon + 1;
934  }
935  }
936  dest->swap(parsed);
937 }
GTEST_API_ bool AlwaysTrue()
Definition: gtest.cc:4988
std::string testing::internal::StringFromGTestEnv ( const char *  flag,
const char *  default_val 
)

Definition at line 1229 of file gtest-port.cc.

References FlagToEnvVar(), testing::internal::posix::GetEnv(), string, and value.

Referenced by FlagToEnvVar(), and testing::GetDefaultFilter().

1229  {
1230 #if defined(GTEST_GET_STRING_FROM_ENV_)
1231  return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
1232 #endif // defined(GTEST_GET_STRING_FROM_ENV_)
1233  const std::string env_var = FlagToEnvVar(flag);
1234  const char* value = posix::GetEnv(env_var.c_str());
1235  if (value != NULL) {
1236  return value;
1237  }
1238 
1239  // As a special case for the 'output' flag, if GTEST_OUTPUT is not
1240  // set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
1241  // system. The value of XML_OUTPUT_FILE is a filename without the
1242  // "xml:" prefix of GTEST_OUTPUT.
1243  //
1244  // The net priority order after flag processing is thus:
1245  // --gtest_output command line flag
1246  // GTEST_OUTPUT environment variable
1247  // XML_OUTPUT_FILE environment variable
1248  // 'default_value'
1249  if (strcmp(flag, "output") == 0) {
1250  value = posix::GetEnv("XML_OUTPUT_FILE");
1251  if (value != NULL) {
1252  return std::string("xml:") + value;
1253  }
1254  }
1255  return default_value;
1256 }
static once_flag flag
Definition: Random.cpp:75
static std::string FlagToEnvVar(const char *flag)
Definition: gtest-port.cc:1134
static const char *const value
Definition: Conv.cpp:50
const char * string
Definition: Conv.cpp:212
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
std::string testing::internal::StringStreamToString ( ::std::stringstream *  stream)

Definition at line 1982 of file gtest.cc.

References ch, folly::test::end(), start, and string.

Referenced by CmpHelperFloatingPointEQ(), testing::internal::XmlUnitTestResultPrinter::EscapeXmlText(), FloatingPointLE(), testing::Message::GetString(), testing::internal::XmlUnitTestResultPrinter::OnTestIterationEnd(), ShouldRunTestCase(), and WideStringToUtf8().

1982  {
1983  const ::std::string& str = ss->str();
1984  const char* const start = str.c_str();
1985  const char* const end = start + str.length();
1986 
1987  std::string result;
1988  result.reserve(2 * (end - start));
1989  for (const char* ch = start; ch != end; ++ch) {
1990  if (*ch == '\0') {
1991  result += "\\0"; // Replaces NUL with "\\0";
1992  } else {
1993  result += *ch;
1994  }
1995  }
1996 
1997  return result;
1998 }
auto ch
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
auto start
const char * string
Definition: Conv.cpp:212
std::string testing::internal::StripTrailingSpaces ( std::string  str)
inline

Definition at line 2284 of file gtest-port.h.

References IsSpace().

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

2284  {
2285  std::string::iterator it = str.end();
2286  while (it != str.begin() && IsSpace(*--it))
2287  it = str.erase(it);
2288  return str;
2289 }
bool IsSpace(char ch)
Definition: gtest-port.h:2263
static int testing::internal::SumOverTestCaseList ( const std::vector< TestCase * > &  case_list,
int(TestCase::*)() const  method 
)
static

Definition at line 335 of file gtest.cc.

References i, and sum().

336  {
337  int sum = 0;
338  for (size_t i = 0; i < case_list.size(); i++) {
339  sum += (case_list[i]->*method)();
340  }
341  return sum;
342 }
std::atomic< int64_t > sum(0)
static int testing::internal::SumOverTestCaseList ( const std::vector< TestCase * > &  case_list,
int(TestCase::*)() const  method 
)
static
static int testing::internal::SumOverTestCaseList ( const std::vector< TestCase * > &  case_list,
int(TestCase::*)() const  method 
)
static

Definition at line 335 of file gtest.cc.

References i, and sum().

336  {
337  int sum = 0;
338  for (size_t i = 0; i < case_list.size(); i++) {
339  sum += (case_list[i]->*method)();
340  }
341  return sum;
342 }
std::atomic< int64_t > sum(0)
static void testing::internal::TearDownEnvironment ( Environment env)
static

Definition at line 4540 of file gtest.cc.

References COLOR_RED, ColoredPrintf(), failed, FILE, testing::internal::UnitTestOptions::FilterMatchesTest(), testing::internal::UnitTestImpl::FilterTests(), testing::internal::posix::FOpen(), for_each(), ForEach(), forever, g_help_flag, testing::internal::posix::GetEnv(), GetNextRandomSeed(), GetRandomSeedFromFlag(), testing::Message::GetString(), GetTimeInMillis(), GTEST_FLAG, GTestIsInitialized(), testing::Test::HasFatalFailure(), i, Int32FromEnvOrDie(), testing::TestInfo::is_disabled_, testing::TestInfo::matches_filter_, testing::internal::UnitTestOptions::MatchesFilter(), testing::TestInfo::name(), testing::TestCase::name(), testing::TestEventListener::OnEnvironmentsSetUpEnd(), testing::TestEventListener::OnEnvironmentsSetUpStart(), testing::TestEventListener::OnEnvironmentsTearDownEnd(), testing::TestEventListener::OnEnvironmentsTearDownStart(), testing::TestEventListener::OnTestIterationEnd(), testing::TestEventListener::OnTestIterationStart(), testing::TestEventListener::OnTestProgramEnd(), testing::TestEventListener::OnTestProgramStart(), ParseInt32(), random(), repeat(), testing::internal::UnitTestImpl::RunAllTests(), testing::TestCase::set_should_run(), SetUpEnvironment(), testing::TestCase::should_run(), testing::TestInfo::should_run_, ShouldRunTestOnShard(), ShouldShard(), start, string, testing::Environment::TearDown(), TearDownEnvironment(), testing::TestCase::test_info_list(), and WriteToShardStatusFileIfNeeded().

4540 { env->TearDown(); }
static void testing::internal::TearDownEnvironment ( Environment env)
static

Definition at line 4540 of file gtest.cc.

References COLOR_RED, ColoredPrintf(), failed, FILE, testing::internal::UnitTestOptions::FilterMatchesTest(), testing::internal::UnitTestImpl::FilterTests(), testing::internal::posix::FOpen(), for_each(), ForEach(), forever, g_help_flag, testing::internal::posix::GetEnv(), GetNextRandomSeed(), GetRandomSeedFromFlag(), testing::Message::GetString(), GetTimeInMillis(), GTEST_FLAG, GTestIsInitialized(), testing::Test::HasFatalFailure(), i, Int32FromEnvOrDie(), testing::TestInfo::is_disabled_, testing::TestInfo::matches_filter_, testing::internal::UnitTestOptions::MatchesFilter(), testing::TestInfo::name(), testing::TestCase::name(), testing::TestEventListener::OnEnvironmentsSetUpEnd(), testing::TestEventListener::OnEnvironmentsSetUpStart(), testing::TestEventListener::OnEnvironmentsTearDownEnd(), testing::TestEventListener::OnEnvironmentsTearDownStart(), testing::TestEventListener::OnTestIterationEnd(), testing::TestEventListener::OnTestIterationStart(), testing::TestEventListener::OnTestProgramEnd(), testing::TestEventListener::OnTestProgramStart(), ParseInt32(), random(), repeat(), testing::internal::UnitTestImpl::RunAllTests(), testing::TestCase::set_should_run(), SetUpEnvironment(), testing::TestCase::should_run(), testing::TestInfo::should_run_, ShouldRunTestOnShard(), ShouldShard(), start, string, testing::Environment::TearDown(), TearDownEnvironment(), testing::TestCase::test_info_list(), and WriteToShardStatusFileIfNeeded().

4540 { env->TearDown(); }
static void testing::internal::TearDownEnvironment ( Environment env)
static

Definition at line 4540 of file gtest.cc.

References testing::Environment::TearDown().

Referenced by testing::internal::UnitTestImpl::RunAllTests(), and TearDownEnvironment().

4540 { env->TearDown(); }
std::string testing::internal::TempDir ( )

Definition at line 1058 of file gtest-port.cc.

References testing::internal::posix::GetEnv(), and string.

Referenced by CheckedDowncastToActualType(), and testing::TEST_F().

1058  {
1059 #if GTEST_OS_WINDOWS_MOBILE
1060  return "\\temp\\";
1061 #elif GTEST_OS_WINDOWS
1062  const char* temp_dir = posix::GetEnv("TEMP");
1063  if (temp_dir == NULL || temp_dir[0] == '\0')
1064  return "\\temp\\";
1065  else if (temp_dir[strlen(temp_dir) - 1] == '\\')
1066  return temp_dir;
1067  else
1068  return std::string(temp_dir) + "\\";
1069 #elif GTEST_OS_LINUX_ANDROID
1070  return "/sdcard/";
1071 #else
1072  return "/tmp/";
1073 #endif // GTEST_OS_WINDOWS_MOBILE
1074 }
const char * string
Definition: Conv.cpp:212
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
testing::internal::TEST ( IsXDigitTest  ,
WorksForNarrowAscii   
)

Definition at line 64 of file gtest-port_test.cc.

References EXPECT_FALSE, EXPECT_TRUE, and IsXDigit().

Referenced by testing::gmock_matchers_test::AllArgsHelper::AllArgsHelper(), testing::gmock_matchers_test::AStruct::AStruct(), testing::gmock_matchers_test::ConvertibleFromAny::ConvertibleFromAny(), testing::internal::Derived::Derived(), testing::gmock_matchers_test::Derived::Derived(), testing::gmock_matchers_test::ReferencesBarOrIsZeroImpl::DescribeNegationTo(), testing::gmock_matchers_test::IsHalfOfMatcher::DescribeNegationTo(), testing::gmock_matchers_test::EvenMatcherImpl::DescribeTo(), testing::gmock_matchers_test::NewEvenMatcherImpl::DescribeTo(), testing::gmock_matchers_test::DivisibleByImpl::divider(), testing::internal::UnitTestHelper::GetSortedTests(), testing::gmock_matchers_test::IntReferenceWrapper::IntReferenceWrapper(), testing::gmock_matchers_test::Type< T >::IsTypeOf(), testing::gmock_matchers_test::DerivedClass::k(), testing::gmock_matchers_test::GreaterThanMatcher::MatchAndExplain(), testing::gmock_matchers_test::PolymorphicIsEvenImpl::MatchAndExplain(), testing::gmock_matchers_test::MATCHER_P(), testing::internal::NoDefaultContructor::NoDefaultContructor(), testing::internal::Castable::operator Base(), testing::internal::ConstCastable::operator Base(), testing::internal::ConstAndNonConstCastable::operator Base(), testing::gmock_matchers_test::ConvertibleToBool::operator bool(), testing::gmock_matchers_test::IsGreaterThan::operator()(), testing::gmock_matchers_test::Functor::operator()(), testing::gmock_matchers_test::PolymorphicFunctor::operator()(), testing::gmock_matchers_test::ReferencingFunctor::operator()(), testing::gmock_matchers_test::ConstPropagatingPtr< T >::operator*(), operator<<(), testing::gmock_matchers_test::NotCopyable::operator>=(), testing::internal::ExpectationTester::SetCallCount(), testing::CurrentTestInfoTest::TearDownTestCase(), TEST(), testing::gmock_matchers_test::TEST(), testing::TEST(), TEST(), testing::gmock_matchers_test::FloatingPointNearTest< RawType >::TestNearMatches(), testing::internal::To::To(), testing::gmock_matchers_test::Unprintable::Unprintable(), and testing::gmock_matchers_test::IntValue::value().

64  {
65  EXPECT_TRUE(IsXDigit('0'));
66  EXPECT_TRUE(IsXDigit('9'));
67  EXPECT_TRUE(IsXDigit('A'));
68  EXPECT_TRUE(IsXDigit('F'));
69  EXPECT_TRUE(IsXDigit('a'));
70  EXPECT_TRUE(IsXDigit('f'));
71 
72  EXPECT_FALSE(IsXDigit('-'));
73  EXPECT_FALSE(IsXDigit('g'));
74  EXPECT_FALSE(IsXDigit('G'));
75 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::internal::TEST ( IsXDigitTest  ,
ReturnsFalseForNarrowNonAscii   
)

Definition at line 77 of file gtest-port_test.cc.

References EXPECT_FALSE, and IsXDigit().

77  {
78  EXPECT_FALSE(IsXDigit('\x80'));
79  EXPECT_FALSE(IsXDigit(static_cast<char>('0' | '\x80')));
80 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::internal::TEST ( IsXDigitTest  ,
WorksForWideAscii   
)

Definition at line 82 of file gtest-port_test.cc.

References EXPECT_FALSE, EXPECT_TRUE, and IsXDigit().

82  {
83  EXPECT_TRUE(IsXDigit(L'0'));
84  EXPECT_TRUE(IsXDigit(L'9'));
85  EXPECT_TRUE(IsXDigit(L'A'));
86  EXPECT_TRUE(IsXDigit(L'F'));
87  EXPECT_TRUE(IsXDigit(L'a'));
88  EXPECT_TRUE(IsXDigit(L'f'));
89 
90  EXPECT_FALSE(IsXDigit(L'-'));
91  EXPECT_FALSE(IsXDigit(L'g'));
92  EXPECT_FALSE(IsXDigit(L'G'));
93 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::internal::TEST ( IsXDigitTest  ,
ReturnsFalseForWideNonAscii   
)

Definition at line 95 of file gtest-port_test.cc.

References EXPECT_FALSE, and IsXDigit().

95  {
96  EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(0x80)));
97  EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x80)));
98  EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x100)));
99 }
bool IsXDigit(char ch)
Definition: gtest-port.h:2269
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::internal::TEST ( ApiTest  ,
UnitTestImmutableAccessorsWork   
)

Definition at line 114 of file gtest-unittest-api_test.cc.

References ASSERT_EQ, testing::UnitTest::disabled_test_count(), EXPECT_EQ, EXPECT_STREQ, testing::UnitTest::GetInstance(), testing::internal::UnitTestHelper::GetSortedTestCases(), name, testing::UnitTest::test_case_to_run_count(), testing::UnitTest::test_to_run_count(), testing::UnitTest::total_test_case_count(), and testing::UnitTest::total_test_count().

114  {
115  UnitTest* unit_test = UnitTest::GetInstance();
116 
117  ASSERT_EQ(2 + kTypedTestCases, unit_test->total_test_case_count());
118  EXPECT_EQ(1 + kTypedTestCases, unit_test->test_case_to_run_count());
119  EXPECT_EQ(2, unit_test->disabled_test_count());
120  EXPECT_EQ(5 + kTypedTests, unit_test->total_test_count());
121  EXPECT_EQ(3 + kTypedTests, unit_test->test_to_run_count());
122 
123  const TestCase** const test_cases = UnitTestHelper::GetSortedTestCases();
124 
125  EXPECT_STREQ("ApiTest", test_cases[0]->name());
126  EXPECT_STREQ("DISABLED_Test", test_cases[1]->name());
127 #if GTEST_HAS_TYPED_TEST
128  EXPECT_STREQ("TestCaseWithCommentTest/0", test_cases[2]->name());
129 #endif // GTEST_HAS_TYPED_TEST
130 
131  delete[] test_cases;
132 
133  // The following lines initiate actions to verify certain methods in
134  // FinalSuccessChecker::TearDown.
135 
136  // Records a test property to verify TestResult::GetTestProperty().
137  RecordProperty("key", "value");
138 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * name
Definition: http_parser.c:437
testing::internal::TEST ( ImplicitCastTest  ,
ConvertsPointers   
)

Definition at line 119 of file gtest-port_test.cc.

References EXPECT_TRUE.

119  {
120  Derived derived(0);
121  EXPECT_TRUE(&derived == ::testing::internal::ImplicitCast_<Base*>(&derived));
122 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::internal::TEST ( ImplicitCastTest  ,
CanUseInheritance   
)

Definition at line 124 of file gtest-port_test.cc.

References EXPECT_EQ.

124  {
125  Derived derived(1);
126  Base base = ::testing::internal::ImplicitCast_<Base>(derived);
127  EXPECT_EQ(derived.member(), base.member());
128 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
AtomicCounter< T, DeterministicAtomic > Base
testing::internal::TEST ( ImplicitCastTest  ,
CanUseNonConstCastOperator   
)

Definition at line 142 of file gtest-port_test.cc.

References EXPECT_TRUE.

142  {
143  bool converted = false;
144  Castable castable(&converted);
145  Base base = ::testing::internal::ImplicitCast_<Base>(castable);
146  EXPECT_TRUE(converted);
147 }
AtomicCounter< T, DeterministicAtomic > Base
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::internal::TEST ( ApiTest  ,
TestCaseImmutableAccessorsWork   
)

Definition at line 147 of file gtest-unittest-api_test.cc.

References ASSERT_EQ, ASSERT_TRUE, testing::TestCase::disabled_test_count(), EXPECT_EQ, EXPECT_FALSE, EXPECT_STREQ, EXPECT_TRUE, testing::internal::UnitTestHelper::FindTestCase(), testing::internal::UnitTestHelper::GetSortedTests(), IsNull(), name, testing::TestCase::name(), testing::TestCase::should_run(), testing::TestCase::test_to_run_count(), testing::TestCase::total_test_count(), and testing::TestCase::type_param().

147  {
148  const TestCase* test_case = UnitTestHelper::FindTestCase("ApiTest");
149  ASSERT_TRUE(test_case != NULL);
150 
151  EXPECT_STREQ("ApiTest", test_case->name());
152  EXPECT_TRUE(IsNull(test_case->type_param()));
153  EXPECT_TRUE(test_case->should_run());
154  EXPECT_EQ(1, test_case->disabled_test_count());
155  EXPECT_EQ(3, test_case->test_to_run_count());
156  ASSERT_EQ(4, test_case->total_test_count());
157 
158  const TestInfo** tests = UnitTestHelper::GetSortedTests(test_case);
159 
160  EXPECT_STREQ("DISABLED_Dummy1", tests[0]->name());
161  EXPECT_STREQ("ApiTest", tests[0]->test_case_name());
162  EXPECT_TRUE(IsNull(tests[0]->value_param()));
163  EXPECT_TRUE(IsNull(tests[0]->type_param()));
164  EXPECT_FALSE(tests[0]->should_run());
165 
166  EXPECT_STREQ("TestCaseDisabledAccessorsWork", tests[1]->name());
167  EXPECT_STREQ("ApiTest", tests[1]->test_case_name());
168  EXPECT_TRUE(IsNull(tests[1]->value_param()));
169  EXPECT_TRUE(IsNull(tests[1]->type_param()));
170  EXPECT_TRUE(tests[1]->should_run());
171 
172  EXPECT_STREQ("TestCaseImmutableAccessorsWork", tests[2]->name());
173  EXPECT_STREQ("ApiTest", tests[2]->test_case_name());
174  EXPECT_TRUE(IsNull(tests[2]->value_param()));
175  EXPECT_TRUE(IsNull(tests[2]->type_param()));
176  EXPECT_TRUE(tests[2]->should_run());
177 
178  EXPECT_STREQ("UnitTestImmutableAccessorsWork", tests[3]->name());
179  EXPECT_STREQ("ApiTest", tests[3]->test_case_name());
180  EXPECT_TRUE(IsNull(tests[3]->value_param()));
181  EXPECT_TRUE(IsNull(tests[3]->type_param()));
182  EXPECT_TRUE(tests[3]->should_run());
183 
184  delete[] tests;
185  tests = NULL;
186 
187 #if GTEST_HAS_TYPED_TEST
188  test_case = UnitTestHelper::FindTestCase("TestCaseWithCommentTest/0");
189  ASSERT_TRUE(test_case != NULL);
190 
191  EXPECT_STREQ("TestCaseWithCommentTest/0", test_case->name());
192  EXPECT_STREQ(GetTypeName<int>().c_str(), test_case->type_param());
193  EXPECT_TRUE(test_case->should_run());
194  EXPECT_EQ(0, test_case->disabled_test_count());
195  EXPECT_EQ(1, test_case->test_to_run_count());
196  ASSERT_EQ(1, test_case->total_test_count());
197 
198  tests = UnitTestHelper::GetSortedTests(test_case);
199 
200  EXPECT_STREQ("Dummy", tests[0]->name());
201  EXPECT_STREQ("TestCaseWithCommentTest/0", tests[0]->test_case_name());
202  EXPECT_TRUE(IsNull(tests[0]->value_param()));
203  EXPECT_STREQ(GetTypeName<int>().c_str(), tests[0]->type_param());
204  EXPECT_TRUE(tests[0]->should_run());
205 
206  delete[] tests;
207 #endif // GTEST_HAS_TYPED_TEST
208 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * name
Definition: http_parser.c:437
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
AssertionResult IsNull(const char *str)
testing::internal::TEST ( ImplicitCastTest  ,
CanUseConstCastOperatorOnConstValues   
)

Definition at line 161 of file gtest-port_test.cc.

References EXPECT_TRUE.

161  {
162  bool converted = false;
163  const ConstCastable const_castable(&converted);
164  Base base = ::testing::internal::ImplicitCast_<Base>(const_castable);
165  EXPECT_TRUE(converted);
166 }
AtomicCounter< T, DeterministicAtomic > Base
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::internal::TEST ( ImplicitCastTest  ,
CanSelectBetweenConstAndNonConstCasrAppropriately   
)

Definition at line 186 of file gtest-port_test.cc.

References EXPECT_FALSE, and EXPECT_TRUE.

186  {
187  bool converted = false;
188  bool const_converted = false;
189  ConstAndNonConstCastable castable(&converted, &const_converted);
190  Base base = ::testing::internal::ImplicitCast_<Base>(castable);
191  EXPECT_TRUE(converted);
192  EXPECT_FALSE(const_converted);
193 
194  converted = false;
195  const_converted = false;
196  const ConstAndNonConstCastable const_castable(&converted, &const_converted);
197  base = ::testing::internal::ImplicitCast_<Base>(const_castable);
198  EXPECT_FALSE(converted);
199  EXPECT_TRUE(const_converted);
200 }
AtomicCounter< T, DeterministicAtomic > Base
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::internal::TEST ( ImplicitCastTest  ,
CanUseImplicitConstructor   
)

Definition at line 207 of file gtest-port_test.cc.

References EXPECT_TRUE, and folly::to().

207  {
208  bool converted = false;
209  To to = ::testing::internal::ImplicitCast_<To>(&converted);
210  (void)to;
211  EXPECT_TRUE(converted);
212 }
std::enable_if< detail::is_chrono_conversion< Tgt, Src >::value, Tgt >::type to(const Src &value)
Definition: Conv.h:677
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::internal::TEST ( ApiTest  ,
TestCaseDisabledAccessorsWork   
)

Definition at line 210 of file gtest-unittest-api_test.cc.

References ASSERT_EQ, ASSERT_TRUE, testing::TestCase::disabled_test_count(), EXPECT_EQ, EXPECT_FALSE, EXPECT_STREQ, EXPECT_TRUE, testing::internal::UnitTestHelper::FindTestCase(), testing::TestCase::GetTestInfo(), IsNull(), testing::TestCase::name(), testing::TestCase::should_run(), testing::TestCase::test_to_run_count(), testing::TestCase::total_test_count(), and testing::TestCase::type_param().

210  {
211  const TestCase* test_case = UnitTestHelper::FindTestCase("DISABLED_Test");
212  ASSERT_TRUE(test_case != NULL);
213 
214  EXPECT_STREQ("DISABLED_Test", test_case->name());
215  EXPECT_TRUE(IsNull(test_case->type_param()));
216  EXPECT_FALSE(test_case->should_run());
217  EXPECT_EQ(1, test_case->disabled_test_count());
218  EXPECT_EQ(0, test_case->test_to_run_count());
219  ASSERT_EQ(1, test_case->total_test_count());
220 
221  const TestInfo* const test_info = test_case->GetTestInfo(0);
222  EXPECT_STREQ("Dummy2", test_info->name());
223  EXPECT_STREQ("DISABLED_Test", test_info->test_case_name());
224  EXPECT_TRUE(IsNull(test_info->value_param()));
225  EXPECT_TRUE(IsNull(test_info->type_param()));
226  EXPECT_FALSE(test_info->should_run());
227 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
AssertionResult IsNull(const char *str)
testing::internal::TEST ( IteratorTraitsTest  ,
WorksForSTLContainerIterators   
)

Definition at line 214 of file gtest-port_test.cc.

References testing::StaticAssertTypeEq().

214  {
215  StaticAssertTypeEq<int,
216  IteratorTraits< ::std::vector<int>::const_iterator>::value_type>();
217  StaticAssertTypeEq<bool,
218  IteratorTraits< ::std::list<bool>::iterator>::value_type>();
219 }
bool StaticAssertTypeEq()
Definition: gtest.h:2150
testing::internal::TEST ( IteratorTraitsTest  ,
WorksForPointerToNonConst   
)

Definition at line 221 of file gtest-port_test.cc.

221  {
222  StaticAssertTypeEq<char, IteratorTraits<char*>::value_type>();
223  StaticAssertTypeEq<const void*, IteratorTraits<const void**>::value_type>();
224 }
testing::internal::TEST ( IteratorTraitsTest  ,
WorksForPointerToConst   
)

Definition at line 226 of file gtest-port_test.cc.

References testing::StaticAssertTypeEq().

226  {
227  StaticAssertTypeEq<char, IteratorTraits<const char*>::value_type>();
228  StaticAssertTypeEq<const void*,
229  IteratorTraits<const void* const*>::value_type>();
230 }
bool StaticAssertTypeEq()
Definition: gtest.h:2150
testing::internal::TEST ( ApiTest  ,
DISABLED_Dummy1   
)

Definition at line 231 of file gtest-unittest-api_test.cc.

231 {}
testing::internal::TEST ( DISABLED_Test  ,
Dummy2   
)

Definition at line 232 of file gtest-unittest-api_test.cc.

232 {}
testing::internal::TEST ( ScopedPtrTest  ,
DefinesElementType   
)

Definition at line 234 of file gtest-port_test.cc.

234  {
235  StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
236 }
testing::internal::TEST ( GtestCheckSyntaxTest  ,
BehavesLikeASingleStatement   
)

Definition at line 240 of file gtest-port_test.cc.

References AlwaysFalse(), AlwaysTrue(), and GTEST_CHECK_.

240  {
241  if (AlwaysFalse())
242  GTEST_CHECK_(false) << "This should never be executed; "
243  "It's a compilation test only.";
244 
245  if (AlwaysTrue())
246  GTEST_CHECK_(true);
247  else
248  ; // NOLINT
249 
250  if (AlwaysFalse())
251  ; // NOLINT
252  else
253  GTEST_CHECK_(true) << "";
254 }
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
GTEST_API_ bool AlwaysTrue()
Definition: gtest.cc:4988
testing::internal::TEST ( GtestCheckSyntaxTest  ,
WorksWithSwitch   
)

Definition at line 256 of file gtest-port_test.cc.

References GTEST_CHECK_.

256  {
257  switch (0) {
258  case 1:
259  break;
260  default:
261  GTEST_CHECK_(true);
262  }
263 
264  switch (0)
265  case 0:
266  GTEST_CHECK_(true) << "Check failed in switch case";
267 }
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
testing::internal::TEST ( FormatFileLocationTest  ,
FormatsFileLocation   
)

Definition at line 270 of file gtest-port_test.cc.

References EXPECT_PRED_FORMAT2, FormatFileLocation(), and testing::IsSubstring().

270  {
271  EXPECT_PRED_FORMAT2(IsSubstring, "foo.cc", FormatFileLocation("foo.cc", 42));
272  EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation("foo.cc", 42));
273 }
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1606
testing::internal::TEST ( FormatFileLocationTest  ,
FormatsUnknownFile   
)

Definition at line 275 of file gtest-port_test.cc.

References EXPECT_PRED_FORMAT2, FormatFileLocation(), and testing::IsSubstring().

275  {
277  IsSubstring, "unknown file", FormatFileLocation(NULL, 42));
279 }
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1606
testing::internal::TEST ( FormatFileLocationTest  ,
FormatsUknownLine   
)

Definition at line 281 of file gtest-port_test.cc.

References EXPECT_EQ, and FormatFileLocation().

281  {
282  EXPECT_EQ("foo.cc:", FormatFileLocation("foo.cc", -1));
283 }
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
testing::internal::TEST ( FormatFileLocationTest  ,
FormatsUknownFileAndLine   
)

Definition at line 285 of file gtest-port_test.cc.

References EXPECT_EQ, and FormatFileLocation().

285  {
286  EXPECT_EQ("unknown file:", FormatFileLocation(NULL, -1));
287 }
::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
testing::internal::TEST ( FormatCompilerIndependentFileLocationTest  ,
FormatsFileLocation   
)

Definition at line 290 of file gtest-port_test.cc.

References EXPECT_EQ, and FormatCompilerIndependentFileLocation().

290  {
291  EXPECT_EQ("foo.cc:42", FormatCompilerIndependentFileLocation("foo.cc", 42));
292 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
::std::string FormatCompilerIndependentFileLocation(const char *file, int line)
Definition: gtest-port.cc:898
testing::internal::TEST ( FormatCompilerIndependentFileLocationTest  ,
FormatsUknownFile   
)

Definition at line 294 of file gtest-port_test.cc.

References EXPECT_EQ, and FormatCompilerIndependentFileLocation().

294  {
295  EXPECT_EQ("unknown file:42",
297 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
::std::string FormatCompilerIndependentFileLocation(const char *file, int line)
Definition: gtest-port.cc:898
testing::internal::TEST ( FormatCompilerIndependentFileLocationTest  ,
FormatsUknownLine   
)

Definition at line 299 of file gtest-port_test.cc.

References EXPECT_EQ, and FormatCompilerIndependentFileLocation().

299  {
300  EXPECT_EQ("foo.cc", FormatCompilerIndependentFileLocation("foo.cc", -1));
301 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
::std::string FormatCompilerIndependentFileLocation(const char *file, int line)
Definition: gtest-port.cc:898
testing::internal::TEST ( FormatCompilerIndependentFileLocationTest  ,
FormatsUknownFileAndLine   
)

Definition at line 303 of file gtest-port_test.cc.

References ASSERT_EQ, data, dummy(), EXPECT_EQ, FormatCompilerIndependentFileLocation(), GetThreadCount(), i, folly::detail::lock(), testing::internal::Mutex::Lock(), mutex, TEST(), and testing::internal::Mutex::Unlock().

303  {
304  EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1));
305 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
::std::string FormatCompilerIndependentFileLocation(const char *file, int line)
Definition: gtest-port.cc:898
testing::internal::TEST ( GetThreadCountTest  ,
ReturnsZeroWhenUnableToCountThreads   
)

Definition at line 348 of file gtest-port_test.cc.

References EXPECT_EQ, and GetThreadCount().

348  {
349  EXPECT_EQ(0U, GetThreadCount());
350 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
size_t GetThreadCount()
Definition: gtest-port.cc:169
testing::internal::TEST ( GtestCheckDeathTest  ,
DiesWithCorrectOutputOnFailure   
)

Definition at line 353 of file gtest-port_test.cc.

References EXPECT_DEATH_IF_SUPPORTED, GTEST_CHECK_, regex, and TEST().

353  {
354  const bool a_false_condition = false;
355  const char regex[] =
356 #ifdef _MSC_VER
357  "gtest-port_test\\.cc\\(\\d+\\):"
358 #elif GTEST_USES_POSIX_RE
359  "gtest-port_test\\.cc:[0-9]+"
360 #else
361  "gtest-port_test\\.cc:\\d+"
362 #endif // _MSC_VER
363  ".*a_false_condition.*Extra info.*";
364 
365  EXPECT_DEATH_IF_SUPPORTED(GTEST_CHECK_(a_false_condition) << "Extra info",
366  regex);
367 }
regex
Definition: CMakeCache.txt:563
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
#define EXPECT_DEATH_IF_SUPPORTED(statement, regex)
testing::internal::TEST ( RegexEngineSelectionTest  ,
SelectsCorrectRegexEngine   
)

Definition at line 384 of file gtest-port_test.cc.

References ASSERT_FALSE, folly::empty(), EXPECT_FALSE, EXPECT_NONFATAL_FAILURE, EXPECT_PRED1, EXPECT_STREQ, EXPECT_TRUE, testing::internal::RE::FullMatch(), GTEST_USES_POSIX_RE, testing::internal::RE::PartialMatch(), testing::internal::RE::pattern(), simple, string, TEST(), testing::TYPED_TEST(), and testing::TYPED_TEST_CASE().

384  {
385 #if !GTEST_USES_PCRE
386 # if GTEST_HAS_POSIX_RE
387 
389 
390 # else
391 
392  EXPECT_TRUE(GTEST_USES_SIMPLE_RE);
393 
394 # endif
395 #endif // !GTEST_USES_PCRE
396 }
#define GTEST_USES_POSIX_RE
Definition: gtest-port.h:437
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::internal::TEST ( CaptureTest  ,
CapturesStdout   
)

Definition at line 932 of file gtest-port_test.cc.

References CaptureStdout(), EXPECT_EQ, EXPECT_STREQ, GetCapturedStdout(), and string.

932  {
933  CaptureStdout();
934  fprintf(stdout, "abc");
935  EXPECT_STREQ("abc", GetCapturedStdout().c_str());
936 
937  CaptureStdout();
938  fprintf(stdout, "def%cghi", '\0');
939  EXPECT_EQ(::std::string("def\0ghi", 7), ::std::string(GetCapturedStdout()));
940 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * string
Definition: Conv.cpp:212
std::string GetCapturedStdout()
testing::internal::TEST ( CaptureTest  ,
CapturesStderr   
)

Definition at line 942 of file gtest-port_test.cc.

References CaptureStderr(), EXPECT_EQ, EXPECT_STREQ, GetCapturedStderr(), and string.

942  {
943  CaptureStderr();
944  fprintf(stderr, "jkl");
945  EXPECT_STREQ("jkl", GetCapturedStderr().c_str());
946 
947  CaptureStderr();
948  fprintf(stderr, "jkl%cmno", '\0');
949  EXPECT_EQ(::std::string("jkl\0mno", 7), ::std::string(GetCapturedStderr()));
950 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
std::string GetCapturedStderr()
const char * string
Definition: Conv.cpp:212
testing::internal::TEST ( CaptureTest  ,
CapturesStdoutAndStderr   
)

Definition at line 953 of file gtest-port_test.cc.

References CaptureStderr(), CaptureStdout(), EXPECT_STREQ, GetCapturedStderr(), and GetCapturedStdout().

953  {
954  CaptureStdout();
955  CaptureStderr();
956  fprintf(stdout, "pqr");
957  fprintf(stderr, "stu");
958  EXPECT_STREQ("pqr", GetCapturedStdout().c_str());
959  EXPECT_STREQ("stu", GetCapturedStderr().c_str());
960 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
std::string GetCapturedStderr()
std::string GetCapturedStdout()
testing::internal::TEST ( CaptureDeathTest  ,
CannotReenterStdoutCapture   
)

Definition at line 962 of file gtest-port_test.cc.

References CaptureStdout(), EXPECT_DEATH_IF_SUPPORTED, and GetCapturedStdout().

962  {
963  CaptureStdout();
965  "Only one stdout capturer can exist at a time");
967 
968  // We cannot test stderr capturing using death tests as they use it
969  // themselves.
970 }
#define EXPECT_DEATH_IF_SUPPORTED(statement, regex)
std::string GetCapturedStdout()
testing::internal::TEST ( ThreadLocalTest  ,
DefaultConstructorInitializesToDefaultValues   
)

Definition at line 974 of file gtest-port_test.cc.

References EXPECT_EQ, EXPECT_TRUE, and testing::internal::ThreadLocal< T >::get().

974  {
975  ThreadLocal<int> t1;
976  EXPECT_EQ(0, t1.get());
977 
978  ThreadLocal<void*> t2;
979  EXPECT_TRUE(t2.get() == NULL);
980 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::internal::TEST ( ThreadLocalTest  ,
SingleParamConstructorInitializesToParam   
)

Definition at line 982 of file gtest-port_test.cc.

References EXPECT_EQ, testing::internal::ThreadLocal< T >::get(), and i.

982  {
983  ThreadLocal<int> t1(123);
984  EXPECT_EQ(123, t1.get());
985 
986  int i = 0;
987  ThreadLocal<int*> t2(&i);
988  EXPECT_EQ(&i, t2.get());
989 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
testing::internal::TEST ( ThreadLocalTest  ,
ValueDefaultContructorIsNotRequiredForParamVersion   
)

Definition at line 997 of file gtest-port_test.cc.

References bar, and testing::internal::ThreadLocal< T >::pointer().

997  {
998  ThreadLocal<NoDefaultContructor> bar(NoDefaultContructor("foo"));
999  bar.pointer();
1000 }
folly::Singleton< int > bar
testing::internal::TEST ( ThreadLocalTest  ,
GetAndPointerReturnSameValue   
)

Definition at line 1002 of file gtest-port_test.cc.

References EXPECT_EQ, testing::internal::ThreadLocal< T >::get(), testing::internal::ThreadLocal< T >::pointer(), and testing::internal::ThreadLocal< T >::set().

1002  {
1003  ThreadLocal<std::string> thread_local_string;
1004 
1005  EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
1006 
1007  // Verifies the condition still holds after calling set.
1008  thread_local_string.set("foo");
1009  EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
1010 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
testing::internal::TEST ( ThreadLocalTest  ,
PointerAndConstPointerReturnSameValue   
)

Definition at line 1012 of file gtest-port_test.cc.

References ASSERT_EQ, ASSERT_FALSE, testing::internal::Mutex::AssertHeld(), dummy(), EXPECT_DEATH_IF_SUPPORTED, EXPECT_EQ, EXPECT_STREQ, EXPECT_TRUE, FALSE, testing::internal::ThreadLocal< T >::get(), GTEST_CHECK_, GTEST_CHECK_POSIX_SUCCESS_, GTEST_DISALLOW_ASSIGN_, GTEST_DISALLOW_COPY_AND_ASSIGN_, i, folly::detail::lock(), m, mutex, mutex_, testing::internal::ThreadLocal< T >::pointer(), testing::internal::scoped_ptr< T >::reset(), testing::internal::ThreadLocal< T >::set(), folly::size(), string, T, shell_builder::temp, TEST(), TRUE, and value.

1012  {
1013  ThreadLocal<std::string> thread_local_string;
1014  const ThreadLocal<std::string>& const_thread_local_string =
1015  thread_local_string;
1016 
1017  EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
1018 
1019  thread_local_string.set("foo");
1020  EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
1021 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
testing::internal::TEST_F ( ListenerTest  ,
DoesFoo   
)

Definition at line 158 of file gtest-listener_test.cc.

References SUCCEED.

Referenced by testing::gmock_matchers_test::EMString(), testing::TestInfoTest::GetTestResult(), operator<<(), testing::SetUpTestCaseTest::SetUp(), testing::internal::ListenerTest::TearDown(), testing::CurrentTestInfoTest::TearDownTestCase(), testing::TEST(), testing::TEST_F(), and testing::gmock_matchers_test::FloatingPointNearTest< RawType >::TestNearMatches().

158  {
159  // Test execution order within a test case is not guaranteed so we are not
160  // recording the test name.
161  g_events->push_back("ListenerTest::* Test Body");
162  SUCCEED(); // Triggers OnTestPartResult.
163 }
#define SUCCEED()
Definition: gtest.h:1831
std::vector< std::string > * g_events
testing::internal::TEST_F ( ListenerTest  ,
DoesBar   
)

Definition at line 165 of file gtest-listener_test.cc.

References SUCCEED.

165  {
166  g_events->push_back("ListenerTest::* Test Body");
167  SUCCEED(); // Triggers OnTestPartResult.
168 }
#define SUCCEED()
Definition: gtest.h:1831
std::vector< std::string > * g_events
static bool testing::internal::TestCaseFailed ( const TestCase test_case)
static

Definition at line 350 of file gtest.cc.

References testing::TestCase::Failed(), and testing::TestCase::should_run().

Referenced by testing::internal::UnitTestImpl::failed_test_case_count(), and ShouldRunTestCase().

350  {
351  return test_case->should_run() && test_case->Failed();
352 }
static bool testing::internal::TestCaseFailed ( const TestCase test_case)
static

Definition at line 350 of file gtest.cc.

References testing::TestCase::Failed(), and testing::TestCase::should_run().

350  {
351  return test_case->should_run() && test_case->Failed();
352 }
static bool testing::internal::TestCaseFailed ( const TestCase test_case)
static

Definition at line 350 of file gtest.cc.

References testing::TestCase::Failed(), and testing::TestCase::should_run().

350  {
351  return test_case->should_run() && test_case->Failed();
352 }
static bool testing::internal::TestCasePassed ( const TestCase test_case)
static

Definition at line 345 of file gtest.cc.

References testing::TestCase::Passed(), and testing::TestCase::should_run().

Referenced by ShouldRunTestCase(), and testing::internal::UnitTestImpl::successful_test_case_count().

345  {
346  return test_case->should_run() && test_case->Passed();
347 }
static bool testing::internal::TestCasePassed ( const TestCase test_case)
static

Definition at line 345 of file gtest.cc.

References testing::TestCase::Passed(), and testing::TestCase::should_run().

345  {
346  return test_case->should_run() && test_case->Passed();
347 }
static bool testing::internal::TestCasePassed ( const TestCase test_case)
static

Definition at line 345 of file gtest.cc.

References testing::TestCase::Passed(), and testing::TestCase::should_run().

345  {
346  return test_case->should_run() && test_case->Passed();
347 }
char testing::internal::ToLower ( char  ch)
inline

Definition at line 2277 of file gtest-port.h.

Referenced by ConvertIdentifierNameToWords().

2277  {
2278  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2279 }
auto ch
char testing::internal::ToUpper ( char  ch)
inline

Definition at line 2280 of file gtest-port.h.

Referenced by FlagToEnvVar().

2280  {
2281  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2282 }
auto ch
template<typename Tuple , typename Func , typename OutIter >
OutIter testing::internal::TransformTupleValues ( Func  f,
const Tuple &  t,
OutIter  out 
)
template<typename MatcherTuple , typename ValueTuple >
bool testing::internal::TupleMatches ( const MatcherTuple matcher_tuple,
const ValueTuple &  value_tuple 
)

Definition at line 796 of file gmock-matchers.h.

References GTEST_COMPILE_ASSERT_, testing::Matches(), and value.

Referenced by testing::internal::TuplePrefix< 0 >::ExplainMatchFailuresTo(), testing::internal::TypedExpectation< F >::ExplainMatchResultTo(), testing::internal::OnCallSpec< F >::Matches(), and testing::internal::TypedExpectation< F >::Matches().

797  {
798  // Makes sure that matcher_tuple and value_tuple have the same
799  // number of fields.
802  matcher_and_value_have_different_numbers_of_fields);
804  Matches(matcher_tuple, value_tuple);
805 }
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:1032
internal::MatcherAsPredicate< M > Matches(M matcher)
static const char *const value
Definition: Conv.cpp:50
template<typename T >
void testing::internal::UniversalPrint ( const T value,
::std::ostream *  os 
)

Definition at line 852 of file gtest-printers.h.

References testing::gtest_printers_test::Print(), and T.

Referenced by testing::SafeMatcherCastImpl< T >::Cast(), DefaultPrintTo(), testing::internal::ComparisonBase< D, Rhs, Op >::Impl< Lhs >::DescribeNegationTo(), testing::internal::HasSubstrMatcher< StringType >::DescribeNegationTo(), testing::internal::StartsWithMatcher< StringType >::DescribeNegationTo(), testing::internal::EndsWithMatcher< StringType >::DescribeNegationTo(), testing::internal::ContainerEqMatcher< Container >::DescribeNegationTo(), testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::DescribeNegationTo(), testing::internal::ComparisonBase< D, Rhs, Op >::Impl< Lhs >::DescribeTo(), testing::internal::HasSubstrMatcher< StringType >::DescribeTo(), testing::internal::StartsWithMatcher< StringType >::DescribeTo(), testing::internal::EndsWithMatcher< StringType >::DescribeTo(), testing::internal::ContainerEqMatcher< Container >::DescribeTo(), testing::internal::BoundSecondMatcher< Tuple2Matcher, Second >::Impl< T >::DescribeTo(), testing::internal::StrEqualityMatcher< StringType >::DescribeToHelper(), testing::internal::TuplePrefix< N >::ExplainMatchFailuresTo(), testing::internal::ContainerEqMatcher< Container >::MatchAndExplain(), testing::internal::WhenSortedByMatcher< Comparator, ContainerMatcher >::Impl< LhsContainer >::MatchAndExplain(), testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::MatchAndExplain(), MatchPrintAndExplain(), testing::internal::UniversalPrinter< T & >::Print(), testing::internal::UniversalTersePrinter< T >::Print(), testing::internal::UniversalTersePrinter< T & >::Print(), testing::internal::UniversalTersePrinter< const char * >::Print(), testing::internal::UniversalTersePrinter< char * >::Print(), testing::internal::UniversalTersePrinter< wchar_t * >::Print(), PrintRawArrayTo(), testing::gtest_printers_test::TEST(), testing::internal::FunctionMockerBase< R(A1, A2)>::UntypedDescribeUninterestingCall(), testing::internal::FunctionMockerBase< R(A1, A2)>::UntypedPrintArgs(), and foo::StreamableTemplateInFoo< T >::value().

852  {
853  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
854  // UniversalPrinter with T directly.
855  typedef T T1;
857 }
#define T(v)
Definition: http_parser.c:233
static const char *const value
Definition: Conv.cpp:50
void testing::internal::UniversalPrintArray ( const char *  begin,
size_t  len,
ostream *  os 
)

Definition at line 309 of file gtest-printers.cc.

References UniversalPrintCharArray().

309  {
310  UniversalPrintCharArray(begin, len, os);
311 }
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void UniversalPrintCharArray(const CharType *begin, size_t len, ostream *os)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
void testing::internal::UniversalPrintArray ( const wchar_t *  begin,
size_t  len,
ostream *  os 
)

Definition at line 315 of file gtest-printers.cc.

References UniversalPrintCharArray().

Referenced by UniversalPrintCharArray().

315  {
316  UniversalPrintCharArray(begin, len, os);
317 }
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void UniversalPrintCharArray(const CharType *begin, size_t len, ostream *os)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
template<typename T >
void testing::internal::UniversalPrintArray ( const T begin,
size_t  len,
::std::ostream *  os 
)

Definition at line 716 of file gtest-printers.h.

References folly::test::begin(), GTEST_API_, PrintRawArrayTo(), and UniversalPrintArray().

716  {
717  if (len == 0) {
718  *os << "{}";
719  } else {
720  *os << "{ ";
721  const size_t kThreshold = 18;
722  const size_t kChunkSize = 8;
723  // If the array has more than kThreshold elements, we'll have to
724  // omit some details by printing only the first and the last
725  // kChunkSize elements.
726  // TODO(wan@google.com): let the user control the threshold using a flag.
727  if (len <= kThreshold) {
728  PrintRawArrayTo(begin, len, os);
729  } else {
730  PrintRawArrayTo(begin, kChunkSize, os);
731  *os << ", ..., ";
732  PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
733  }
734  *os << " }";
735  }
736 }
void PrintRawArrayTo(const T a[], size_t count,::std::ostream *os)
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
GTEST_API_ void testing::internal::UniversalPrintArray ( const char *  begin,
size_t  len,
::std::ostream *  os 
)
GTEST_API_ void testing::internal::UniversalPrintArray ( const wchar_t *  begin,
size_t  len,
::std::ostream *  os 
)
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void testing::internal::UniversalPrintCharArray ( const CharType *  begin,
size_t  len,
ostream *  os 
)
static

Definition at line 286 of file gtest-printers.cc.

References folly::test::begin(), PrintCharsAsStringTo(), PrintStringTo(), PrintTo(), s, string, UniversalPrintArray(), and UniversalPrintCharArray().

287  {
288  // The code
289  // const char kFoo[] = "foo";
290  // generates an array of 4, not 3, elements, with the last one being '\0'.
291  //
292  // Therefore when printing a char array, we don't print the last element if
293  // it's '\0', such that the output matches the string literal as it's
294  // written in the source code.
295  if (len > 0 && begin[len - 1] == '\0') {
296  PrintCharsAsStringTo(begin, len - 1, os);
297  return;
298  }
299 
300  // If, however, the last element in the array is not '\0', e.g.
301  // const char kFoo[] = { 'f', 'o', 'o' };
302  // we must print the entire array. We also print a message to indicate
303  // that the array is not NUL-terminated.
304  PrintCharsAsStringTo(begin, len, os);
305  *os << " (no terminating NUL)";
306 }
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo(const CharType *begin, size_t len, ostream *os)
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void testing::internal::UniversalPrintCharArray ( const CharType *  begin,
size_t  len,
ostream *  os 
)
static

Definition at line 286 of file gtest-printers.cc.

References PrintCharsAsStringTo().

287  {
288  // The code
289  // const char kFoo[] = "foo";
290  // generates an array of 4, not 3, elements, with the last one being '\0'.
291  //
292  // Therefore when printing a char array, we don't print the last element if
293  // it's '\0', such that the output matches the string literal as it's
294  // written in the source code.
295  if (len > 0 && begin[len - 1] == '\0') {
296  PrintCharsAsStringTo(begin, len - 1, os);
297  return;
298  }
299 
300  // If, however, the last element in the array is not '\0', e.g.
301  // const char kFoo[] = { 'f', 'o', 'o' };
302  // we must print the entire array. We also print a message to indicate
303  // that the array is not NUL-terminated.
304  PrintCharsAsStringTo(begin, len, os);
305  *os << " (no terminating NUL)";
306 }
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo(const CharType *begin, size_t len, ostream *os)
template<typename CharType >
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void testing::internal::UniversalPrintCharArray ( const CharType *  begin,
size_t  len,
ostream *  os 
)
static

Definition at line 286 of file gtest-printers.cc.

References folly::test::begin(), PrintCharsAsStringTo(), PrintStringTo(), PrintTo(), s, string, and UniversalPrintArray().

Referenced by UniversalPrintArray(), and UniversalPrintCharArray().

287  {
288  // The code
289  // const char kFoo[] = "foo";
290  // generates an array of 4, not 3, elements, with the last one being '\0'.
291  //
292  // Therefore when printing a char array, we don't print the last element if
293  // it's '\0', such that the output matches the string literal as it's
294  // written in the source code.
295  if (len > 0 && begin[len - 1] == '\0') {
296  PrintCharsAsStringTo(begin, len - 1, os);
297  return;
298  }
299 
300  // If, however, the last element in the array is not '\0', e.g.
301  // const char kFoo[] = { 'f', 'o', 'o' };
302  // we must print the entire array. We also print a message to indicate
303  // that the array is not NUL-terminated.
304  PrintCharsAsStringTo(begin, len, os);
305  *os << " (no terminating NUL)";
306 }
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void PrintCharsAsStringTo(const CharType *begin, size_t len, ostream *os)
template<typename T >
void testing::internal::UniversalTersePrint ( const T value,
::std::ostream *  os 
)
std::string testing::internal::WideStringToUtf8 ( const wchar_t *  str,
int  num_chars 
)

Definition at line 1823 of file gtest.cc.

References CodePointToUtf8(), CreateCodePointFromUtf16SurrogatePair(), i, IsUtf16SurrogatePair(), stream, and StringStreamToString().

Referenced by operator<<(), testing::internal::String::ShowWideCString(), testing::internal::UnitTestRecordPropertyTestHelper::UnitTestRecordProperty(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

1823  {
1824  if (num_chars == -1)
1825  num_chars = static_cast<int>(wcslen(str));
1826 
1827  ::std::stringstream stream;
1828  for (int i = 0; i < num_chars; ++i) {
1829  UInt32 unicode_code_point;
1830 
1831  if (str[i] == L'\0') {
1832  break;
1833  } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
1834  unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
1835  str[i + 1]);
1836  i++;
1837  } else {
1838  unicode_code_point = static_cast<UInt32>(str[i]);
1839  }
1840 
1841  stream << CodePointToUtf8(unicode_code_point);
1842  }
1843  return StringStreamToString(&stream);
1844 }
StreamCodecFactory stream
TypeWithSize< 4 >::UInt UInt32
Definition: gtest-port.h:2495
bool IsUtf16SurrogatePair(wchar_t first, wchar_t second)
Definition: gtest.cc:1794
GTEST_API_ std::string CodePointToUtf8(UInt32 code_point)
Definition: gtest.cc:1759
UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second)
Definition: gtest.cc:1800
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
Definition: gtest.cc:1982
void testing::internal::WriteToShardStatusFileIfNeeded ( )

Definition at line 4693 of file gtest.cc.

References COLOR_RED, ColoredPrintf(), FILE, testing::internal::posix::FOpen(), and testing::internal::posix::GetEnv().

Referenced by testing::internal::UnitTestImpl::RunAllTests(), TearDownEnvironment(), and testing::internal::GTestFlagSaver::~GTestFlagSaver().

4693  {
4694  const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
4695  if (test_shard_file != NULL) {
4696  FILE* const file = posix::FOpen(test_shard_file, "w");
4697  if (file == NULL) {
4699  "Could not write to the test shard status file \"%s\" "
4700  "specified by the %s environment variable.\n",
4701  test_shard_file, kTestShardStatusFile);
4702  fflush(stdout);
4703  exit(EXIT_FAILURE);
4704  }
4705  fclose(file);
4706  }
4707 }
FILE * FOpen(const char *path, const char *mode)
Definition: gtest-port.h:2367
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
static const char kTestShardStatusFile[]
Definition: gtest.cc:178
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
GMockOutputTest ExpectedCall FILE

Variable Documentation

std::vector< testing::internal::string > testing::internal::g_argvs

Definition at line 387 of file gtest.cc.

Referenced by GetArgvs(), InitGoogleTestImpl(), and ShouldRunTestCase().

GTEST_API_ ThreadLocal< Sequence * > testing::internal::g_gmock_implicit_sequence
const char testing::internal::kAlsoRunDisabledTestsFlag = "also_run_disabled_tests"

Definition at line 89 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kBreakOnFailureFlag = "break_on_failure"

Definition at line 90 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kCatchExceptionsFlag = "catch_exceptions"

Definition at line 91 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kColorEncodedHelpMessage[]
static

Definition at line 5159 of file gtest.cc.

const char testing::internal::kColorEncodedHelpMessage[]
static

Definition at line 5159 of file gtest.cc.

const char testing::internal::kColorEncodedHelpMessage[]
static

Definition at line 5159 of file gtest.cc.

const char testing::internal::kColorFlag = "color"

Definition at line 92 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kCurrentDirectoryString = "./"
const char testing::internal::kDeathTestStyleFlag = "death_test_style"

Definition at line 50 of file gtest-death-test-internal.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kDeathTestUseFork = "death_test_use_fork"

Definition at line 51 of file gtest-death-test-internal.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kErrorVerbosity = "error"
const char testing::internal::kFilterFlag = "filter"

Definition at line 93 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kFlagfileFlag = "flagfile"

Definition at line 103 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlagsOnlyImpl().

const char testing::internal::kInternalRunDeathTestFlag = "internal_run_death_test"

Definition at line 52 of file gtest-death-test-internal.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kListTestsFlag = "list_tests"

Definition at line 94 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const BiggestInt testing::internal::kMaxBiggestInt
Initial value:
=
~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1))
long long BiggestInt
Definition: gtest-port.h:2241

Definition at line 2439 of file gtest-port.h.

const UInt32 testing::internal::kMaxCodePoint1 = (static_cast<UInt32>(1) << 7) - 1

Definition at line 1733 of file gtest.cc.

const UInt32 testing::internal::kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1

Definition at line 1736 of file gtest.cc.

const UInt32 testing::internal::kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1

Definition at line 1739 of file gtest.cc.

const UInt32 testing::internal::kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1

Definition at line 1742 of file gtest.cc.

const int testing::internal::kMaxRandomSeed = 99999
const char testing::internal::kOutputFlag = "output"

Definition at line 95 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kPathSeparator = '/'

Definition at line 85 of file gtest-filepath.cc.

Referenced by IsPathSeparator(), and testing::internal::FilePath::Normalize().

const char testing::internal::kPrintTimeFlag = "print_time"

Definition at line 96 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kRandomSeedFlag = "random_seed"

Definition at line 97 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kRepeatFlag = "repeat"

Definition at line 98 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kShuffleFlag = "shuffle"

Definition at line 99 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kStackTraceDepthFlag = "stack_trace_depth"

Definition at line 100 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const char testing::internal::kStackTraceMarker = "\nStack trace:\n"
const int testing::internal::kStdErrFileno = STDERR_FILENO

Definition at line 89 of file gtest-port.cc.

const int testing::internal::kStdOutFileno = STDOUT_FILENO

Definition at line 88 of file gtest-port.cc.

const char testing::internal::kStreamResultToFlag = "stream_result_to"

Definition at line 101 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const TypeId testing::internal::kTestTypeIdInGoogleTest = GetTestTypeId()
const char testing::internal::kThrowOnFailureFlag = "throw_on_failure"

Definition at line 102 of file gtest-internal-inl.h.

Referenced by ParseGoogleTestFlag().

const int testing::internal::kTypedTestCases = 0
const int testing::internal::kTypedTests = 0
const char testing::internal::kTypeParamLabel[] = "TypeParam"
static

Definition at line 3006 of file gtest.cc.

const char testing::internal::kTypeParamLabel[] = "TypeParam"
static

Definition at line 3006 of file gtest.cc.

const char testing::internal::kTypeParamLabel[] = "TypeParam"
static

Definition at line 3006 of file gtest.cc.

const char testing::internal::kUnknownFile = "unknown file"

Definition at line 876 of file gtest-port.cc.

const char testing::internal::kValueParamLabel[] = "GetParam()"
static

Definition at line 3007 of file gtest.cc.

const char testing::internal::kValueParamLabel[] = "GetParam()"
static

Definition at line 3007 of file gtest.cc.

const char testing::internal::kValueParamLabel[] = "GetParam()"
static

Definition at line 3007 of file gtest.cc.

const char testing::internal::kWarningVerbosity = "warning"