| 80 | } |
| 81 | |
| 82 | void |
| 83 | testCtors() |
| 84 | { |
| 85 | // ~array() |
| 86 | { |
| 87 | // implied |
| 88 | } |
| 89 | |
| 90 | // array() |
| 91 | { |
| 92 | array a; |
| 93 | BOOST_TEST(a.empty()); |
| 94 | BOOST_TEST(a.size() == 0); |
| 95 | } |
| 96 | |
| 97 | // array(storage_ptr) |
| 98 | { |
| 99 | array a(storage_ptr{}); |
| 100 | check_storage(a, storage_ptr{}); |
| 101 | } |
| 102 | |
| 103 | // array(size_type, value, storage) |
| 104 | { |
| 105 | // default storage |
| 106 | { |
| 107 | array a(3, true); |
| 108 | BOOST_TEST(a.size() == 3); |
| 109 | for(auto const& v : a) |
| 110 | BOOST_TEST(v.is_bool()); |
| 111 | check_storage(a, storage_ptr{}); |
| 112 | } |
| 113 | |
| 114 | // construct with zero `true` values |
| 115 | { |
| 116 | array(0, true); |
| 117 | } |
| 118 | |
| 119 | // construct with three `true` values |
| 120 | fail_loop([&](storage_ptr const& sp) |
| 121 | { |
| 122 | array a(3, true, sp); |
| 123 | BOOST_TEST(a.size() == 3); |
| 124 | check_storage(a, sp); |
| 125 | }); |
| 126 | } |
| 127 | |
| 128 | // array(size_type, storage) |
| 129 | { |
| 130 | // default storage |
| 131 | { |
| 132 | array a(3); |
| 133 | BOOST_TEST(a.size() == 3); |
| 134 | for(auto const& v : a) |
| 135 | BOOST_TEST(v.is_null()); |
| 136 | check_storage(a, storage_ptr{}); |
| 137 | } |
| 138 | |
| 139 | // zero size |
nothing calls this directly
no test coverage detected