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 the original and the copy should have rewritePayload == false because rawPayload() did the rewriting!
Why is testInvalidateHeader() not just like testInvalidatePayload() I mean the copying? Or maybe the copying part should be tested in a separate function and make testInvalidatePayload() just as simple as testInvalidateHeader()? What do you think?
What about the functions getHeader() and getPayload()? I don’t see them called anywhere. Are they obsolete? Have you read my other comments in my reply to your previous post?
Best regards,
Peter
atul wrote: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
