Boost logo

Boost :

From: jpanzer_at_[hidden]
Date: 2002-01-30 12:17:40


Hi Gennadiy,

This looks good (I need to look at the new Boost Test library). A couple of comments:

BOOST_CHECK_MESSAGE( lt_answer[i][j] || lt_answer[j][k] || !lt_answer[i][k],
    "Predicate P(a,b)=" << predicate <<
    " fails transitivity of equiualence test; both P(a,b) and P(b,c) return false but P(a,c) returns
true for a= "
    << values[i] << ", b= " << values[j] << " and c= " << values[k] );

In the original I also printed out the original positions of the values, with the thought that the
positions might be helpful in finding the source of the data ("hmmm... was the failure case
'aaxxfegetede' or 'aaxxfggetede'?"). This would be especially useful if the elements, for whatever
reason, didn't map 1:1 to printable strings, or if you're using a deterministic test case generator.

How about:

    " fails transitivity of equivalence test; both P(a,b) and P(b,c) return false but P(a,c) returns
true for a= "
    << values[i] << " (# << i << "), b= " << values[j] << " (#" << j
    << ") and c= " << values[k] << " (#" << k << ")" );

...
#ifdef BOOST_MSVC
#define TEST_STRICT_WEAK_ORDERING( Predicate, begin, end ) \
    test_strict_weak_ordering( #Predicate, Predicate, begin, end, begin )
#else
#define TEST_STRICT_WEAK_ORDERING( Predicate, begin, end ) \
    test_strict_weak_ordering( #Predicate, Predicate, begin, end )
#endif

Is this the standard workaround for MSVC? It would appear that this would rule out any container of
test data other than vectors (maybe) or arrays. This would make it harder to use test data generators.
Also, I would think this particular workaround should be turned off if someone is using (say) STLPort
with MSVC as a replacement for the default STL since STLPort, AFAIK, doesn't have a problem with
iterator_traits.

John

rogeeff wrote:

> Hi,
>
> --- In boost_at_y..., Jeremy Siek <jsiek_at_c...> wrote:
> > On Mon, 28 Jan 2002, rogeeff wrote:
> >
> > rogeef> We could add this as unit test framework extention. But,
> >
> > Yes, we really need to whole sub-library on generic tests on
> concepts.
>
> I have uploaded version of presented algorithm (that is how author is
> calling it) in vault area that works with new Bosst Test Library:
>
> http://groups.yahoo.com/group/boost/files/test_strict_weak_ordering/BT
> L_compatible/
>
> Compiled and tested on MSVC6SP5.
> Do you want me to put this in CVS for further addition?
>
> > --------------------------------------------------------------------
> --
> > Jeremy Siek http://php.indiana.edu/~jsiek/
> > Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_o...
> > C++ Booster (http://www.boost.org) office phone: (812) 855-3608
> > --------------------------------------------------------------------
> --
>
> Gennadiy.
>
> Info: http://www.boost.org Send unsubscribe requests to: <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk