21 #ifndef LIBRARY_TEST_TARGET_OBJ_H 22 #define LIBRARY_TEST_TARGET_OBJ_H 29 #include <boost/lexical_cast.hpp> 37 using boost::lexical_cast;
55 virtual operator string ()
const;
61 TestTargetObj::TestTargetObj(uint num)
63 , heapData_ (
new string(num,
'*'))
64 , heapArray_ (
new string[num])
66 for (uint i=0; i<cnt_; ++i)
67 heapArray_[i] = lexical_cast<string>(i);
68 cout <<
_Fmt(
"ctor TargetObj(%i) successful\n") % cnt_;
73 TestTargetObj::~TestTargetObj()
77 cout <<
_Fmt(
"dtor ~TargetObj(%i) successful\n") % cnt_;
83 TestTargetObj::operator string ()
const 85 string array_contents =
"{";
86 for (uint i=0; i<cnt_; ++i)
87 array_contents += heapArray_[i]+
",";
90 return _Fmt(
".....TargetObj(%1%): data=\"%2%\", array[%1%]=%3%")
91 % 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.
Simplistic test class runner.