Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/cmake_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(cmake_subdir_test LANGUAGES CXX)
# Those 2 should work the same
# while using find_package for the installed Boost avoids the need to manually specify dependencies
if(BOOST_CI_INSTALL_TEST)
find_package(boost_property_map REQUIRED)
find_package(Boost REQUIRED COMPONENTS property_map)
else()
set(BOOST_INCLUDE_LIBRARIES property_map)
add_subdirectory(../../../.. deps/boost EXCLUDE_FROM_ALL)
Expand Down
23 changes: 9 additions & 14 deletions test/dynamic_properties_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,22 @@
#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&,
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;
using map_t = std::map<std::string, std::string>;
using property_t = boost::associative_property_map<map_t>;
using adaptor_t = boost::detail::dynamic_property_map_adaptor<property_t>;

// property_t only views mymap, so the returned shared_ptr's deleter holds
// mymap to keep it alive as long as the adaptor.
std::shared_ptr<map_t> mymap = std::make_shared<map_t>();
adaptor_t* adaptor = new adaptor_t(property_t(*mymap));

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;
return boost::shared_ptr<boost::dynamic_property_map>(
adaptor, [mymap](boost::dynamic_property_map* p) { delete p; });
}


Expand Down
2 changes: 0 additions & 2 deletions test/suppressions.txt

This file was deleted.

Loading