hdf5 tests: make cpp test actually use cpp HDF5

the previous version didn't even link to libhdf5_cpp.so
pull/12027/head
George Sedov 1 year ago committed by Eli Schwartz
parent 0c2b616183
commit c2ed846b64
  1. 26
      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;
return EXIT_FAILURE;
}
ier = H5get_libversion(&maj, &min, &rel);
if (ier) {
std::cerr << "HDF5 did not initialize!" << std::endl;
return EXIT_FAILURE;
}
try {
H5::H5Library::open();
H5::H5Library::getLibVersion(maj, min, rel);
std::cout << "C++ HDF5 version " << maj << "." << min << "." << rel << std::endl;
ier = H5close();
if (ier) {
std::cerr << "Unable to close HDF5: " << ier << 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;
}
return EXIT_SUCCESS;
}

Loading…
Cancel
Save