Skip to content

Commit

Permalink
Add a test for ArborX version macros
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Jan 13, 2025
1 parent 9c6f554 commit 31857fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ add_executable(ArborX_Test_CompileOnly.exe
tstCompileOnlyCallbacks.cpp
tstCompileOnlyTypeRequirements.cpp
tstCompileOnlyWeightedEdges.cpp
tstCompileOnlyVersionMacros.cpp
tstCompileOnlyMain.cpp
)
target_link_libraries(ArborX_Test_CompileOnly.exe PRIVATE ArborX)
Expand Down
24 changes: 24 additions & 0 deletions test/tstCompileOnlyVersionMacros.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <ArborX_Config.hpp>

#ifndef ARBORX_VERSION
static_assert(false, "ARBORX_VERSION macro is not defined!");
#endif

#ifndef ARBORX_VERSION_MAJOR
static_assert(false, "ARBORX_VERSION_MAJOR macro is not defined!");
#endif

#ifndef ARBORX_VERSION_MINOR
static_assert(false, "ARBORX_VERSION_MINOR macro is not defined!");
#endif

#ifndef ARBORX_VERSION_PATCH
static_assert(false, "ARBORX_VERSION_PATCH macro is not defined!");
#endif

static_assert(0 <= ARBORX_VERSION_MAJOR && ARBORX_VERSION_MAJOR <= 99);
static_assert(0 <= ARBORX_VERSION_MINOR && ARBORX_VERSION_MINOR <= 99);
static_assert(0 <= ARBORX_VERSION_PATCH && ARBORX_VERSION_PATCH <= 99);
static_assert(ARBORX_VERSION == ARBORX_VERSION_MAJOR * 10000 +
ARBORX_VERSION_MINOR * 100 +
ARBORX_VERSION_PATCH);

0 comments on commit 31857fd

Please sign in to comment.