diff options
Diffstat (limited to '')
-rw-r--r-- | test cases/frameworks/25 hdf5/main.c | 30 | ||||
-rw-r--r-- | test cases/frameworks/25 hdf5/main.cpp | 29 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test cases/frameworks/25 hdf5/main.c b/test cases/frameworks/25 hdf5/main.c new file mode 100644 index 0000000..4c46310 --- /dev/null +++ b/test cases/frameworks/25 hdf5/main.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> + +#include "hdf5.h" + +int main(void) +{ +herr_t ier; +unsigned maj, min, rel; + +ier = H5open(); +if (ier) { + fprintf(stderr,"Unable to initialize HDF5: %d\n", ier); + return EXIT_FAILURE; +} + +ier = H5get_libversion(&maj, &min, &rel); +if (ier) { + fprintf(stderr,"HDF5 did not initialize!\n"); + return EXIT_FAILURE; +} +printf("C HDF5 version %d.%d.%d\n", maj, min, rel); + +ier = H5close(); +if (ier) { + fprintf(stderr,"Unable to close HDF5: %d\n", ier); + return EXIT_FAILURE; +} +return EXIT_SUCCESS; +} diff --git a/test cases/frameworks/25 hdf5/main.cpp b/test cases/frameworks/25 hdf5/main.cpp new file mode 100644 index 0000000..477e76b --- /dev/null +++ b/test cases/frameworks/25 hdf5/main.cpp @@ -0,0 +1,29 @@ +#include <iostream> +#include "hdf5.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; +} +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; +} |