Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2007-09-06 08:44:34


Author: asutton
Date: 2007-09-06 08:44:32 EDT (Thu, 06 Sep 2007)
New Revision: 39135
URL: http://svn.boost.org/trac/boost/changeset/39135

Log:
Moved some files around
Wrote a little bit more in the way of compile test

Added:
   sandbox/graph-v2/libs/property_map/test/runtime/
   sandbox/graph-v2/libs/property_map/test/runtime/dynamic_properties_test.cpp
      - copied unchanged from r39114, /sandbox/graph-v2/libs/property_map/test/dynamic_properties_test.cpp
   sandbox/graph-v2/libs/property_map/test/runtime/property_map_cc.cpp
      - copied unchanged from r39114, /sandbox/graph-v2/libs/property_map/test/property_map_cc.cpp
Removed:
   sandbox/graph-v2/libs/property_map/test/dynamic_properties_test.cpp
   sandbox/graph-v2/libs/property_map/test/property_map_cc.cpp
Text files modified:
   sandbox/graph-v2/libs/property_map/test/compile/Jamfile | 2 +-
   sandbox/graph-v2/libs/property_map/test/compile/compile.cpp | 14 +++++++++++++-
   sandbox/graph-v2/libs/property_map/test/compile/identity.cpp | 2 +-
   3 files changed, 15 insertions(+), 3 deletions(-)

Modified: sandbox/graph-v2/libs/property_map/test/compile/Jamfile
==============================================================================
--- sandbox/graph-v2/libs/property_map/test/compile/Jamfile (original)
+++ sandbox/graph-v2/libs/property_map/test/compile/Jamfile 2007-09-06 08:44:32 EDT (Thu, 06 Sep 2007)
@@ -1,4 +1,4 @@
-# (C) Andrew Sutton 2007
+# (C) Copyright Andrew Sutton 2007
 #
 # Distributed under the Boost Software License, Version 1.0. (See
 # accompanying file LICENSE_1_0.txt or copy at

Modified: sandbox/graph-v2/libs/property_map/test/compile/compile.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/test/compile/compile.cpp (original)
+++ sandbox/graph-v2/libs/property_map/test/compile/compile.cpp 2007-09-06 08:44:32 EDT (Thu, 06 Sep 2007)
@@ -1,4 +1,4 @@
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -13,6 +13,7 @@
 #include <boost/property_map/constant_property_map.hpp>
 #include <boost/property_map/identity_property_map.hpp>
 #include <boost/property_map/dummy_property_map.hpp>
+#include <boost/property_map/dynamic_property_map.hpp>
 
 int main()
 {
@@ -94,4 +95,15 @@
         DummyMap dmap;
         put(dmap, k, v);
     }
+
+ {
+ // construct a couple different property maps
+ constant_property_map<Key, Value> cmap(v);
+ reference_property_map<Key, Value> rmap(v);
+
+ dynamic_properties dp;
+ dp.property("constant", cmap);
+ // dp.property("reference", rmap);
+
+ }
 }

Modified: sandbox/graph-v2/libs/property_map/test/compile/identity.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/test/compile/identity.cpp (original)
+++ sandbox/graph-v2/libs/property_map/test/compile/identity.cpp 2007-09-06 08:44:32 EDT (Thu, 06 Sep 2007)
@@ -1,4 +1,4 @@
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Deleted: sandbox/graph-v2/libs/property_map/test/dynamic_properties_test.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/test/dynamic_properties_test.cpp 2007-09-06 08:44:32 EDT (Thu, 06 Sep 2007)
+++ (empty file)
@@ -1,136 +0,0 @@
-
-// 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/dynamic_property_map.hpp>
-#include <boost/property_map.hpp>
-#include <map>
-#include <iostream>
-#include <string>
-
-// 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!
-std::auto_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);
-
- std::auto_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;
-}

Deleted: sandbox/graph-v2/libs/property_map/test/property_map_cc.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/test/property_map_cc.cpp 2007-09-06 08:44:32 EDT (Thu, 06 Sep 2007)
+++ (empty file)
@@ -1,107 +0,0 @@
-// (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.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;
- function_requires<ReadablePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef null_archetype<> Key;
- typedef assignable_archetype<copy_constructible_archetype<> > Value;
- typedef writable_property_map_archetype<Key, Value> PMap;
- function_requires<WritablePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef null_archetype<> Key;
- typedef assignable_archetype<copy_constructible_archetype<> > Value;
- typedef read_write_property_map_archetype<Key, Value> PMap;
- function_requires<ReadWritePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef null_archetype<> Key;
- typedef assignable_archetype<copy_constructible_archetype<> > Value;
- typedef lvalue_property_map_archetype<Key, Value> PMap;
- function_requires<LvaluePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef null_archetype<> Key;
- typedef assignable_archetype<copy_constructible_archetype<> > Value;
- typedef mutable_lvalue_property_map_archetype<Key, Value> PMap;
- function_requires<Mutable_LvaluePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef std::ptrdiff_t Key;
- typedef int* PMap;
- function_requires<Mutable_LvaluePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef std::ptrdiff_t Key;
- typedef const int* PMap;
- function_requires<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;
- function_requires<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;
- function_requires<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;
- function_requires<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;
- function_requires<LvaluePropertyMapConcept<PMap, Key> >();
- }
- {
- typedef identity_property_map PMap;
- function_requires<ReadablePropertyMapConcept<PMap, int> >();
- }
- {
- typedef dummy_property_map PMap;
- function_requires<ReadWritePropertyMapConcept<PMap, int> >();
- }
- return 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