| 170 | |
| 171 | template <typename T> |
| 172 | void convert_array_storage_impl() { |
| 173 | const auto aref = prepare(1, T(0)); |
| 174 | array_storage<uint8_t> s; |
| 175 | s.reset(1); |
| 176 | s.increase(0); |
| 177 | |
| 178 | auto a = aref; |
| 179 | a = s; |
| 180 | BOOST_TEST_EQ(a[0].value(), 1.0); |
| 181 | BOOST_TEST(a == s); |
| 182 | a.increase(0); |
| 183 | BOOST_TEST(!(a == s)); |
| 184 | |
| 185 | adaptive_storage_type b(s); |
| 186 | BOOST_TEST_EQ(b[0].value(), 1.0); |
| 187 | BOOST_TEST(b == s); |
| 188 | b.increase(0); |
| 189 | BOOST_TEST(!(b == s)); |
| 190 | |
| 191 | auto c = aref; |
| 192 | c.add(0, s[0]); |
| 193 | BOOST_TEST_EQ(c[0].value(), 1.0); |
| 194 | BOOST_TEST(c == s); |
| 195 | BOOST_TEST(s == c); |
| 196 | |
| 197 | array_storage<float> t; |
| 198 | t.reset(1); |
| 199 | t.increase(0); |
| 200 | while (t[0] < 1e20) t.add(0, t[0]); |
| 201 | auto d = aref; |
| 202 | d = t; |
| 203 | BOOST_TEST(d == t); |
| 204 | |
| 205 | auto e = aref; |
| 206 | e = s; |
| 207 | BOOST_TEST_EQ(e[0].value(), 1.0); |
| 208 | BOOST_TEST(e == s); |
| 209 | e.increase(0); |
| 210 | BOOST_TEST(!(e == s)); |
| 211 | |
| 212 | adaptive_storage_type f(s); |
| 213 | BOOST_TEST_EQ(f[0].value(), 1.0); |
| 214 | BOOST_TEST(f == s); |
| 215 | f.increase(0); |
| 216 | BOOST_TEST(!(f == s)); |
| 217 | |
| 218 | auto g = aref; |
| 219 | g.add(0, s[0]); |
| 220 | BOOST_TEST_EQ(g[0].value(), 1.0); |
| 221 | BOOST_TEST(g == s); |
| 222 | BOOST_TEST(s == g); |
| 223 | |
| 224 | array_storage<uint8_t> u; |
| 225 | u.reset(2); |
| 226 | u.increase(0); |
| 227 | auto h = aref; |
| 228 | BOOST_TEST(!(h == u)); |
| 229 | h = u; |