#include "trexio.h" #include #include #include #include #define TEST_BACKEND TREXIO_TEXT #define TREXIO_FILE "test_dset_sparse.dir" #define RM_COMMAND "rm -rf " TREXIO_FILE #define SIZE 100 #define N_CHUNKS 5 static int test_write_dset_sparse (const char* file_name, const back_end_t backend) { /* Try to write an array of sparse data into the TREXIO file */ trexio_t* file = NULL; trexio_exit_code rc; /*================= START OF TEST ==================*/ // open file in 'write' mode file = trexio_open(file_name, 'w', backend, &rc); assert (file != NULL); assert (rc == TREXIO_SUCCESS); // parameters to be written int32_t* index; double* value; index = calloc(4L*SIZE, sizeof(int32_t)); value = calloc(SIZE, sizeof(double)); for(int i=0; i