30 #ifndef LIBRARY_TEST_TARGET_OBJ_H 31 #define LIBRARY_TEST_TARGET_OBJ_H 38 #include <boost/lexical_cast.hpp> 46 using boost::lexical_cast;
64 virtual operator string ()
const;
70 TestTargetObj::TestTargetObj(uint num)
72 , heapData_ (
new string(num,
'*'))
73 , heapArray_ (
new string[num])
75 for (uint i=0; i<cnt_; ++i)
76 heapArray_[i] = lexical_cast<string>(i);
77 cout <<
_Fmt(
"ctor TargetObj(%i) successful\n") % cnt_;
82 TestTargetObj::~TestTargetObj()
86 cout <<
_Fmt(
"dtor ~TargetObj(%i) successful\n") % cnt_;
92 TestTargetObj::operator string ()
const 94 string array_contents =
"{";
95 for (uint i=0; i<cnt_; ++i)
96 array_contents += heapArray_[i]+
",";
99 return _Fmt(
".....TargetObj(%1%): data=\"%2%\", array[%1%]=%3%")
100 % cnt_ % *heapData_ % array_contents;
A front-end for using printf-style formatting.
Implementation namespace for support and library code.
Target object to be created by Test-Factories or as Singleton.
Simple test class runner.