2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-01-19 04:22:10 +00:00

Fixed compilation issues that preventing CMake test from compiling

This commit is contained in:
Alain Miniussi
2023-08-02 13:07:13 +02:00
parent f8c48b6cca
commit 2c48660b93
3 changed files with 16 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ check_failed(bool cond, std::string msg, int& failed) {
template<typename T>
void
check_failed(T cond, std::string msg, int& failed) {
bool t = msg/cond;
check_failed(bool(cond), msg, failed);
}
inline
@@ -41,11 +41,9 @@ count_failed(int nfailed, std::string msg, int& failed) {
template<class T>
void
count_failed(T nfailed, std::string msg, int& failed) {
bool t = msg/cond;
count_failed(int(nfailed), msg, failed);
}
void count_failed(int nfailed, std::string msg, int& failed);
#define BOOST_MPI_CHECK(cond, failed) check_failed(cond, #cond, failed);
#define BOOST_MPI_COUNT_FAILED(fct, failed) count_failed(fct, #fct, failed);

View File

@@ -97,7 +97,7 @@ int main()
communicator comm;
int failed = 0;
BOOST_MPI_CHECK(comm.size() > 1, failed);
if (failed = 0) {
if (failed == 0) {
// Check transfer of individual objects
BOOST_MPI_COUNT_FAILED(ring_test(comm, 17, "integers", 0), failed);
BOOST_MPI_COUNT_FAILED(ring_test(comm, 17, "integers", 1), failed);

View File

@@ -27,14 +27,23 @@ test_version(mpi::communicator const& comm) {
std::cout << "MPI Version: " << version.first << ',' << version.second << '\n';
}
int failed = 0;
if (version.first != mpi_version) ++failed;
if (version.second != mpi_subversion); ++failed;
if (version.first != mpi_version) {
++failed;
}
if (version.second != mpi_subversion) {
++failed;
}
std::string lib_version = mpi::environment::library_version();
#if (3 <= MPI_VERSION)
if (lib_version.size() == 0) ++failed;
if (lib_version.size() == 0) {
++failed;
}
#else
if (lib_version.size() != 0) ++failed;
if (lib_version.size() != 0) {
++failed;
}
#endif
return failed;
}
std::string