mirror of
https://github.com/boostorg/histogram.git
synced 2026-02-18 02:02:10 +00:00
More doc improvements
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
# keep in sync with Jamfile
|
||||
boost_test(TYPE compile-fail SOURCES make_histogram_fail0.cpp)
|
||||
boost_test(TYPE compile-fail SOURCES make_histogram_fail1.cpp)
|
||||
boost_test(TYPE run SOURCES algorithm_project_test.cpp
|
||||
LIBRARIES Boost::histogram Boost::core)
|
||||
boost_test(TYPE run SOURCES algorithm_reduce_test.cpp
|
||||
|
||||
@@ -34,6 +34,8 @@ project
|
||||
;
|
||||
|
||||
alias cxx14 :
|
||||
[ compile-fail make_histogram_fail0.cpp ]
|
||||
[ compile-fail make_histogram_fail1.cpp ]
|
||||
[ run algorithm_project_test.cpp ]
|
||||
[ run algorithm_reduce_test.cpp ]
|
||||
[ run algorithm_sum_test.cpp ]
|
||||
|
||||
@@ -134,19 +134,6 @@ int main() {
|
||||
BOOST_TEST_THROWS(detail::bincount(v), std::overflow_error);
|
||||
}
|
||||
|
||||
// common_container
|
||||
{
|
||||
using A = std::array<int, 10>;
|
||||
using B = std::vector<int>;
|
||||
using C = std::map<std::size_t, int>;
|
||||
BOOST_TEST_TRAIT_SAME(detail::common_container<A, B>, A);
|
||||
BOOST_TEST_TRAIT_SAME(detail::common_container<B, A>, A);
|
||||
BOOST_TEST_TRAIT_SAME(detail::common_container<A, C>, A);
|
||||
BOOST_TEST_TRAIT_SAME(detail::common_container<C, A>, A);
|
||||
BOOST_TEST_TRAIT_SAME(detail::common_container<C, B>, B);
|
||||
BOOST_TEST_TRAIT_SAME(detail::common_container<B, C>, B);
|
||||
}
|
||||
|
||||
// common_storage
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(
|
||||
|
||||
@@ -513,6 +513,8 @@ void run_tests() {
|
||||
BOOST_TEST_EQ(h.at(j11), 1);
|
||||
BOOST_TEST_EQ(h[j11], 1);
|
||||
BOOST_TEST_THROWS((void)h.at(j111), std::invalid_argument);
|
||||
int j13[] = {1, 3};
|
||||
BOOST_TEST_THROWS((void)h.at(j13), std::out_of_range);
|
||||
|
||||
// tuple with weight
|
||||
h(std::make_tuple(weight(2), 0, 2.0));
|
||||
|
||||
14
test/make_histogram_fail0.cpp
Normal file
14
test/make_histogram_fail0.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright 2019 Hans Dembinski
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/histogram/make_histogram.hpp>
|
||||
|
||||
using namespace boost::histogram;
|
||||
|
||||
int main() {
|
||||
// argument is not an axis
|
||||
(void)make_histogram(std::vector<int>{});
|
||||
}
|
||||
16
test/make_histogram_fail1.cpp
Normal file
16
test/make_histogram_fail1.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2019 Hans Dembinski
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/histogram/axis/regular.hpp>
|
||||
#include <boost/histogram/make_histogram.hpp>
|
||||
#include <vector>
|
||||
|
||||
using namespace boost::histogram;
|
||||
|
||||
int main() {
|
||||
// first and second arguments switched
|
||||
(void)make_histogram_with(axis::regular<>(3, 0, 1), std::vector<int>{});
|
||||
}
|
||||
Reference in New Issue
Block a user