[Cppunit-cvs] cppunit2/include/opentest forwards.h,1.6,1.7 interfaces.h,1.2,1.3 remoteinterfaces.h,1
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-09-06 07:31:52
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16321/include/opentest Modified Files: forwards.h interfaces.h remoteinterfaces.h serializer.h sharedmemorytransport.h Log Message: * fixed compilation without RTTI * revised stringize implementation to allow an additional customization point by overloading toString(). * added test and corrected bug in serialization/packets implementation. Index: sharedmemorytransport.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/sharedmemorytransport.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sharedmemorytransport.h 30 Jun 2005 21:48:09 -0000 1.2 --- sharedmemorytransport.h 6 Sep 2005 07:31:42 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- # include <opentest/forwards.h> + # include <opentest/remoteinterfaces.h> #ifndef OPENTEST_NO_SHAREDMEMORYTRANSPORT *************** *** 33,37 **** }; ! class SharedMemoryTransport { public: --- 34,38 ---- }; ! class SharedMemoryTransport : public MessageTransport { public: *************** *** 45,49 **** virtual ~SharedMemoryTransport(); ! void send( const RemoteMessagePtr &message ); void dispatchReceivedMessages( RemoteMessageServer &server ); --- 46,52 ---- virtual ~SharedMemoryTransport(); ! ! public: // overriden from MessageTransport ! void sendMessage( const RemoteMessagePtr &message ); void dispatchReceivedMessages( RemoteMessageServer &server ); Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/forwards.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** forwards.h 1 Jul 2005 08:19:37 -0000 1.6 --- forwards.h 6 Sep 2005 07:31:42 -0000 1.7 *************** *** 16,19 **** --- 16,20 ---- class TestPlan; class TestPlanEntry; + class TestPlans; class TestRunTracker; class Value; Index: serializer.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/serializer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** serializer.h 4 Jul 2005 08:12:32 -0000 1.6 --- serializer.h 6 Sep 2005 07:31:42 -0000 1.7 *************** *** 10,24 **** namespace OpenTest { ! #ifndef CPPTL_NO_INT64 ! typedef CppTL::int64_t LargestInt; ! typedef CppTL::uint64_t LargestUnsignedInt; ! #else ! typedef int LargestInt; ! typedef unsigned int LargestUnsignedInt; ! #endif ! class Packets { public: typedef unsigned char Byte; --- 10,19 ---- namespace OpenTest { ! typedef CppTL::LargestInt LargestInt; ! typedef CppTL::LargestUnsignedInt LargestUnsignedInt; class Packets { + friend class PacketsTest; public: typedef unsigned char Byte; *************** *** 28,48 **** virtual ~Packets(); ! // for transport communication ! void beginMessage(); ! void received( void *data, Pos length ); ! // Returns the length actual written at dest ! unsigned int send( void *dest, Pos availableLength ); ! void endSerializeMessage(); ! void endExternalMessage(); bool hasPendingMessage() const; Pos getFirstMessageLength(); void discardFirstMessage(); ! // for serialization ! unsigned char serializationReadNextByte(); ! void serializationUngetLastByte(); ! bool serializationRead( void *buffer, Pos length ); ! void serializationWrite( const void *buffer, Pos length ); ! void serializationWrite( Byte byte ); private: --- 23,50 ---- virtual ~Packets(); ! void beginWriteMessage(); ! void endWriteMessage(); ! //void beginReadMessage(); ! //void endReadMessage(); bool hasPendingMessage() const; Pos getFirstMessageLength(); void discardFirstMessage(); ! /// Read the specified length of data from packets ! /// @returns Length of data actually read and written in the buffer. ! Pos read( void *data, Pos length ); ! ! /// Read a single byte ! /// @returns byte read, ccEndBuffer if no byte available for reading. ! Byte readByte(); ! ! /// Seeks read position backward in current message. ! void unreadLastByte(); ! ! /// Write the specified data in the packets ! void write( const void *buffer, Pos length ); ! ! /// Write the specified byte in the packets ! void writeByte( Byte byte ); private: *************** *** 123,127 **** { CPPTL_ASSERT_MESSAGE( packet_ != 0, "No packet available" ); ! return packet_->endInitialized_ - packet_->begin_; } --- 125,129 ---- { CPPTL_ASSERT_MESSAGE( packet_ != 0, "No packet available" ); ! return packet_->endInitialized_ - currentData_; } *************** *** 156,160 **** }; ! void appendPacketIfFull( PacketPos &pos ); Pos distance( const PacketPos &begin, const PacketPos &end ) const; --- 158,162 ---- }; ! void appendPacketIfFull(); Pos distance( const PacketPos &begin, const PacketPos &end ) const; *************** *** 166,171 **** std::deque<MessagePacket> messages_; Packet *packetsHead_; ! PacketPos serializePos_; // Position from where data are read or write for serialization ! PacketPos externalPos_; // Position where data are read/write on transport medium Pos defaultPacketSize_; }; --- 168,173 ---- std::deque<MessagePacket> messages_; Packet *packetsHead_; ! PacketPos readPos_; // Position from where data are read or write for serialization ! PacketPos writePos_; // Position where data are read/write on transport medium Pos defaultPacketSize_; }; *************** *** 209,226 **** private: ! void doSerializeInteger( unsigned char kind, LargestUnsignedInt value ); void doUnserializeInteger( LargestUnsignedInt &value ); void saveDictionnaryEntry( const String &str ); ! void readDictionnaryEntry( unsigned char control, String &str ); void readString( String &str ); ! unsigned char readNextByte(); void ungetLastByte(); void read( void *buffer, unsigned int length ); void write( const void *buffer, unsigned int length ); ! void write( unsigned char byte ); ! static bool isNamedPropertyControl( unsigned char control ); private: --- 211,230 ---- private: ! typedef unsigned char Byte; ! ! void doSerializeInteger( Byte kind, LargestUnsignedInt value ); void doUnserializeInteger( LargestUnsignedInt &value ); void saveDictionnaryEntry( const String &str ); ! void readDictionnaryEntry( Byte control, String &str ); void readString( String &str ); ! Byte readNextByte(); void ungetLastByte(); void read( void *buffer, unsigned int length ); void write( const void *buffer, unsigned int length ); ! void write( Byte byte ); ! static bool isNamedPropertyControl( Byte control ); private: Index: interfaces.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/interfaces.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** interfaces.h 25 Jun 2005 11:05:55 -0000 1.2 --- interfaces.h 6 Sep 2005 07:31:42 -0000 1.3 *************** *** 20,24 **** virtual void getTestPlans() = 0; ! virtual void runTests( const TestPlan &plan ) = 0; virtual void stopTests() = 0; --- 20,24 ---- virtual void getTestPlans() = 0; ! virtual void runTests( const TestPlans &plan ) = 0; virtual void stopTests() = 0; Index: remoteinterfaces.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/remoteinterfaces.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** remoteinterfaces.h 1 Jul 2005 08:19:37 -0000 1.3 --- remoteinterfaces.h 6 Sep 2005 07:31:42 -0000 1.4 *************** *** 49,65 **** ! class OPENTEST_API MessageSender { public: ! virtual ~MessageSender() { } void sendMessage( const RemoteMessagePtr &message ); }; class OPENTEST_API TestDriverProxy : public TestDriverInterface ! , public MessageSender { public: // overridden from TestDriverInterface --- 49,81 ---- ! class OPENTEST_API MessageTransport { public: ! virtual void sendMessage( const RemoteMessagePtr &message ) = 0; ! ! virtual void dispatchReceivedMessages( RemoteMessageServer &server ) = 0; ! }; ! ! ! class OPENTEST_API MessageServerProxy ! { ! public: ! MessageServerProxy(); ! ! virtual ~MessageServerProxy() { } + void setTransport( MessageTransport &transport ); + void sendMessage( const RemoteMessagePtr &message ); + + private: + MessageTransport *transport_; }; class OPENTEST_API TestDriverProxy : public TestDriverInterface ! , public MessageServerProxy { public: // overridden from TestDriverInterface *************** *** 116,120 **** class OPENTEST_API TestRunnerProxy : public TestRunnerInterface ! , public MessageSender { public: // overridden from TestRunnerInterface --- 132,136 ---- class OPENTEST_API TestRunnerProxy : public TestRunnerInterface ! , public MessageServerProxy { public: // overridden from TestRunnerInterface *************** *** 123,127 **** void getTestPlans(); ! void runTests( const TestPlan &plan ); void stopTests(); --- 139,143 ---- void getTestPlans(); ! void runTests( const TestPlans &plan ); void stopTests(); |