Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bslim::TestUtil Struct Reference

#include <bslim_testutil.h>

List of all members.

Static Public Member Functions

static bool compareText (bslstl::StringRef lhs, bslstl::StringRef rhs, bsl::ostream &errorStream=bsl::cout)
template<class FUNCTION_PTR >
static FUNCTION_PTR makeFunctionCallNonInline (FUNCTION_PTR functionPtr)
template<class T >
static const T & debugRep (const T &arg)
static int debugRep (wchar_t arg)

Detailed Description

This struct provides a namespace for a suite of utility functions that facilitate the creation of BDE-style test drivers.

See Component bslim_testutil


Member Function Documentation

static bool bslim::TestUtil::compareText ( bslstl::StringRef  lhs,
bslstl::StringRef  rhs,
bsl::ostream &  errorStream = bsl::cout 
) [static]

Return true if the specified lhs has the same value as the specified rhs, and false otherwise. Optionally specify an errorStream on which, if lhs and rhs are not the same', a description of how the two strings differ will be written. If errorStream is not supplied, stdout is used.

template<class FUNCTION_PTR >
static FUNCTION_PTR bslim::TestUtil::makeFunctionCallNonInline ( FUNCTION_PTR  functionPtr  )  [static]

Return the specified functionPtr (expected to be a static function pointer) without modification. The value of functionPtr is transformed through identityPtr so that if the caller is in a different component, the compiler will have no way of knowing that this is an identity transform and thus no way of inlining the call.

Note: the Windows optimizer is still able to inline the call, it may be comparing the result of this function with the argument and branching to inline on equality and call on inequality, so the Windows optimizer has to be turned off with # pragma optimize("", off).

Also note that even with an optimizer that can't figure out that this is an identity transform, there is still the possibility of chaining the call.

template<class T >
static const T& bslim::TestUtil::debugRep ( const T &  arg  )  [inline, static]
static int bslim::TestUtil::debugRep ( wchar_t  arg  )  [inline, static]

The documentation for this struct was generated from the following file: