TIMPI
utility_unit.C
Go to the documentation of this file.
1 #include <timpi/timpi.h>
2 
3 #include <timpi/timpi_version.h>
4 
5 #define TIMPI_UNIT_ASSERT(expr) \
6  if (!(expr)) \
7  timpi_error();
8 
9 using namespace TIMPI;
10 
12 
14  {
15  std::string build_string = timpi_version_string();
16  TIMPI_UNIT_ASSERT(build_string.find("Version = 1.8.5") != std::string::npos);
17  TIMPI_UNIT_ASSERT(build_string.find("Build Date") != std::string::npos);
18  TIMPI_UNIT_ASSERT(build_string.find("C++ Config") != std::string::npos);
19  TIMPI_UNIT_ASSERT(build_string.find("Using find correctly") == std::string::npos);
20  }
21 
23  {
24  int version = get_timpi_version();
25  TIMPI_UNIT_ASSERT(version == 10805);
26  }
27 
28 
29 int main(int argc, const char * const * argv)
30 {
31  TIMPI::TIMPIInit init(argc, argv);
32  TestCommWorld = &init.comm();
33 
36 
37  return 0;
38 }
The TIMPIInit class, when constructed, initializes any dependent libraries (e.g.
Definition: timpi_init.h:57
Encapsulates the MPI_Comm object.
Definition: communicator.h:108
std::string timpi_version_string()
Definition: timpi_version.C:31
int main(int argc, const char *const *argv)
Definition: utility_unit.C:29
void testVersionString()
Definition: utility_unit.C:13
void testVersionNumber()
Definition: utility_unit.C:22
int get_timpi_version()
Definition: timpi_version.C:53
const Communicator & comm() const
Returns the Communicator created by this object, which will be a compatibility shim if MPI is not ena...
Definition: timpi_init.h:100
Communicator * TestCommWorld
Definition: utility_unit.C:11