Unit testing Questions

I'm a newbie with boost and have some questions about unit testing- 1 - In looking for documentation, I see that most of the sample links on the boost.org site for unit testing examples are dead. Is there another place I can see them. 2 - Is there a good tutorial on all of the features of boost testing? It looks really good, but it seems to be really hard to follow. 3 - Is there a way to test for 1.#QNAN in a floating point value? This is part of my initialization sequence. "BOOST_CHECK_EQUAL" results a failure. Thanks in advance. Thomas Thorp Senior Software C++ Engineer Advanced Composite Software - Production

3.) try BOOST_CHECK_CLOSE
On 9/25/07, Thomas Thorp
I'm a newbie with boost and have some questions about unit testing-
1 - In looking for documentation, I see that most of the sample links on the boost.org site for unit testing examples are dead. Is there another place I can see them.
2 - Is there a good tutorial on all of the features of boost testing? It looks really good, but it seems to be really hard to follow.
3 - Is there a way to test for 1.#QNAN in a floating point value? This is part of my initialization sequence. "BOOST_CHECK_EQUAL" results a failure.
Thanks in advance.
Thomas Thorp Senior Software C++ Engineer Advanced Composite Software - Production
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Tue, Sep 25, 2007 at 11:22:27AM -0500, Thomas Thorp wrote:
1 - In looking for documentation, I see that most of the sample links on the boost.org site for unit testing examples are dead. Is there another place I can see them.
There are a lot of examples in a boost download: libs/test/example Andrew.

Thomas Thorp
I'm a newbie with boost and have some questions about unit testing-
1 - In looking for documentation, I see that most of the sample links on the boost.org site for unit testing examples are dead. Is there another place I can see them.
I am working on docs update. Latest state can be found here: http://www.patmedia.net/~rogeeff/html/index.html
2 - Is there a good tutorial on all of the features of boost testing? It looks really good, but it seems to be really hard to follow.
Above documentation includes several tutorials
3 - Is there a way to test for 1.#QNAN in a floating point value? This is part of my initialization sequence. "BOOST_CHECK_EQUAL" results a failure.
Can you explain in more detailes fot exactly you need to check? Gennadiy

Thomas Thorp wrote:
3 - Is there a way to test for 1.#QNAN in a floating point value? This is part of my initialization sequence. "BOOST_CHECK_EQUAL" results a failure.
Although I don't know BOOST_CHECK_EQUAL, I suspect that i uses the == operator for floats and doubles. Since every comparison with NaN results in false, this won't work. However, TR1 incorporates the C99 isnan() function, according to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf , page 163/164. If your compiler vendor doesn't support it, yet, you might want to search the boost libraries for is_nan. Malte
participants (5)
-
Andrew Agno
-
chun ping wang
-
Gennadiy Rozental
-
Malte Clasen
-
Thomas Thorp