PacketTest refactored and Packet::parse under test - RFC

Dear all,

This is an improved version IMO but not yet complete. I finally managed to get Packet::parse() under the unit test harness..

I have some more tests ( rgd. reference counting ) in my home box… I plan to integrate those with this new version of TestPacket by tomorrow.
I plan to use boost::scoped_ptr to eliminate the memory leaks here too…

Let me know what you all think… Once Packets are under a good unit test harness I plan to put in the changes for BadPacket and refactor the Packet classes ( remove duplicate ref counting etc… )

The template is an attempt so the unit test cases get written by the compiler… We should make sure that the same Packet cases pass when Packet is a base class for Pong as well as for Ping … This is to test for the LSP principle…
I am a bit hazy about this part too ;-) I have attached both files ( with and without template ;-).. I added the template later on and gave it a quick go ;-)
—- cheers atul

Attached Files:

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: PacketTest refactored and Packet::parse under test - RFC
Hi Atul, The tests look quite nice and I find the idea with the template extremely interesting! The template class deserves a separate module and can be used when testing all (more...)