Re: [Cppunit-devel] Test result output (was: news features...)
Brought to you by:
blep
From: Duane M. <dua...@ma...> - 2001-10-05 16:15:16
|
--- At Fri, 5 Oct 2001 17:26:56 +0200, Baptiste Lepilleur wrote: >> >> There is a problem with missing itoa() (not only) on Linux, gcc >> version >> 2.95.2. I have attached a fix. > > Thanks, I'll include that this evening. The baka I am completly forgot to >check if itoa was ANSI (aren't an ANSI equivalent anyway ?) itoa() is most certainly not ANSI and there is no ANSI equivalent. >- return ::itoa( value, buffer, 10 ); >+ ::sprintf( buffer, "%d", value ); While this replacement is ANSI, its not really in keeping with the rest of the code style. The rest of the code is largely C++ standard library. Therefore the replacement should be something like the toString() function in assertionTraits<>. Maybe that function should be brought out entirely and converted to a toString template function instead: template <T> std::string toString( const T& x ) { OStringStream ost; ost << x; return ost.str(); } ..Duane |