summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/property_map/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/property_map/test
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/property_map/test')
-rw-r--r--src/boost/libs/property_map/test/Jamfile.v226
-rw-r--r--src/boost/libs/property_map/test/compose_property_map_test.cpp101
-rw-r--r--src/boost/libs/property_map/test/dynamic_properties_test.cpp138
-rw-r--r--src/boost/libs/property_map/test/function_property_map_test.cpp66
-rw-r--r--src/boost/libs/property_map/test/property_map_cc.cpp115
-rw-r--r--src/boost/libs/property_map/test/transform_value_property_map_test.cpp72
6 files changed, 518 insertions, 0 deletions
diff --git a/src/boost/libs/property_map/test/Jamfile.v2 b/src/boost/libs/property_map/test/Jamfile.v2
new file mode 100644
index 000000000..b6353d294
--- /dev/null
+++ b/src/boost/libs/property_map/test/Jamfile.v2
@@ -0,0 +1,26 @@
+# PropertyMap library
+
+# Copyright (C) 2005 Trustees of Indiana University
+#
+# Author: Douglas Gregor
+#
+# Use, modification and distribution is subject to 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)
+
+# For more information, see http://www.boost.org/
+
+import os ;
+
+project
+ : requirements
+ <target-os>cygwin:<define>_POSIX_C_SOURCE=201112L
+ ;
+
+test-suite property_map
+ : [ compile property_map_cc.cpp ]
+ [ run compose_property_map_test.cpp ]
+ [ run dynamic_properties_test.cpp ]
+ [ run function_property_map_test.cpp ]
+ [ run transform_value_property_map_test.cpp ]
+ ;
diff --git a/src/boost/libs/property_map/test/compose_property_map_test.cpp b/src/boost/libs/property_map/test/compose_property_map_test.cpp
new file mode 100644
index 000000000..7ee716682
--- /dev/null
+++ b/src/boost/libs/property_map/test/compose_property_map_test.cpp
@@ -0,0 +1,101 @@
+// Copyright (C) 2013 Eurodecision
+// Authors: Guillaume Pinot
+//
+// 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)
+
+#include <boost/property_map/compose_property_map.hpp>
+
+#include <boost/property_map/function_property_map.hpp>
+#include <boost/test/minimal.hpp>
+
+void concept_checks()
+{
+ using namespace boost;
+ {
+ typedef null_archetype<> Key;
+ //typedef assignable_archetype<copy_constructible_archetype<> > Value;
+ typedef copy_constructible_archetype<assignable_archetype<> > Value;
+ typedef readable_property_map_archetype<Key, Key> GPMap;
+ typedef readable_property_map_archetype<Key, Value> FPMap;
+ typedef compose_property_map<FPMap, GPMap> CPM;
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<CPM, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef copy_constructible_archetype<assignable_archetype<> > Value;
+ typedef readable_property_map_archetype<Key, Key> GPMap;
+ typedef writable_property_map_archetype<Key, Value> FPMap;
+ typedef compose_property_map<FPMap, GPMap> CPM;
+ BOOST_CONCEPT_ASSERT((WritablePropertyMapConcept<CPM, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef copy_constructible_archetype<assignable_archetype<> > Value;
+ typedef readable_property_map_archetype<Key, Key> GPMap;
+ typedef read_write_property_map_archetype<Key, Value> FPMap;
+ typedef compose_property_map<FPMap, GPMap> CPM;
+ BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept<CPM, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef copy_constructible_archetype<assignable_archetype<> > Value;
+ typedef readable_property_map_archetype<Key, Key> GPMap;
+ typedef lvalue_property_map_archetype<Key, Value> FPMap;
+ typedef compose_property_map<FPMap, GPMap> CPM;
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<CPM, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef copy_constructible_archetype<assignable_archetype<> > Value;
+ typedef readable_property_map_archetype<Key, Key> GPMap;
+ typedef mutable_lvalue_property_map_archetype<Key, Value> FPMap;
+ typedef compose_property_map<FPMap, GPMap> CPM;
+ BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept<CPM, Key>));
+ }
+}
+
+void pointer_pmap_check()
+{
+ const int idx[] = {2, 0, 4, 1, 3};
+ double v[] = {1., 3., 0., 4., 2.};
+ boost::compose_property_map<double*, const int*> cpm(v, idx);
+
+ for (int i = 0; i < 5; ++i) {
+ BOOST_CHECK(get(cpm, i) == static_cast<double>(i));
+ ++cpm[i];
+ BOOST_CHECK(cpm[i] == static_cast<double>(i + 1));
+ put(cpm, i, 42.);
+ BOOST_CHECK(cpm[i] == 42.);
+ }
+}
+
+struct modulo_add_one {
+ typedef int result_type;
+ modulo_add_one(int m): modulo(m) {}
+ int operator()(int i) const {return (i + 1) % modulo;}
+ int modulo;
+};
+
+void readable_pmap_checks()
+{
+ using namespace boost;
+ typedef function_property_map<modulo_add_one, int> modulo_add_one_pmap;
+
+ compose_property_map<modulo_add_one_pmap, modulo_add_one_pmap>
+ cpm(modulo_add_one(5), modulo_add_one(5));
+
+ for (int i = 0; i < 10; ++i)
+ BOOST_CHECK(get(cpm, i) == (i + 2) % 5);
+}
+
+int
+test_main(int, char**)
+{
+ concept_checks();
+ pointer_pmap_check();
+ readable_pmap_checks();
+
+ return 0;
+}
diff --git a/src/boost/libs/property_map/test/dynamic_properties_test.cpp b/src/boost/libs/property_map/test/dynamic_properties_test.cpp
new file mode 100644
index 000000000..813225d59
--- /dev/null
+++ b/src/boost/libs/property_map/test/dynamic_properties_test.cpp
@@ -0,0 +1,138 @@
+
+// Copyright 2005 The Trustees of Indiana University.
+
+// Use, modification and distribution is subject to 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)
+
+//
+// dynamic_properties_test.cpp - test cases for the dynamic property maps.
+//
+
+// Author: Ronald Garcia
+#include <boost/config.hpp>
+
+// For Borland, act like BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS is defined
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x570) && !defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS)
+# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+#endif
+
+#include <boost/test/minimal.hpp>
+#include <boost/smart_ptr.hpp>
+#include <boost/property_map/dynamic_property_map.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <map>
+#include <iostream>
+#include <string>
+#include <memory>
+
+// generate a dynamic_property_map that maps strings to strings
+// WARNING: This code leaks memory. For testing purposes only!
+// WARNING: This code uses library internals. For testing purposes only!
+boost::shared_ptr<boost::dynamic_property_map>
+string2string_gen(const std::string& name,
+ const boost::any&,
+ const boost::any&) {
+ typedef std::map<std::string,std::string> map_t;
+ typedef
+ boost::associative_property_map< std::map<std::string, std::string> >
+ property_t;
+
+
+ map_t* mymap = new map_t(); // hint: leaky memory here!
+
+ property_t property_map(*mymap);
+
+ boost::shared_ptr<boost::dynamic_property_map> pm(
+ new
+ boost::detail::dynamic_property_map_adaptor<property_t>(property_map));
+
+ return pm;
+}
+
+
+int test_main(int,char**) {
+
+ // build property maps using associative_property_map
+
+ std::map<std::string, int> string2int;
+ std::map<double,std::string> double2string;
+ boost::associative_property_map< std::map<std::string, int> >
+ int_map(string2int);
+ boost::associative_property_map< std::map<double, std::string> >
+ dbl_map(double2string);
+
+
+ // add key-value information
+ string2int["one"] = 1;
+ string2int["five"] = 5;
+
+ double2string[5.3] = "five point three";
+ double2string[3.14] = "pi";
+
+
+ // build and populate dynamic interface
+ boost::dynamic_properties properties;
+ properties.property("int",int_map);
+ properties.property("double",dbl_map);
+
+ using boost::get;
+ using boost::put;
+ using boost::type;
+ // Get tests
+ {
+ BOOST_CHECK(get("int",properties,std::string("one")) == "1");
+#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ BOOST_CHECK(boost::get<int>("int",properties,std::string("one")) == 1);
+#endif
+ BOOST_CHECK(get("int",properties,std::string("one"), type<int>()) == 1);
+ BOOST_CHECK(get("double",properties,5.3) == "five point three");
+ }
+
+ // Put tests
+ {
+ put("int",properties,std::string("five"),6);
+ BOOST_CHECK(get("int",properties,std::string("five")) == "6");
+ put("int",properties,std::string("five"),std::string("5"));
+#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ BOOST_CHECK(get<int>("int",properties,std::string("five")) == 5);
+#endif
+ BOOST_CHECK(get("int",properties,std::string("five"),type<int>()) == 5);
+ put("double",properties,3.14,std::string("3.14159"));
+ BOOST_CHECK(get("double",properties,3.14) == "3.14159");
+ put("double",properties,3.14,std::string("pi"));
+#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ BOOST_CHECK(get<std::string>("double",properties,3.14) == "pi");
+#endif
+ BOOST_CHECK(get("double",properties,3.14,type<std::string>()) == "pi");
+ }
+
+ // Nonexistent property
+ {
+ try {
+ get("nope",properties,3.14);
+ BOOST_ERROR("No exception thrown.");
+ } catch (boost::dynamic_get_failure&) { }
+
+ try {
+ put("nada",properties,3.14,std::string("3.14159"));
+ BOOST_ERROR("No exception thrown.");
+ } catch (boost::property_not_found&) { }
+ }
+
+ // Nonexistent property gets generated
+ {
+ boost::dynamic_properties props(&string2string_gen);
+ put("nada",props,std::string("3.14"),std::string("pi"));
+ BOOST_CHECK(get("nada",props,std::string("3.14")) == "pi");
+ }
+
+ // Use the ignore_other_properties generator
+ {
+ boost::dynamic_properties props(&boost::ignore_other_properties);
+ bool value = put("nada",props,std::string("3.14"),std::string("pi"));
+ BOOST_CHECK(value == false);
+ }
+
+ return boost::exit_success;
+}
diff --git a/src/boost/libs/property_map/test/function_property_map_test.cpp b/src/boost/libs/property_map/test/function_property_map_test.cpp
new file mode 100644
index 000000000..8f072ec3f
--- /dev/null
+++ b/src/boost/libs/property_map/test/function_property_map_test.cpp
@@ -0,0 +1,66 @@
+//
+//=======================================================================
+// Author: Jeremiah Willcock
+//
+// Copyright 2012, Trustees of Indiana University
+//
+// 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)
+//=======================================================================
+//
+
+#include <boost/property_map/function_property_map.hpp>
+#include <boost/concept/assert.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/static_assert.hpp>
+
+template <typename T>
+struct add1 {typedef T result_type; T operator()(const T& x) const {return x + 1;}};
+
+template <typename T>
+struct add1_val {typedef T result_type; T operator()(T x) const {return x + 1;}};
+
+template <typename T>
+struct return_fixed_ref {
+ int* ptr;
+ return_fixed_ref(int* ptr): ptr(ptr) {}
+ typedef int& result_type;
+ int& operator()(const T&) const {return *ptr;}
+};
+
+int test_main(int, char**) {
+ using namespace boost;
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<function_property_map<add1<int>, int>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<function_property_map<add1<int>, int, double>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<function_property_map<add1_val<int>, int>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<function_property_map<add1_val<int>, int, double>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<function_property_map<return_fixed_ref<int>, int>, int>));
+ BOOST_CONCEPT_ASSERT((WritablePropertyMapConcept<function_property_map<return_fixed_ref<int>, int>, int>));
+ BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept<function_property_map<return_fixed_ref<int>, int>, int>));
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<function_property_map<return_fixed_ref<int>, int>, int>));
+
+ BOOST_STATIC_ASSERT((boost::is_same<boost::property_traits<function_property_map<add1<int>, int> >::category, boost::readable_property_map_tag>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<boost::property_traits<function_property_map<add1_val<int>, int> >::category, boost::readable_property_map_tag>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<boost::property_traits<function_property_map<return_fixed_ref<int>, int> >::category, boost::lvalue_property_map_tag>::value));
+
+ BOOST_CHECK(get(function_property_map<add1<int>, int>(), 3) == 4);
+ BOOST_CHECK(get(function_property_map<add1<int>, int>(add1<int>()), 4) == 5);
+ BOOST_CHECK(get(make_function_property_map<int>(add1<int>()), 5) == 6);
+ BOOST_CHECK(get(function_property_map<add1_val<int>, int>(), 3) == 4);
+ BOOST_CHECK(get(function_property_map<add1_val<int>, int>(add1_val<int>()), 4) == 5);
+ BOOST_CHECK(get(make_function_property_map<int>(add1_val<int>()), 5) == 6);
+ int val;
+ const function_property_map<return_fixed_ref<int>, int> pm = return_fixed_ref<int>((&val));
+ put(pm, 1, 6);
+ BOOST_CHECK(get(pm, 2) == 6);
+ BOOST_CHECK((get(pm, 3) = 7) == 7);
+ BOOST_CHECK(get(pm, 4) == 7);
+ const function_property_map<return_fixed_ref<int>, int> pm2 = pm; // Check shallow copying
+ BOOST_CHECK(get(pm2, 5) == 7);
+ put(pm2, 3, 1);
+ BOOST_CHECK(get(pm, 1) == 1);
+
+ return 0;
+}
diff --git a/src/boost/libs/property_map/test/property_map_cc.cpp b/src/boost/libs/property_map/test/property_map_cc.cpp
new file mode 100644
index 000000000..82606ac7b
--- /dev/null
+++ b/src/boost/libs/property_map/test/property_map_cc.cpp
@@ -0,0 +1,115 @@
+// (C) Copyright Jeremy Siek 2001.
+// 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)
+
+#include <boost/property_map/property_map.hpp>
+#include <boost/property_map/shared_array_property_map.hpp>
+#include <map>
+
+// This file checks the property map concepts against the property map
+// archetypes to make sure they are consistent and that they compile.
+// This also checks all the property map classes defined in
+// property_map.hpp against the concept checking classes.
+
+int
+main()
+{
+ using namespace boost;
+ {
+ typedef null_archetype<> Key;
+ typedef assignable_archetype<copy_constructible_archetype<> > Value;
+ typedef readable_property_map_archetype<Key, Value> PMap;
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef assignable_archetype<copy_constructible_archetype<> > Value;
+ typedef writable_property_map_archetype<Key, Value> PMap;
+ BOOST_CONCEPT_ASSERT((WritablePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef assignable_archetype<copy_constructible_archetype<> > Value;
+ typedef read_write_property_map_archetype<Key, Value> PMap;
+ BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef assignable_archetype<copy_constructible_archetype<> > Value;
+ typedef lvalue_property_map_archetype<Key, Value> PMap;
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef null_archetype<> Key;
+ typedef assignable_archetype<copy_constructible_archetype<> > Value;
+ typedef mutable_lvalue_property_map_archetype<Key, Value> PMap;
+ BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef std::ptrdiff_t Key;
+ typedef int* PMap;
+ BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef std::ptrdiff_t Key;
+ typedef const int* PMap;
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef sgi_assignable_archetype<> Key; // ?
+ typedef sgi_assignable_archetype<> Value;
+ typedef random_access_iterator_archetype<Value> Iterator;
+ typedef readable_property_map_archetype<Key, std::ptrdiff_t> IndexMap;
+ typedef iterator_property_map<Iterator, IndexMap
+#ifdef BOOST_NO_STD_ITERATOR_TRAITS
+ , Value, const Value&
+#endif
+ > PMap;
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef sgi_assignable_archetype<> Key;
+ typedef sgi_assignable_archetype<> Value;
+ typedef mutable_random_access_iterator_archetype<Value> Iterator;
+ typedef readable_property_map_archetype<Key, std::ptrdiff_t> IndexMap;
+ typedef iterator_property_map<Iterator, IndexMap
+#ifdef BOOST_NO_STD_ITERATOR_TRAITS
+ , Value, Value&
+#endif
+ > PMap;
+ BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef sgi_assignable_archetype< less_than_comparable_archetype<> > Key;
+ typedef default_constructible_archetype< sgi_assignable_archetype<> >
+ Value;
+ typedef std::map<Key, Value> Container;
+ typedef associative_property_map<Container> PMap;
+ BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef sgi_assignable_archetype< less_than_comparable_archetype<> > Key;
+ typedef default_constructible_archetype< sgi_assignable_archetype<> >
+ Value;
+ typedef std::map<Key, Value> Container;
+ typedef const_associative_property_map<Container> PMap;
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<PMap, Key>));
+ }
+ {
+ typedef identity_property_map PMap;
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<PMap, int>));
+ }
+ {
+ typedef dummy_property_map PMap;
+ BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept<PMap, int>));
+ }
+ {
+ typedef sgi_assignable_archetype<> Key; // ?
+ typedef sgi_assignable_archetype<> Value;
+ typedef readable_property_map_archetype<Key, std::ptrdiff_t> IndexMap;
+ typedef shared_array_property_map<Value, IndexMap> PMap;
+ BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept<PMap, Key>));
+ }
+ return 0;
+}
diff --git a/src/boost/libs/property_map/test/transform_value_property_map_test.cpp b/src/boost/libs/property_map/test/transform_value_property_map_test.cpp
new file mode 100644
index 000000000..d9032f447
--- /dev/null
+++ b/src/boost/libs/property_map/test/transform_value_property_map_test.cpp
@@ -0,0 +1,72 @@
+//
+//=======================================================================
+// Author: Jeremiah Willcock
+//
+// Copyright 2012, Trustees of Indiana University
+//
+// 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)
+//=======================================================================
+//
+
+#include <boost/property_map/function_property_map.hpp>
+#include <boost/property_map/transform_value_property_map.hpp>
+#include <boost/concept/assert.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <boost/test/minimal.hpp>
+#include <boost/static_assert.hpp>
+
+// Ensure this is not default constructible
+struct times2 {typedef int result_type; times2(int) {}; int operator()(int x) const {return 2 * x;}};
+
+template <typename T>
+struct add1 {typedef T result_type; T operator()(const T& x) const {return x + 1;}};
+
+template <typename T>
+struct add1_val {typedef T result_type; T operator()(T x) const {return x + 1;}};
+
+template <typename T>
+struct return_fixed_ref {
+ int* ptr;
+ return_fixed_ref(int* ptr): ptr(ptr) {}
+ typedef int& result_type;
+ int& operator()(const T&) const {return *ptr;}
+};
+
+int test_main(int, char**) {
+ using namespace boost;
+ typedef function_property_map<times2, int> PM;
+ PM orig_pm(times2(0));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<transform_value_property_map<add1<int>, PM>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<transform_value_property_map<add1<int>, PM, double>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<transform_value_property_map<add1_val<int>, PM>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<transform_value_property_map<add1_val<int>, PM, double>, int>));
+ BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<transform_value_property_map<return_fixed_ref<int>, PM>, int>));
+ BOOST_CONCEPT_ASSERT((WritablePropertyMapConcept<transform_value_property_map<return_fixed_ref<int>, PM>, int>));
+ BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept<transform_value_property_map<return_fixed_ref<int>, PM>, int>));
+ BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept<transform_value_property_map<return_fixed_ref<int>, PM>, int>));
+
+ BOOST_STATIC_ASSERT((boost::is_same<boost::property_traits<transform_value_property_map<add1<int>, PM> >::category, boost::readable_property_map_tag>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<boost::property_traits<transform_value_property_map<add1_val<int>, PM> >::category, boost::readable_property_map_tag>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<boost::property_traits<transform_value_property_map<return_fixed_ref<int>, PM> >::category, boost::lvalue_property_map_tag>::value));
+
+ BOOST_CHECK(get(transform_value_property_map<add1<int>, PM>(add1<int>(), orig_pm), 3) == 7);
+ BOOST_CHECK(get(transform_value_property_map<add1<int>, PM>(add1<int>(), orig_pm), 4) == 9);
+ BOOST_CHECK(get(make_transform_value_property_map(add1<int>(), orig_pm), 5) == 11);
+ BOOST_CHECK(get(transform_value_property_map<add1_val<int>, PM>(add1_val<int>(), orig_pm), 3) == 7);
+ BOOST_CHECK(get(transform_value_property_map<add1_val<int>, PM>(add1_val<int>(), orig_pm), 4) == 9);
+ BOOST_CHECK(get(make_transform_value_property_map<int>(add1_val<int>(), orig_pm), 5) == 11);
+ int val;
+ const transform_value_property_map<return_fixed_ref<int>, PM> pm(return_fixed_ref<int>((&val)), orig_pm);
+ put(pm, 1, 6);
+ BOOST_CHECK(get(pm, 2) == 6);
+ BOOST_CHECK((get(pm, 3) = 7) == 7);
+ BOOST_CHECK(get(pm, 4) == 7);
+ const transform_value_property_map<return_fixed_ref<int>, PM> pm2 = pm; // Check shallow copying
+ BOOST_CHECK(get(pm2, 5) == 7);
+ put(pm2, 3, 1);
+ BOOST_CHECK(get(pm, 1) == 1);
+
+ return 0;
+}