Boost logo

Boost-Commit :

From: oryol_at_[hidden]
Date: 2008-07-20 00:23:59


Author: jeremypack
Date: 2008-07-20 00:23:59 EDT (Sun, 20 Jul 2008)
New Revision: 47620
URL: http://svn.boost.org/trac/boost/changeset/47620

Log:
Add type_map_test.

Added:
   sandbox/libs/extension/test/type_map_test.cpp (contents, props changed)

Added: sandbox/libs/extension/test/type_map_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/test/type_map_test.cpp 2008-07-20 00:23:59 EDT (Sun, 20 Jul 2008)
@@ -0,0 +1,37 @@
+/*
+ * Boost.Extension / testing of type_map class
+ *
+ * (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 <boost/extension/type_map.hpp>
+#include <boost/function.hpp>
+#define BOOST_TEST_MAIN
+#define BOOST_TEST_DYN_LINK 1
+#include <boost/test/unit_test.hpp>
+
+
+using namespace boost::extensions;
+
+BOOST_AUTO_TEST_CASE(intTest) {
+ type_map m;
+ int& my_int(m.get());
+ my_int = 5;
+ int& my_second_int(m.get());
+ BOOST_CHECK_EQUAL(my_second_int, 5);
+}
+
+BOOST_AUTO_TEST_CASE(intFloatTest) {
+ type_map m;
+ int& my_int(m.get());
+ my_int = 5;
+ float& my_float(m.get());
+ my_float = 10.0;
+ BOOST_CHECK_EQUAL(my_int, 5);
+ BOOST_CHECK_EQUAL(my_float, 10.0);
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk