Fix nothrow-move-assignable failures in travis

* new tests of nothrow move assignment for builtin axis types
* switch to xenial, which apparently comes with a different glibc version that adds a nothrow move assignment operator for std::string
This commit is contained in:
Hans Dembinski 2019-05-28 13:10:53 +02:00 committed by GitHub
parent ecd142080d
commit 97f8b7dd91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 7 deletions

View File

@ -2,17 +2,13 @@
# subject to 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)
#
# Copyright Antony Polukhin 2014-2019.
# Copyright Hans Dembinski 2019.
#
# See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of the
# original file and how it can be used with Boost libraries.
#
# Based on original work by Antony Polukhin, see https://svn.boost.org/trac/boost/wiki/TravisCoveralss
sudo: false
language: cpp
os: linux
dist: xenial
branches:
only:

View File

@ -10,11 +10,15 @@
#include <limits>
#include <sstream>
#include <string>
#include <type_traits>
#include "utility_axis.hpp"
using namespace boost::histogram;
int main() {
BOOST_TEST(std::is_nothrow_move_assignable<axis::category<int>>::value);
BOOST_TEST(std::is_nothrow_move_assignable<axis::category<std::string>>::value);
// bad_ctors
{
auto empty = std::vector<int>(0);

View File

@ -8,11 +8,14 @@
#include <boost/histogram/axis/integer.hpp>
#include <boost/histogram/detail/throw_exception.hpp>
#include <limits>
#include <type_traits>
#include "utility_axis.hpp"
using namespace boost::histogram;
int main() {
BOOST_TEST(std::is_nothrow_move_assignable<axis::integer<>>::value);
// bad_ctor
{
BOOST_TEST_THROWS(axis::integer<>(1, 1), std::invalid_argument);

View File

@ -9,14 +9,16 @@
#include <boost/histogram/detail/throw_exception.hpp>
#include <limits>
#include <sstream>
#include <type_traits>
#include "is_close.hpp"
#include "utility_axis.hpp"
using namespace boost::histogram;
namespace tr = axis::transform;
using def = use_default;
int main() {
using def = use_default;
BOOST_TEST(std::is_nothrow_move_assignable<axis::regular<>>::value);
// bad_ctors
{

View File

@ -8,6 +8,7 @@
#include <boost/histogram/axis/variable.hpp>
#include <boost/histogram/detail/throw_exception.hpp>
#include <limits>
#include <type_traits>
#include <vector>
#include "is_close.hpp"
#include "utility_axis.hpp"
@ -15,6 +16,8 @@
using namespace boost::histogram;
int main() {
BOOST_TEST(std::is_nothrow_move_assignable<axis::variable<>>::value);
// bad_ctors
{
auto empty = std::vector<double>(0);