[Cppunit-cvs] cppunit2/src/opentest serializer.cpp,1.6,1.7
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-07-02 20:27:49
|
Update of /cvsroot/cppunit/cppunit2/src/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14915/src/opentest Modified Files: serializer.cpp Log Message: * Added a simple test runner that does not rely on the open test framework to run cppunit2 tests. * added CppTL::ConstCharView to wrapper const char *strings. * added CppTL::quoteMultiLineString() * string assertion output actual and expected using quoteMultiLineString(). * added serialize unit test for basic Properties * opentest tests now use the LightTestRunner. Index: serializer.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentest/serializer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** serializer.cpp 2 Jul 2005 09:19:06 -0000 1.6 --- serializer.cpp 2 Jul 2005 20:27:36 -0000 1.7 *************** *** 37,40 **** --- 37,41 ---- ccPositiveReal = 0x2a, // '*' ccPositiveInteger = 0x2b, // '+' + ccEmptyProperties = 0x2c, // ',' ccNegativeInteger = 0x2d, // '-' ccRealDot = 0x2e, // '.' *************** *** 108,112 **** Packets::endSerializeMessage() { ! CPPTL_ASSERT_MESSAGE( !messages_.empty() && messages_.back().length_ == 0, "No message started." ); messages_.back().length_ = distance( messages_.back().position_, serializePos_ ); --- 109,113 ---- Packets::endSerializeMessage() { ! CPPTL_ASSERT_MESSAGE( !messages_.empty() && messages_.back().length_ > 0, "No message started." ); messages_.back().length_ = distance( messages_.back().position_, serializePos_ ); *************** *** 485,488 **** --- 486,490 ---- indexesByString_[ str ] = index; doSerializeInteger( ccNewDictionnaryEntry, str.length() ); + write( ccString ); write( str.c_str(), str.length() ); } *************** *** 690,693 **** --- 692,696 ---- Stream::operator <<( const Properties &properties ) { + Properties::PropertyEnum enumProperties = properties.properties(); if ( properties.hasList() ) { *************** *** 696,701 **** *this << properties.at( valueIndex ); } - Properties::PropertyEnum enumProperties = properties.properties(); if ( enumProperties.hasNext() ) { --- 699,707 ---- *this << properties.at( valueIndex ); } + else if ( !enumProperties.hasNext() ) + { + write( ccEmptyProperties ); + } if ( enumProperties.hasNext() ) { *************** *** 725,728 **** --- 731,736 ---- { unsigned char control = readNextByte(); + if ( control == ccEmptyProperties ) + return *this; if ( control == ccPropertyList ) { |