Re: Re: Refactored and almost complete PacketTest.cpp

Hey Peter

My replies in bold

Peter Dimov wrote:

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!

I will put these in ;-)
Why is testInvalidateHeader() not just like testInvalidatePayload() I mean the copying?

Yes it should be… I will make the necessary changes
Or maybe the copying part should be tested in a separate function and make testInvalidatePayload() just as simple as testInvalidateHeader()? What do you think?

This looks better …
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?

I read it but forgot to make the change ;-) Thanks for spotting this… They will be removed…
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

Would you like to post a relpy?


This post is a reply to:
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...)

No follow-ups yet.