]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/mpi/test/broadcast_stl_test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / mpi / test / broadcast_stl_test.cpp
index d3c6635b4314d18b16209bc487a402d0e6de17fb..705d6ccb9ab6de626e5f2642009db7caaf8e999b 100644 (file)
@@ -5,19 +5,21 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 // A test of the broadcast() collective.
-#include <boost/mpi/collectives/broadcast.hpp>
-#include <boost/mpi/communicator.hpp>
-#include <boost/mpi/environment.hpp>
-#include <boost/test/minimal.hpp>
-
 #include <algorithm>
 #include <vector>
 #include <map>
 
+#include <boost/mpi/collectives/broadcast.hpp>
+#include <boost/mpi/communicator.hpp>
+#include <boost/mpi/environment.hpp>
+
 #include <boost/serialization/string.hpp>
 #include <boost/serialization/vector.hpp>
 #include <boost/serialization/map.hpp>
 
+#define BOOST_TEST_MODULE mpi_broadcast_stl
+#include <boost/test/included/unit_test.hpp>
+
 namespace mpi = boost::mpi;
 
 typedef std::vector<std::map<int, double> > sparse;
@@ -58,21 +60,16 @@ broadcast_test(const mpi::communicator& comm, const T& bc_value,
   }
 }
 
-int test_main(int argc, char* argv[])
+BOOST_AUTO_TEST_CASE(broadcast_stl)
 {
-  boost::mpi::environment env(argc, argv);
+  boost::mpi::environment env;
 
   mpi::communicator comm;
-  if (comm.size() == 1) {
-    std::cerr << "ERROR: Must run the broadcast test with more than one "
-              << "process." << std::endl;
-    comm.abort(-1);
-  }
+  BOOST_TEST_REQUIRE(comm.size() > 1);
   
   sparse s;
   s.resize(2);
   s[0][12] = 0.12;
   s[1][13] = 1.13;
   broadcast_test(comm, s, "sparse");
-  return 0;
 }