From ccf03370f773b49fe21a32aa129b74ba2b2cab5b Mon Sep 17 00:00:00 2001 From: q-posev Date: Wed, 3 Mar 2021 11:49:42 +0100 Subject: [PATCH] add test for append in h5 --- src/test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test.c b/src/test.c index 3207282..f8dcbba 100644 --- a/src/test.c +++ b/src/test.c @@ -59,6 +59,18 @@ int test_h5write() { rc = trexio_write_nucleus_num(file,25); assert (rc != TREXIO_SUCCESS); + // close current session + rc = trexio_close(file); + assert (rc == TREXIO_SUCCESS); + + file = trexio_open(file_name, 'a', TREXIO_HDF5); + assert (file != NULL); + + // works: try to read the nucleus_num from existing file + rc = trexio_read_nucleus_num(file,&num); + assert (rc == TREXIO_SUCCESS); + assert (num == 12); + // works: try to rewrite the nucleus_coord coord[0] = 666.666; rc = trexio_write_nucleus_coord(file,coord);