…
Peter Dimov wrote:
No, your changes are fine! Sorry I failed to mention that! Please send me a patch to apply in the mainstream.
No Problems mate … I will make a patch and send it …
Another thing I failed to mention in the previous post is that your patch would fix a bug I just noticed yesterday.
Good to know that…
I’m quite sure your function and similar ones can be used on other places as well so we should make sure we reuse them!
Sure… Also let me know if the function/method names are okay - ( that is a very important refactoring ) - Go the readability way ;-)
That’s why I thought it might be more intuitive to use such functions if they were members of a validator class for example.
Now, that is a lovely idea ;-) So things would again be done in one place … SPOT / DRY principle ;-)
I would like to try a new, hopefully better parsing mechanism when implementing BitTorrent packets. Any ideas in this respect?
Sure mate I will keep probing and something ought to come out this…
I’m not familiar with CppUnit, but I’ll make sure I take a look at it.
Actually it is a port of JUnit… JUnit is too good … And what JUnit is to Java is CppUnit to C/C++. … I tried to pull some existing legacy code into it and realized its power…
I do want to able to develop and test each package and component separately from the others.
…..
Any further ideas are welcome!
I integrated CppUnit test suite with the main make file and the tests built and ran within some seconds.. However, this integration needs some thinking.. ( it is a post build step )
It gives you a safety net feeling and gets the code under an automatic scanner ;-)
atul wrote:…
Peter Dimov wrote:
…..
P.S. I wouldn’t like to change too much Gnutella::Packets just for the sake of experimentation.....Are you referring to the changes ( or kind of changes ) like the ones I proposed...
If so, I understand ;-) It is usually a tight rope walk...
It really all depends on the tests... Exhaustive unit test suite which will tell me right away if I broke something...
What about CppUnit? CppUnit is a beauty... I started to pull Caltiko code into a test harness, but thought I would ask here first...
Separating out classes, and putting Unit Tests in is not simple but gives you a greater understanding... ( I could run some complex method into gdb and experiment with various input ...)
I have a copy of Mike Feather's book and used some of the techniques he proposes.. painful, yes but invaluable ;-)
---- cheers atul
