diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2011-03-03 14:50:04 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2011-03-03 14:50:04 (GMT) |
commit | 070556eca7943dd090e3b11f79382cc76a466646 (patch) | |
tree | a2b8e9ba9d3c717bcef9e8c5bcd8bcdc32b51ec8 /test | |
parent | 28c7a0e0ea9851debd78d3cf289759f7f0d5b506 (diff) | |
download | hdf5-070556eca7943dd090e3b11f79382cc76a466646.zip hdf5-070556eca7943dd090e3b11f79382cc76a466646.tar.gz hdf5-070556eca7943dd090e3b11f79382cc76a466646.tar.bz2 |
[svn-r20181] Bug 2115/605 - I added 2 public macros to the H5public.h - H5_VERSION_GE and H5_VERSION_LE - and put some test cases in tfile.c.
Tested on jam - simple change. I did h5committest on the same change for the trunk.
Diffstat (limited to 'test')
-rw-r--r-- | test/tfile.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/tfile.c b/test/tfile.c index 45fc4af..dcd7d3e 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -2565,6 +2565,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_file(): Main low-level file I/O test routine. ** ****************************************************************/ @@ -2599,6 +2647,7 @@ test_file(void) test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly */ test_libver_bounds(); /* Test compatibility for file space management */ + test_libver_macros(); /* Test the macros for library version comparison */ } /* test_file() */ |