[test lib] request for new features

Hi Gennadiy, I would like to see these functions added to the test library: BOOST_CHECK_NOT_EQUAL(x,y) BOOST_CHECK_NOT_CLOSE(x,y) and any similar functions that makes sense. I don't see how we can get the variables printed in the failed test without these functions. Thanks Thorsten -- Thorsten Ottosen ---------------------------- www.dezide.com http://www.cs.aau.dk/index2.php?content=Research/mi www.boost.org www.open-std.org/JTC1/SC22/WG21/

"Gennadiy Rozental" <gennadiy.rozental@thomson.com> wrote in message news:d726p5$k5p$1@sea.gmane.org... | using namespace std; | using namespace boost; | | > BOOST_CHECK_NOT_EQUAL(x,y) | | BOOST_CHECK_PREDICATE( not_equal_to<T>(), (x)(y) ); | | > BOOST_CHECK_NOT_CLOSE(x,y) | | BOOST_CHECK_PREDICATE( not( test_tools::check_is_close ), | (x)(y)(tolerance) ); ok, but I still think it is too much of typing to do what I need in a straightforward manner. -Thorsten

"Thorsten Ottosen" <nesotto@cs.auc.dk> wrote in message news:d72cp4$bhu$1@sea.gmane.org...
"Gennadiy Rozental" <gennadiy.rozental@thomson.com> wrote in message news:d726p5$k5p$1@sea.gmane.org... | using namespace std; | using namespace boost; | | > BOOST_CHECK_NOT_EQUAL(x,y) | | BOOST_CHECK_PREDICATE( not_equal_to<T>(), (x)(y) ); | | > BOOST_CHECK_NOT_CLOSE(x,y) | | BOOST_CHECK_PREDICATE( not( test_tools::check_is_close ), | (x)(y)(tolerance) );
ok, but I still think it is too much of typing to do what I need in a straightforward manner.
There are a lot of predicates: > , < >=, != etc. Add conjunctions and you will have exponential amount. I couldn't incorporate all possible predicates into library. Instead I provide generic tool. If you need this frequently in some test module you could define one yourself. Gennadiy.

"Gennadiy Rozental" <gennadiy.rozental@thomson.com> wrote in message news:d72du0$fbr$1@sea.gmane.org... | | "Thorsten Ottosen" <nesotto@cs.auc.dk> wrote in message | news:d72cp4$bhu$1@sea.gmane.org... | > "Gennadiy Rozental" <gennadiy.rozental@thomson.com> wrote in message | > news:d726p5$k5p$1@sea.gmane.org... | > | using namespace std; | > | using namespace boost; | > | | > | > BOOST_CHECK_NOT_EQUAL(x,y) | > | | > | BOOST_CHECK_PREDICATE( not_equal_to<T>(), (x)(y) ); | > | | > | > BOOST_CHECK_NOT_CLOSE(x,y) | > | | > | BOOST_CHECK_PREDICATE( not( test_tools::check_is_close ), | > | (x)(y)(tolerance) ); | > | > ok, but I still think it is too much of typing to do what I need in a | > straightforward manner. | | There are a lot of predicates: > , < >=, != etc. Add conjunctions and you | will have exponential amount. and don't add them, and you have a linear amount. | I couldn't incorporate all possible predicates | into library. Instead I provide generic tool. If you need this frequently in | some test module you could define one yourself. then why did you provide CHECK_EQUAL ? Afterall, it can be done with the generic tool. surely it wouldn't be too hard to write first hand tools for ==, !=, <, <= to give users the most pleasent experience ? (> and >= is not needed as we can reverse the arguments) -Thorsten

| I couldn't incorporate all possible predicates | into library. Instead I provide generic tool. If you need this frequently in | some test module you could define one yourself.
then why did you provide CHECK_EQUAL ? Afterall, it can be done with the generic tool.
equality comparison is most frequently used assertions.
surely it wouldn't be too hard to write first hand tools for ==, !=, <, <= to give users the most pleasent experience ? (> and >= is not needed as we can reverse the arguments)
We need to set a line somewhere. But I don't mind adding several more predefined tools, if there are enough people interested in this. Anyone to support Thorsten? Gennadiy

"Gennadiy Rozental" <gennadiy.rozental@thomson.com> wrote in message news:d75b6a$116$1@sea.gmane.org... | | We need to set a line somewhere. But I don't mind adding several more | predefined tools, if there are enough people interested in this. Thanks :-) -Thorsten
participants (3)
-
Gennadiy Rozental
-
Jody Hagins
-
Thorsten Ottosen