]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/histogram/test/storage_adaptor_threaded_test.cpp
1 // Copyright 2019 Hans Dembinski
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #include <boost/core/lightweight_test.hpp>
8 #include <boost/histogram/accumulators/count.hpp>
9 #include <boost/histogram/accumulators/ostream.hpp>
10 #include <boost/histogram/storage_adaptor.hpp>
11 #include "throw_exception.hpp"
17 #include <unordered_map>
20 using namespace boost::histogram
;
22 constexpr auto n_fill
= 1000000;
31 for (unsigned i
= 0; i
< n_fill
; ++i
) {
46 BOOST_TEST_EQ(s
[0], 4 * 2 * n_fill
);
51 using ts_int
= accumulators::count
<int, true>;
52 tests
<std::vector
<ts_int
>>();
53 tests
<std::array
<ts_int
, 100>>();
54 tests
<std::deque
<ts_int
>>();
55 // stdlib maps are not thread-safe and not supported
57 return boost::report_errors();