/* * Boost.Reflection / parameter map unit test * * (C) Copyright Jeremy Pack 2008 * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * See http://www.boost.org/ for latest version. */ #include #include #define BOOST_EXTENSION_USE_PP 1 #define BOOST_TEST_MAIN #define BOOST_TEST_DYN_LINK 1 #include #include #include using namespace boost::reflections; BOOST_AUTO_TEST_CASE(paramter_map) { parameter_map pm; int m = 5; int j = 6; parameter it = pm.insert(m, "integer m"); it->converts_to(); it->converts_to(); it->converts_to(); it->converts_to(); it = pm.insert(j, "integer m"); it->converts_to(); BOOST_CHECK_EQUAL(pm.has()); float val = pm.get("integer j"); BOOST_CHECK_EQUAL(val, 5.0f); float val2 = pm.get("integer j"); BOOST_CHECK_EQUAL(val2, 6.0f); }