another histogram add test and fixes for python tests

This commit is contained in:
Hans Dembinski 2020-05-27 21:22:24 +02:00 committed by GitHub
parent 751e597384
commit 7f4cb204de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 6 deletions

View File

@ -82,7 +82,8 @@ boost_test(TYPE run SOURCES histogram_fill_test.cpp
COMPILE_OPTIONS $<$<CXX_COMPILER_ID:MSVC>:/bigobj>)
boost_test(TYPE run SOURCES histogram_growing_test.cpp)
boost_test(TYPE run SOURCES histogram_mixed_test.cpp)
boost_test(TYPE run SOURCES histogram_operators_test.cpp)
boost_test(TYPE run SOURCES histogram_operators_test.cpp
COMPILE_OPTIONS $<$<CXX_COMPILER_ID:MSVC>:/bigobj>)
boost_test(TYPE run SOURCES histogram_ostream_test.cpp)
boost_test(TYPE run SOURCES histogram_test.cpp)
boost_test(TYPE run SOURCES indexed_test.cpp)

View File

@ -1,10 +1,10 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright Hans Dembinski 2019
# 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
from __future__ import print_function
import sys
import glob
import os

5
test/check_odr_test.py Normal file → Executable file
View File

@ -1,8 +1,9 @@
#!/usr/bin/env python3
# Copyright 2019 Hans Dembinski, Henry Schreiner
#
# 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)
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
"""
This test makes sure that all boost.histogram headers are included in the ODR test carried out in odr_main_test.cpp. See that file for details on why this test needed.

View File

@ -228,6 +228,36 @@ void run_tests() {
BOOST_TEST_EQ(a.at(2, 1), 1);
}
{
using CI = axis::category<int, use_default, axis::option::growth_t>;
using CS = axis::category<std::string, use_default, axis::option::growth_t>;
auto h1 = make(Tag{}, CI{}, CS{});
auto h2 = make(Tag{}, CI{}, CS{});
auto h3 = make(Tag{}, CI{}, CS{});
h1(1, "b");
h1(2, "a");
h1(1, "a");
h1(2, "b");
h2(2, "b");
h2(3, "b");
h2(4, "c");
h2(5, "c");
h3(1, "b");
h3(2, "a");
h3(1, "a");
h3(2, "b");
h3(2, "b");
h3(3, "b");
h3(4, "c");
h3(5, "c");
BOOST_TEST_EQ(h3, h1 + h2);
}
{
// C2 is not growing and has overflow
using C2 = axis::category<int>;