Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bsls::BslTestUtil Struct Reference

#include <bsls_bsltestutil.h>

List of all members.

Static Public Member Functions

static void flush ()
static void printStringNoFlush (const char *s)
static void printTab ()
template<class TYPE >
static void callDebugprint (const TYPE &object, const char *leadingString=0, const char *trailingString=0)
template<class FUNCTION_PTR >
static FUNCTION_PTR makeFunctionCallNonInline (FUNCTION_PTR functionPtr)

Detailed Description

This class provides a namespace for utilities that are useful when writing a test driver that is not permitted to use the standard C++ iostream facilities, which is typical of test drivers in the bsl package group.

See Component bsls_bsltestutil


Member Function Documentation

static void bsls::BslTestUtil::flush (  )  [static]

Write any unwritten text in the output buffer to stdout.

static void bsls::BslTestUtil::printStringNoFlush ( const char *  s  )  [static]

Print to the console the specified string, s. Note that the underlying stream is not flushed.

static void bsls::BslTestUtil::printTab (  )  [static]

Print to the console a tab character, and then flush the underlying stream to ensure the text is written.

template<class TYPE >
static void bsls::BslTestUtil::callDebugprint ( const TYPE &  object,
const char *  leadingString = 0,
const char *  trailingString = 0 
) [static]

Print the value of the specified object of the parameterized TYPE to the console. Optionally specify a leadingString, which will be printed before object, and a trailingString, which will be printed after object. If leadingString is 0, then nothing will be printed before object. If trailingString is 0, then nothing will be printed after object.

template<class FUNCTION_PTR >
static FUNCTION_PTR bsls::BslTestUtil::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.


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