summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/tfile.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/tfile.c b/test/tfile.c
index 7939491..89cc2bd 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -3114,6 +3114,54 @@ test_libver_bounds(void)
/****************************************************************
**
+** test_libver_macros():
+** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly.
+**
+****************************************************************/
+static void
+test_libver_macros(void)
+{
+ unsigned major = H5_VERS_MAJOR;
+ unsigned minor = H5_VERS_MINOR;
+ unsigned release = H5_VERS_RELEASE;
+ herr_t ret; /* Return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing macros for library version comparison\n"));
+
+ VERIFY(H5_VERSION_GE(major,minor,release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major-1,minor,release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major-1,minor+1,release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major-1,minor,release+1), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major,minor-1,release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major,minor-1,release+1), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major,minor,release-1), TRUE, "H5_VERSION_GE");
+
+ VERIFY(H5_VERSION_GE(major+1,minor,release), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major+1,minor-1,release), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major+1,minor-1,release-1), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major,minor+1,release), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major,minor+1,release-1), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major,minor,release+1), FALSE, "H5_VERSION_GE");
+
+ VERIFY(H5_VERSION_LE(major,minor,release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major+1,minor,release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major+1,minor-1,release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major+1,minor-1,release-1), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major,minor+1,release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major,minor+1,release-1), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major,minor,release+1), TRUE, "H5_VERSION_LE");
+
+ VERIFY(H5_VERSION_LE(major-1,minor,release), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major-1,minor+1,release), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major-1,minor+1,release+1), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major,minor-1,release), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major,minor-1,release+1), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major,minor,release-1), FALSE, "H5_VERSION_LE");
+} /* test_libver_macros() */
+
+/****************************************************************
+**
** test_deprec():
** Test deprecated functionality.
**
@@ -3292,6 +3340,7 @@ test_file(void)
test_filespace_info(); /* Test file creation public routines:H5Pget/set_file_space */
test_filespace_compatible();/* Test compatibility for file space management */
test_libver_bounds(); /* Test compatibility for file space management */
+ test_libver_macros(); /* Test the macros for library version comparison */
#ifndef H5_NO_DEPRECATED_SYMBOLS
test_deprec(); /* Test deprecated routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */