Commit 83c2b5fe authored by GILLES Sebastien's avatar GILLES Sebastien

#1470 Add test about printing containers of pointers.

parent be58a7bf
......@@ -6818,6 +6818,13 @@
path = PrintContainer;
sourceTree = "<group>";
};
BE353BB722E8743700A06A8F /* PrintPolicy */ = {
isa = PBXGroup;
children = (
);
path = PrintPolicy;
sourceTree = "<group>";
};
BE372DCD18C47F0500127212 /* Test */ = {
isa = PBXGroup;
children = (
......@@ -9706,6 +9713,7 @@
BEB991B418F42080009ACA4C /* BoolArray.cpp */,
BEB991B518F42080009ACA4C /* BoolArray.hpp */,
BEB991B618F42080009ACA4C /* BoolArray.hxx */,
BE353BB722E8743700A06A8F /* PrintPolicy */,
BE110E8B1E114F1400D2D2C8 /* Internal */,
);
path = Containers;
......@@ -84,5 +84,21 @@ BOOST_AUTO_TEST_CASE(print_tuple)
}
BOOST_AUTO_TEST_CASE(print_vector_of_pointer)
{
std::vector<std::unique_ptr<std::size_t>> vector_of_ptr;
for (auto i = 0ul; i < 10; ++i)
vector_of_ptr.emplace_back(std::make_unique<std::size_t>(i));
std::ostringstream oconv;
Utilities::PrintPointerContainer(vector_of_ptr, oconv, ", ", "{ ", " }");
BOOST_CHECK_EQUAL(oconv.str(), "{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }");
}
PRAGMA_DIAGNOSTIC(pop)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment