[Cppunit-devel] Orthodoxy tests and operator!
Brought to you by:
blep
From: Tredinnick, J. <jac...@me...> - 2002-05-27 17:28:10
|
Hi all, I'm not sure if anyone has come across this, but here goes ... I thought it would be a good idea to save a bit of time by using the Orthodox class, however I was surprised to see that operator! was required to use this? Personally, I hardly ever write a class with operator!, but quite often have the rest of the stuff in the Orthodox::runTest() - in fact I usually don't bother with operator!= either. Anyway, I ended up writing some global methods in Orthodox.h that concentrate more on =, == and <. Please find these in the attached file. This time, the client has to specify three non-default class objects a<b<c. The test goes some way towards checking for "total ordering" with operator<. E.g. that a < c and such, - which you need for associative STL containers, unless you specify a comparator. Please add it somewhere sensible if you think it'll be useful (BTW - I also have a TestCase for this, written for my slightly hacked version of 1.7.2 - let me know if you want this too). Regards -- Jake <<ortodoxTests.h>> |