[Cppunit-devel] Wrap Function in CompilerOutput
Brought to you by:
blep
From: Phil E. <Phi...@Ve...> - 2002-09-04 09:19:26
|
I have been testing the CPPUnit using C++Builder and have found a problem with the wrap function in that it does not print out the failure line correctly. This is smething to do with the std::string library and the way in which the constructor works. When constructing a string with the same name as a parameter there appears to be a conflict between the destruction and construction. To overcome this I gave the second use a different name and this corrected the problem. Here is a copy of the corrected code. std::string CompilerOutputter::wrap( std::string message ) { Lines lines =3D splitMessageIntoLines( message ); std::string wrapped; for ( Lines::iterator it =3D lines.begin(); it !=3D lines.end(); ++it = ) { std::string line( *it ); const int maxLineLength =3D 80; int index =3D0; while ( index < line.length() ) { std::string line2( line.substr( index, maxLineLength ) ); wrapped +=3D line2; index +=3D maxLineLength; if ( index < line.length() ) wrapped +=3D "\n"; } wrapped +=3D '\n'; } return wrapped; } I know that there has been development for MVC6, but do you know of any developments for a windows front end using C Builder, as I am currently using a console application. Like the functionality available. Phil Elliott. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Phil Elliott > Development Manager >=20 > VEMIS > Vehicle Telematics Solutions >=20 > 18 Pebble Close Business Village, > Amington, Tamworth, Staffordshire, B77 4RD. > Tel : 01827 311912 Fax: 01827 311916 =20 > Phi...@ve... www.vemis.com >=20 > A DaimlerChrysler Company > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >=20 >=20 |