aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorGeorge Sedov <radist.morse@gmail.com>2023-07-17 17:41:11 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-07-23 13:52:39 -0400
commitc2ed846b64f02653d1460855c0aadef20308fc1f (patch)
tree6209f83b08808c3846c9c23dba096509183262f9 /test cases
parent0c2b61618322cc5fa6c0658b9dac75613221839e (diff)
downloadmeson-c2ed846b64f02653d1460855c0aadef20308fc1f.zip
meson-c2ed846b64f02653d1460855c0aadef20308fc1f.tar.gz
meson-c2ed846b64f02653d1460855c0aadef20308fc1f.tar.bz2
hdf5 tests: make cpp test actually use cpp HDF5
the previous version didn't even link to libhdf5_cpp.so
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/25 hdf5/main.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/test cases/frameworks/25 hdf5/main.cpp b/test cases/frameworks/25 hdf5/main.cpp
index 477e76b..9c7f7bf 100644
--- a/test cases/frameworks/25 hdf5/main.cpp
+++ b/test cases/frameworks/25 hdf5/main.cpp
@@ -1,29 +1,19 @@
#include <iostream>
-#include "hdf5.h"
+#include "H5Cpp.h"
int main(void)
{
-herr_t ier;
unsigned maj, min, rel;
-ier = H5open();
-if (ier) {
- std::cerr << "Unable to initialize HDF5: " << ier << std::endl;
+try {
+ H5::H5Library::open();
+ H5::H5Library::getLibVersion(maj, min, rel);
+ std::cout << "C++ HDF5 version " << maj << "." << min << "." << rel << std::endl;
+ H5::H5Library::close();
+ return EXIT_SUCCESS;
+} catch (H5::LibraryIException &e) {
+ std::cerr << "Exception caught from HDF5: " << e.getDetailMsg() << std::endl;
return EXIT_FAILURE;
}
-
-ier = H5get_libversion(&maj, &min, &rel);
-if (ier) {
- std::cerr << "HDF5 did not initialize!" << std::endl;
- return EXIT_FAILURE;
-}
-std::cout << "C++ HDF5 version " << maj << "." << min << "." << rel << std::endl;
-
-ier = H5close();
-if (ier) {
- std::cerr << "Unable to close HDF5: " << ier << std::endl;
- return EXIT_FAILURE;
-}
-return EXIT_SUCCESS;
}