| 88 | } |
| 89 | |
| 90 | void |
| 91 | testConstruction() |
| 92 | { |
| 93 | test_vectors const t; |
| 94 | |
| 95 | // string() |
| 96 | { |
| 97 | string s; |
| 98 | } |
| 99 | |
| 100 | // string(storage_ptr) |
| 101 | { |
| 102 | auto const sp = |
| 103 | make_shared_resource<unique_resource>(); |
| 104 | string s(sp); |
| 105 | BOOST_TEST(s.empty()); |
| 106 | BOOST_TEST(*s.storage() == *sp.get()); |
| 107 | } |
| 108 | |
| 109 | // string(size_type, char, storage_ptr) |
| 110 | { |
| 111 | fail_loop([&](storage_ptr const& sp) |
| 112 | { |
| 113 | string s(t.v1.size(), '*', sp); |
| 114 | BOOST_TEST(s == std::string(t.v1.size(), '*')); |
| 115 | }); |
| 116 | |
| 117 | { |
| 118 | string s(t.v2.size(), '*'); |
| 119 | BOOST_TEST(s == std::string(t.v2.size(), '*')); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | // string(char const*, storage_ptr) |
| 124 | { |
| 125 | fail_loop([&](storage_ptr const& sp) |
| 126 | { |
| 127 | string s(t.s1.c_str(), sp); |
| 128 | BOOST_TEST(s == t.v1); |
| 129 | }); |
| 130 | |
| 131 | fail_loop([&](storage_ptr const& sp) |
| 132 | { |
| 133 | string s(t.s2.c_str(), sp); |
| 134 | BOOST_TEST(s == t.v2); |
| 135 | }); |
| 136 | |
| 137 | { |
| 138 | string s(t.s1.c_str()); |
| 139 | BOOST_TEST(s == t.v1); |
| 140 | } |
| 141 | |
| 142 | { |
| 143 | string s(t.s2.c_str()); |
| 144 | BOOST_TEST(s == t.v2); |
| 145 | } |
| 146 | } |
| 147 |
nothing calls this directly
no test coverage detected