mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-03 10:06:01 +01:00
fix names and typos
This commit is contained in:
parent
91319ec3e8
commit
c010331114
@ -12,18 +12,18 @@ int main() {
|
|||||||
/*============== Main test launcher ================*/
|
/*============== Main test launcher ================*/
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
rc = system("rm -rf test_write.h5");
|
rc = system("rm -rf test_all.h5");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
test_write("test_write.h5", TREXIO_HDF5);
|
test_write("test_all.h5", TREXIO_HDF5);
|
||||||
test_read ("test_write.h5", TREXIO_HDF5);
|
test_read ("test_all.h5", TREXIO_HDF5);
|
||||||
rc = system("rm -rf test_write.h5");
|
rc = system("rm -rf test_all.h5");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
|
|
||||||
rc = system("rm -rf test_write.dir");
|
rc = system("rm -rf test_all.dir");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
test_write("test_write.dir", TREXIO_TEXT);
|
test_write("test_all.dir", TREXIO_TEXT);
|
||||||
test_read ("test_write.dir", TREXIO_TEXT);
|
test_read ("test_all.dir", TREXIO_TEXT);
|
||||||
rc = system("rm -rf test_write.dir");
|
rc = system("rm -rf test_all.dir");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -68,7 +68,7 @@ int test_write(const char* file_name, const back_end_t backend) {
|
|||||||
"H" ,
|
"H" ,
|
||||||
"H" };
|
"H" };
|
||||||
|
|
||||||
const char* sym = "B3U and some stuff";
|
const char* sym = "B3U with some comments";
|
||||||
/*================= START OF TEST ==================*/
|
/*================= START OF TEST ==================*/
|
||||||
|
|
||||||
// open file in 'write' mode
|
// open file in 'write' mode
|
||||||
@ -113,7 +113,7 @@ int test_write(const char* file_name, const back_end_t backend) {
|
|||||||
// should not work: try to overwrite the num variable
|
// should not work: try to overwrite the num variable
|
||||||
rc = trexio_write_nucleus_num(file,25);
|
rc = trexio_write_nucleus_num(file,25);
|
||||||
printf("Test error message: %s\n", trexio_string_of_error(rc));
|
printf("Test error message: %s\n", trexio_string_of_error(rc));
|
||||||
assert (rc == TREXIO_NUM_ALREADY_EXISTS);
|
assert (rc == TREXIO_ATTR_ALREADY_EXISTS);
|
||||||
|
|
||||||
// should not work: try to overwrite the dset
|
// should not work: try to overwrite the dset
|
||||||
coord[0] = 666.666;
|
coord[0] = 666.666;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define TEST_BACKEND TREXIO_HDF5
|
#define TEST_BACKEND TREXIO_HDF5
|
||||||
#define TREXIO_FILE "test_num.h5"
|
#define TREXIO_FILE "test.h5"
|
||||||
#define RM_COMMAND "rm -rf " TREXIO_FILE
|
#define RM_COMMAND "rm -rf " TREXIO_FILE
|
||||||
|
|
||||||
static int test_write_num (const char* file_name, const back_end_t backend) {
|
static int test_write_num (const char* file_name, const back_end_t backend) {
|
||||||
@ -46,7 +46,7 @@ static int test_has_num (const char* file_name, const back_end_t backend) {
|
|||||||
|
|
||||||
/*================= START OF TEST ==================*/
|
/*================= START OF TEST ==================*/
|
||||||
|
|
||||||
// open file in 'write' mode
|
// open file
|
||||||
file = trexio_open(file_name, 'r', backend);
|
file = trexio_open(file_name, 'r', backend);
|
||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
@ -80,8 +80,8 @@ static int test_read_num (const char* file_name, const back_end_t backend) {
|
|||||||
|
|
||||||
/*================= START OF TEST ==================*/
|
/*================= START OF TEST ==================*/
|
||||||
|
|
||||||
// open file in 'write' mode
|
// open file in 'read' mode
|
||||||
file = trexio_open(file_name, 'w', backend);
|
file = trexio_open(file_name, 'r', backend);
|
||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
// read numerical attribute from the file
|
// read numerical attribute from the file
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define TEST_BACKEND TREXIO_TEXT
|
#define TEST_BACKEND TREXIO_TEXT
|
||||||
#define TREXIO_FILE "test_num.dir"
|
#define TREXIO_FILE "test.dir"
|
||||||
#define RM_COMMAND "rm -rf " TREXIO_FILE
|
#define RM_COMMAND "rm -rf " TREXIO_FILE
|
||||||
|
|
||||||
static int test_write_num (const char* file_name, const back_end_t backend) {
|
static int test_write_num (const char* file_name, const back_end_t backend) {
|
||||||
@ -46,7 +46,7 @@ static int test_has_num (const char* file_name, const back_end_t backend) {
|
|||||||
|
|
||||||
/*================= START OF TEST ==================*/
|
/*================= START OF TEST ==================*/
|
||||||
|
|
||||||
// open file in 'write' mode
|
// open file
|
||||||
file = trexio_open(file_name, 'r', backend);
|
file = trexio_open(file_name, 'r', backend);
|
||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
@ -80,8 +80,8 @@ static int test_read_num (const char* file_name, const back_end_t backend) {
|
|||||||
|
|
||||||
/*================= START OF TEST ==================*/
|
/*================= START OF TEST ==================*/
|
||||||
|
|
||||||
// open file in 'write' mode
|
// open file in 'read' mode
|
||||||
file = trexio_open(file_name, 'w', backend);
|
file = trexio_open(file_name, 'r', backend);
|
||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
// read numerical attribute from the file
|
// read numerical attribute from the file
|
||||||
|
Loading…
Reference in New Issue
Block a user