Changeset 44622


Ignore:
Timestamp:
Apr 20, 2008, 1:00:21 PM (10 years ago)
Author:
Hartmut Kaiser
Message:

Spirit.Karma: re-enabled real_numerics tests related to math::real_concept.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/spirit/test/karma/real_numerics.cpp

    r44597 r44622  
    88#include <limits>
    99#include <boost/detail/lightweight_test.hpp>
    10 // #include <boost/math/concepts/real_concept.hpp>
     10#include <boost/math/concepts/real_concept.hpp>
    1111
    1212#include <boost/spirit/include/karma_char.hpp>
     
    6868//  We need to specialize is_real_lit_tag to allow to use a real_concept as a
    6969//  literal below
    70 // namespace boost { namespace spirit
    71 // {
    72 //     template <typename Domain>
    73 //     struct is_real_lit_tag<boost::math::concepts::real_concept, Domain>
    74 //       : boost::mpl::true_ {};
    75 // }}
     70namespace boost { namespace spirit
     71{
     72    template <typename Domain>
     73    struct is_real_lit_tag<boost::math::concepts::real_concept, Domain>
     74      : boost::mpl::true_ {};
     75}}
    7676
    7777///////////////////////////////////////////////////////////////////////////////
     
    390390    }
    391391
    392 // these tests currently fail because of a problem in the real_concept class
    393 //     {
    394 //         using boost::math::concepts::real_concept;
    395 //         typedef karma::real_spec<real_concept> custom_type;
    396 //         custom_type const custom = custom_type();
    397 //
    398 //         BOOST_TEST(test("0.0", custom, real_concept(0.0)));
    399 //         BOOST_TEST(test("1.0", custom, real_concept(1.0)));
    400 //         BOOST_TEST(test("1.0", custom, real_concept(1.0001)));
    401 //         BOOST_TEST(test("1.001", custom, real_concept(1.001)));
    402 //         BOOST_TEST(test("1.01", custom, real_concept(1.010)));
    403 //         BOOST_TEST(test("1.1", custom, real_concept(1.100)));
    404 //         
    405 //         BOOST_TEST(test("1.234e-04", custom, real_concept(0.00012345)));
    406 //         BOOST_TEST(test("0.001", custom, real_concept(0.0012345)));
    407 //         BOOST_TEST(test("0.012", custom, real_concept(0.012345)));
    408 //         BOOST_TEST(test("0.123", custom, real_concept(0.12345)));
    409 //         BOOST_TEST(test("1.234", custom, real_concept(1.2345)));
    410 //         BOOST_TEST(test("12.346", custom, real_concept(12.346)));
    411 //         BOOST_TEST(test("123.46", custom, real_concept(123.46)));
    412 //         BOOST_TEST(test("1234.5", custom, real_concept(1234.5)));
    413 //         BOOST_TEST(test("12342.0", custom, real_concept(12342.)));
    414 //         BOOST_TEST(test("1.234e05", custom, real_concept(123420.)));
    415 //         
    416 //         BOOST_TEST(test("-1.0", custom, real_concept(-1.0)));
    417 //         BOOST_TEST(test("-1.234", custom, real_concept(-1.2345)));
    418 //         BOOST_TEST(test("-1.235", custom, real_concept(-1.2346)));
    419 //         BOOST_TEST(test("-1234.2", custom, real_concept(-1234.2)));
    420 //         
    421 //         BOOST_TEST(test("1.0", custom(real_concept(1.0))));
    422 //         BOOST_TEST(test("1.0", custom(real_concept(1.0001))));
    423 //         BOOST_TEST(test("1.001", custom(real_concept(1.001))));
    424 //         BOOST_TEST(test("1.01", custom(real_concept(1.010))));
    425 //         BOOST_TEST(test("1.1", custom(real_concept(1.100))));
    426 //         
    427 //         BOOST_TEST(test("1.234e-04", custom(real_concept(0.00012345))));
    428 //         BOOST_TEST(test("0.001", custom(real_concept(0.0012345))));
    429 //         BOOST_TEST(test("0.012", custom(real_concept(0.012345))));
    430 //         BOOST_TEST(test("0.123", custom(real_concept(0.12345))));
    431 //         BOOST_TEST(test("1.234", custom(real_concept(1.2345))));
    432 //         BOOST_TEST(test("12.346", custom(real_concept(12.346))));
    433 //         BOOST_TEST(test("123.46", custom(real_concept(123.46))));
    434 //         BOOST_TEST(test("1234.5", custom(real_concept(1234.5))));
    435 //         BOOST_TEST(test("12342.0", custom(real_concept(12342.))));
    436 //         BOOST_TEST(test("1.234e05", custom(real_concept(123420.))));
    437 //     }
     392    {
     393        using boost::math::concepts::real_concept;
     394        typedef karma::real_spec<real_concept> custom_type;
     395        custom_type const custom = custom_type();
     396
     397        BOOST_TEST(test("0.0", custom, real_concept(0.0)));
     398        BOOST_TEST(test("1.0", custom, real_concept(1.0)));
     399        BOOST_TEST(test("1.0", custom, real_concept(1.0001)));
     400        BOOST_TEST(test("1.001", custom, real_concept(1.001)));
     401        BOOST_TEST(test("1.01", custom, real_concept(1.010)));
     402        BOOST_TEST(test("1.1", custom, real_concept(1.100)));
     403       
     404        BOOST_TEST(test("1.234e-04", custom, real_concept(0.00012345)));
     405        BOOST_TEST(test("0.001", custom, real_concept(0.0012345)));
     406        BOOST_TEST(test("0.012", custom, real_concept(0.012345)));
     407        BOOST_TEST(test("0.123", custom, real_concept(0.12345)));
     408        BOOST_TEST(test("1.234", custom, real_concept(1.2345)));
     409        BOOST_TEST(test("12.346", custom, real_concept(12.346)));
     410        BOOST_TEST(test("123.46", custom, real_concept(123.46)));
     411        BOOST_TEST(test("1234.5", custom, real_concept(1234.5)));
     412        BOOST_TEST(test("12342.0", custom, real_concept(12342.)));
     413        BOOST_TEST(test("1.234e05", custom, real_concept(123420.)));
     414       
     415        BOOST_TEST(test("-1.0", custom, real_concept(-1.0)));
     416        BOOST_TEST(test("-1.234", custom, real_concept(-1.2345)));
     417        BOOST_TEST(test("-1.235", custom, real_concept(-1.2346)));
     418        BOOST_TEST(test("-1234.2", custom, real_concept(-1234.2)));
     419       
     420        BOOST_TEST(test("1.0", custom(real_concept(1.0))));
     421        BOOST_TEST(test("1.0", custom(real_concept(1.0001))));
     422        BOOST_TEST(test("1.001", custom(real_concept(1.001))));
     423        BOOST_TEST(test("1.01", custom(real_concept(1.010))));
     424        BOOST_TEST(test("1.1", custom(real_concept(1.100))));
     425       
     426        BOOST_TEST(test("1.234e-04", custom(real_concept(0.00012345))));
     427        BOOST_TEST(test("0.001", custom(real_concept(0.0012345))));
     428        BOOST_TEST(test("0.012", custom(real_concept(0.012345))));
     429        BOOST_TEST(test("0.123", custom(real_concept(0.12345))));
     430        BOOST_TEST(test("1.234", custom(real_concept(1.2345))));
     431        BOOST_TEST(test("12.346", custom(real_concept(12.346))));
     432        BOOST_TEST(test("123.46", custom(real_concept(123.46))));
     433        BOOST_TEST(test("1234.5", custom(real_concept(1234.5))));
     434        BOOST_TEST(test("12342.0", custom(real_concept(12342.))));
     435        BOOST_TEST(test("1.234e05", custom(real_concept(123420.))));
     436    }
    438437   
    439438    return boost::report_errors();
Note: See TracChangeset for help on using the changeset viewer.