1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

shift values in the basic_nucleus_index array

This commit is contained in:
q-posev 2021-06-23 16:51:33 +02:00
parent 6637cfd6ce
commit 58c6de9963
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ static int test_write_dset (const char* file_name, const back_end_t backend) {
// parameters to be written
int num = 12;
int nucl_index[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
int nucl_index[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
/*================= START OF TEST ==================*/
@ -99,7 +99,7 @@ static int test_read_dset (const char* file_name, const back_end_t backend) {
nucl_index = (int*) calloc(num, sizeof(int));
rc = trexio_read_basis_nucleus_index(file, nucl_index);
assert (rc == TREXIO_SUCCESS);
assert ( nucl_index[num-1] == num );
assert (nucl_index[num-1] == num-1);
free(nucl_index);
@ -125,7 +125,7 @@ int main(void) {
test_has_dset (TREXIO_FILE, TEST_BACKEND);
test_read_dset (TREXIO_FILE, TEST_BACKEND);
//rc = system(RM_COMMAND);
rc = system(RM_COMMAND);
assert (rc == 0);
return 0;

View File

@ -16,7 +16,7 @@ static int test_write_dset (const char* file_name, const back_end_t backend) {
// parameters to be written
int num = 12;
int nucl_index[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
int nucl_index[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
/*================= START OF TEST ==================*/
@ -99,7 +99,7 @@ static int test_read_dset (const char* file_name, const back_end_t backend) {
nucl_index = (int*) calloc(num, sizeof(int));
rc = trexio_read_basis_nucleus_index(file, nucl_index);
assert (rc == TREXIO_SUCCESS);
assert ( nucl_index[num-1] == num );
assert (nucl_index[num-1] == num-1);
free(nucl_index);