Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost.Test check_is_small for my own
From: Mathieu Champlon (m.champlon_at_[hidden])
Date: 2013-05-26 15:23:50


On 26/05/2013 20:02, Olaf Peter wrote:
> Hello,
>
> I try to use parts of boost.test lib not for unit testing self but
> inside an algorithm. Anyway, at the end of header
> http://www.boost.org/doc/libs/1_53_0/boost/test/floating_point_comparison.hpp
> this is written inside anonymous namespace it works obviously, but not
> at me. What happened here and how to fix it? Did I not read the header
> carefully?
>
> Thanks,
> Olaf
>
> ---8<----
> #include <boost/test/floating_point_comparison.hpp>
>
> namespace tools {
>
> using boost::test_tools::check_is_small_t;
>
> check_is_small_t const& check_is_small =
> unit_test::ut_detail::static_constant<check_is_small_t>::value;
> }
>
> int main()
> {
> bool ok = tools::check_is_small(900, 0.1);
> }
> --->8----
>
> test.cpp:5:30: error: 'boost::test_tools::check_is_small_t' has not
> been declared
> test.cpp:7:5: error: 'check_is_small_t' does not name a type
> test.cpp: In function 'int main()':
> test.cpp:12:15: error: 'check_is_small' is not a member of 'tools'

Hi,

This works for me for both 1.52 and trunk :

#include <boost/test/floating_point_comparison.hpp>

int main()
{
     bool ok = boost::test_tools::check_is_small( 900., 0.1 );
}

MAT.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net