]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide HDF5 quicktest 5756/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 18 Jan 2018 17:10:45 +0000 (18:10 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 20 Jan 2018 13:56:30 +0000 (14:56 +0100)
tests/quick_tests/CMakeLists.txt
tests/quick_tests/hdf5.cc [new file with mode: 0644]

index bebfa03d6afd3a78ad02aaa10ba98f2f5536e9af..8bf68570ba29d042e0e2414e4ed05573daad97d0 100644 (file)
@@ -143,6 +143,11 @@ IF (DEAL_II_WITH_GSL)
   make_quicktest("gsl" ${_mybuild} "")
 ENDIF()
 
+# Test HDF5
+IF (DEAL_II_WITH_HDF5)
+  make_quicktest("hdf5" ${_mybuild} "")
+ENDIF()
+
 # Test Nanoflann
 IF (DEAL_II_WITH_NANOFLANN)
   make_quicktest("nanoflann" ${_mybuild} "")
diff --git a/tests/quick_tests/hdf5.cc b/tests/quick_tests/hdf5.cc
new file mode 100644 (file)
index 0000000..bc26775
--- /dev/null
@@ -0,0 +1,32 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// Test HDF5. Copy-paste from https://support.hdfgroup.org/HDF5/Tutor/crtfile.html
+
+#include <hdf5.h>
+#include <cstdio>
+
+int main()
+{
+  hid_t       file_id;
+  herr_t      status;
+
+  /* Create a new file using default properties. */
+  file_id = H5Fcreate("file.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+  /* Terminate access to the file. */
+  status = H5Fclose(file_id);
+  std::remove ("file.h5");
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.