TIMPI
Loading...
Searching...
No Matches
test
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
11
Communicator
*
TestCommWorld
;
12
13
void
testVersionString
()
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
22
void
testVersionNumber
()
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
34
testVersionString
();
35
testVersionNumber
();
36
37
return
0;
38
}
TIMPI::Communicator
Encapsulates the MPI_Comm object.
Definition
communicator.h:109
TIMPI::TIMPIInit
The TIMPIInit class, when constructed, initializes any dependent libraries (e.g.
Definition
timpi_init.h:58
TIMPI
Definition
parallel_sync.h:36
TIMPI::timpi_version_string
std::string timpi_version_string()
Definition
timpi_version.C:31
TIMPI::cast_int
Tnew cast_int(Told oldvar)
Definition
timpi_assert.h:297
TIMPI::get_timpi_version
int get_timpi_version()
Definition
timpi_version.C:53
timpi.h
testVersionNumber
void testVersionNumber()
Definition
utility_unit.C:22
TestCommWorld
Communicator * TestCommWorld
Definition
utility_unit.C:11
testVersionString
void testVersionString()
Definition
utility_unit.C:13
main
int main()
Definition
version.C:20
Generated on Fri Aug 21 2026 13:32:13 for TIMPI by
1.9.8