Update allocate_shared array unit tests

Tests that do not always use allocator bound for element_type.
This commit is contained in:
Glen Fernandes
2017-06-20 20:03:52 -04:00
parent eb8aa36854
commit 6cbc1e6775
8 changed files with 51 additions and 51 deletions

View File

@@ -14,7 +14,7 @@ struct counters {
unsigned construct;
};
template<class T>
template<class T = void>
class creator {
public:
typedef T value_type;
@@ -101,7 +101,7 @@ int main()
{
counters state = { };
boost::shared_ptr<int[]> pointer =
boost::allocate_shared<int[]>(creator<int>(&state), 5);
boost::allocate_shared<int[]>(creator<>(&state), 5);
BOOST_TEST(state.allocate == 1);
BOOST_TEST(state.construct == 5);
pointer.reset();
@@ -111,7 +111,7 @@ int main()
{
counters state = { };
boost::shared_ptr<int[5]> pointer =
boost::allocate_shared<int[5]>(creator<int>(&state));
boost::allocate_shared<int[5]>(creator<>(&state));
BOOST_TEST(state.allocate == 1);
BOOST_TEST(state.construct == 5);
pointer.reset();