Re: New Unit Tests and a refactoring

Hi Atul,

Thanks for the patch! I just pushed it in revno 96 of your branch!

I really liked how you check the contents of the raw table:

CPPUNIT_ASSERT (rawTable.count('\0') == rawTable.size());

I never though of that ;-)

For testApplyPatch() you could also use data tests, where you write a more generic test code and separately specify the test data (using my CppUnit extension). It will not necessarily be less code but you could maybe try it out. I’d love to get some feedback on that feature.

The functions checkTwoNibbles() and getBitsToOr() better be declared right after rightNibbleNonZero(). This way these functions will be declared in the namespace of the package and will thus be correctly displayed in the Doxygen generated docs.

The functions leftNibbleNonZero() and rightNibbleNonZero() should maybe better return quint8?

I like your refactoring a lot! Actually in applyPatch() I thing we don’t even need the if (entryBits == 1) distinction because this case is already covered by the code in the else part… or am I missing something?

Regards,

Peter

Would you like to post a relpy?


This post is a reply to:
New Unit Tests and a refactoring
Dear all I wrote these two tests and did some refactoring covered by them... Here is a patch. Let me know.... --- cheerio atul

Follow-ups:
Re: New Unit Tests and a refactoring
Dear Peter,        Thanks mate for the kind words ;-) Peter> For testApplyPatch() you could also use data tests, where you write a more generic test code and separately specify the test (more...)