Refactored and almost complete PacketTest.cpp

Hi all

I added many tests…. Some of the interesting ones are the self assignment tests. These are supposed not to change the packet semantically … ( *m_p = *m_p ) should keep the reference count same…

I also removed memory leaks by using the const std::auto_ptr idiom given in
http://www.gotw.ca/publications/using_auto_ptr_effectively.htm
I am looking into the last test ( testFromRawData ) as it is getting a null pointer so right now that test is commented…

Let me know what you all think….

—cheerio atul

Attached Files:

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: Refactored and almost complete PacketTest.cpp
Hi Atul, The tests are nice! I find testInvalidatePayload() particularly interesting! Another interesting test would be to copy a packet that was invalidated, and then call rawPayload() on the copy. Both (more...)