]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/mpi/test/is_mpi_op_test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / mpi / test / is_mpi_op_test.cpp
CommitLineData
7c673cae
FG
1// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor@gmail.com>
2
3// Use, modification and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7// A test of the is_mpi_op functionality.
8#include <boost/mpi/operations.hpp>
9#include <boost/mpi/environment.hpp>
10#include <boost/type_traits/is_base_and_derived.hpp>
92f5a8d4
TL
11
12#define BOOST_TEST_MODULE mpi_is_mpi_op_test
13#include <boost/test/included/unit_test.hpp>
7c673cae
FG
14
15using namespace boost::mpi;
16using namespace std;
17using boost::is_base_and_derived;
18
92f5a8d4 19BOOST_AUTO_TEST_CASE(mpi_basic_op)
7c673cae 20{
92f5a8d4 21 boost::mpi::environment env;
7c673cae
FG
22
23 // Check each predefined MPI_Op type that we support directly.
92f5a8d4
TL
24 BOOST_TEST((is_mpi_op<minimum<float>, float>::op() == MPI_MIN));
25 BOOST_TEST((is_mpi_op<plus<double>, double>::op() == MPI_SUM));
26 BOOST_TEST((is_mpi_op<multiplies<long>, long>::op() == MPI_PROD));
27 BOOST_TEST((is_mpi_op<logical_and<int>, int>::op() == MPI_LAND));
28 BOOST_TEST((is_mpi_op<bitwise_and<int>, int>::op() == MPI_BAND));
29 BOOST_TEST((is_mpi_op<logical_or<int>, int>::op() == MPI_LOR));
30 BOOST_TEST((is_mpi_op<bitwise_or<int>, int>::op() == MPI_BOR));
31 BOOST_TEST((is_mpi_op<logical_xor<int>, int>::op() == MPI_LXOR));
32 BOOST_TEST((is_mpi_op<bitwise_xor<int>, int>::op() == MPI_BXOR));
7c673cae 33}