From 2b3e79054a98db33a838033d4127a03ba44035d7 Mon Sep 17 00:00:00 2001 From: q-posev Date: Thu, 10 Jun 2021 16:34:16 +0200 Subject: [PATCH] [WIP] working pieces for read_dset_str [text] --- src/templates_front/templator_front.org | 2 +- tests/test.c | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/templates_front/templator_front.org b/src/templates_front/templator_front.org index e964e4d..1f4c65c 100644 --- a/src/templates_front/templator_front.org +++ b/src/templates_front/templator_front.org @@ -1549,7 +1549,7 @@ trexio_read_$group_dset$ (trexio_t* const file, char* dset, const uint32_t max_s switch (file->back_end) { case TREXIO_TEXT: - //return trexio_text_read_$group_dset$(file, dset, rank, dims); + return trexio_text_read_$group_dset$(file, dset, rank, dims, max_str_len); break; case TREXIO_HDF5: diff --git a/tests/test.c b/tests/test.c index da1a42c..9ff09b7 100644 --- a/tests/test.c +++ b/tests/test.c @@ -57,7 +57,7 @@ int test_write(const char* file_name, const back_end_t backend) { const char* label[] = {"C" , "Na", - "C asdasdasdas" , + "ClH asdasdasdas" , "C" , "C 666" , "C" , @@ -182,17 +182,10 @@ int test_read(const char* file_name, const back_end_t backend) { double x = coord[30] - 2.14171677; assert( x*x < 1.e-14); - if (backend == TREXIO_HDF5) { // read nucleus_label - size_t max_str_len = 16; - label = (char**) malloc(num*sizeof(char*)); - for (int i=0; i