no_delete_t.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // no_delete test
4 //
5 // ======================================================================
6 
7 #define BOOST_TEST_MODULE (no_delete test)
8 #include "boost/test/unit_test.hpp"
9 #include "cetlib/no_delete.h"
10 
11 #include <iostream>
12 #include <memory>
13 
14 BOOST_AUTO_TEST_SUITE(no_delete_test)
15 
17 {
18  std::ostringstream oss1, oss2;
19  auto* ossp1 = &oss1;
20  auto* ossp2 = &oss2;
21  {
22  std::shared_ptr<std::ostream>{&oss1, cet::no_delete()};
23  std::unique_ptr<std::ostream, cet::no_delete>{&oss2};
24  }
25  BOOST_TEST(ossp1 == &oss1);
26  BOOST_TEST(ossp2 == &oss2);
27 }
28 
29 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(no_delete_t)
Definition: no_delete_t.cc:16