Quick Links:

bal | bbl | bdl | bsl

Classes | Functions

Component bslim_gtestutil
[Package bslim]

Provide facilities for debugging BDE with gtest. More...

Classes

class  testing::internal::bslim_Gtestutil_TestingStreamHolder

Functions

 testing::internal::bslim_Gtestutil_TestingStreamHolder::bslim_Gtestutil_TestingStreamHolder (bsl::ostream *stream)
 testing::internal::bslim_Gtestutil_TestingStreamHolder::operator bsl::ostream * () const
void bsl::PrintTo (const string &value, ostream *stream)
void bsl::PrintTo (const BloombergLP::bslstl::StringRef &value, ostream *stream)
template<class TYPE >
void bsl::PrintTo (const optional< TYPE > &value, ostream *stream)

Detailed Description

Outline
Purpose:
Provide facilities for debugging BDE with gtest.
Description:
The bslim_gtestutil component provides utitlities to facilitate testing with Google Test (GTest).
Usage:
Suppose we have a string str that we want to output:
  bsl::string str =
                 "No matter where you go, There you are! -- Buckaroo Banzai";
Call PrintTo, passing the string and a pointer to a bsl::ostream:
  PrintTo(str, &cout);
  cout << endl;
Which results in the string being streamed to standard output, surrounded by double quotes:
  "No matter where you go, There you are! -- Buckaroo Banzai"

Function Documentation

testing::internal::bslim_Gtestutil_TestingStreamHolder::bslim_Gtestutil_TestingStreamHolder ( bsl::ostream *  stream  )  [explicit, inherited]

Create an object bound to the specified stream.

testing::internal::bslim_Gtestutil_TestingStreamHolder::operator bsl::ostream * (  )  const [inherited]

Implicitly return a pointer to the stream this object is bound to.

void bsl::PrintTo ( const string &  value,
ostream *  stream 
)

Write the specified value to the specified *stream, surrounded by double quotes.

Write the specified value to the specified *stream, surrounded by double quotes, writing non-printable characters with \x... escapes.

void bsl::PrintTo ( const BloombergLP::bslstl::StringRef &  value,
ostream *  stream 
)

Write the specified value to the specified *stream, surrounded by double quotes.

template<class TYPE >
void bsl::PrintTo ( const optional< TYPE > &  value,
ostream *  stream 
)

Write the specified value to the specified *stream, surrounded by double quotes.