#include "trexio.h" #include #include #include #include int test_write(const char* file_name, const back_end_t backend); int test_read(const char* file_name, const back_end_t backend); int main() { /*============== Main test launcher ================*/ int rc; rc = system("rm -rf test_write.h5"); assert (rc == 0); test_write("test_write.h5", TREXIO_HDF5); test_read ("test_write.h5", TREXIO_HDF5); rc = system("rm -rf test_write.h5"); assert (rc == 0); rc = system("rm -rf test_write.dir"); assert (rc == 0); test_write("test_write.dir", TREXIO_TEXT); test_read ("test_write.dir", TREXIO_TEXT); rc = system("rm -rf test_write.dir"); assert (rc == 0); return 0; } int test_write(const char* file_name, const back_end_t backend) { /*======== Test write ===========*/ trexio_t* file = NULL; trexio_exit_code rc; // parameters to be written int num = 12; double charge[12] = {6., 6., 6., 6., 6., 6., 1., 1., 1., 1., 1., 1.}; double coord[36] = { 0.00000000 , 1.39250319 , 0.00000000 , -1.20594314 , 0.69625160 , 0.00000000 , -1.20594314 , -0.69625160 , 0.00000000 , 0.00000000 , -1.39250319 , 0.00000000 , 1.20594314 , -0.69625160 , 0.00000000 , 1.20594314 , 0.69625160 , 0.00000000 , -2.14171677 , 1.23652075 , 0.00000000 , -2.14171677 , -1.23652075 , 0.00000000 , 0.00000000 , -2.47304151 , 0.00000000 , 2.14171677 , -1.23652075 , 0.00000000 , 2.14171677 , 1.23652075 , 0.00000000 , 0.00000000 , 2.47304151 , 0.00000000 , }; const char* label[] = {"C" , "Na", "ClH asdasdasdas" , "C" , "C 666" , "C" , "H" , "Ru", "H" , "H 999asdasd" , "H" , "H" }; //char labelxxx[] = "C C C Na C C H H H Ru H H"; char labelxxx[128] = ""; for (int i=0; i