mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-03 10:06:01 +01:00
adapt tests to use TREXIO_DELIM as a delimeter
This commit is contained in:
parent
aa4251b943
commit
313ab12c61
@ -67,7 +67,7 @@ int test_h5write() {
|
|||||||
char labelxxx[128] = "";
|
char labelxxx[128] = "";
|
||||||
for (int i=0; i<num; i++){
|
for (int i=0; i<num; i++){
|
||||||
strcat(labelxxx,label[i]);
|
strcat(labelxxx,label[i]);
|
||||||
strcat(labelxxx,"\n");
|
strcat(labelxxx,TREXIO_DELIM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*================= START OF TEST ==================*/
|
/*================= START OF TEST ==================*/
|
||||||
@ -180,8 +180,10 @@ int test_h5read() {
|
|||||||
printf("%s\n", labelxxx);
|
printf("%s\n", labelxxx);
|
||||||
//assert( strcmp(label[1], "Na") == 0 );
|
//assert( strcmp(label[1], "Na") == 0 );
|
||||||
char * pch;
|
char * pch;
|
||||||
pch = strtok(labelxxx, "\n");
|
pch = strtok(labelxxx, TREXIO_DELIM);
|
||||||
assert( strcmp(pch, "C") == 0 );
|
assert( strcmp(pch, "C") == 0 );
|
||||||
|
pch = strtok(NULL, TREXIO_DELIM);
|
||||||
|
assert( strcmp(pch, "Na") == 0 );
|
||||||
|
|
||||||
// close current session
|
// close current session
|
||||||
rc = trexio_close(file);
|
rc = trexio_close(file);
|
||||||
|
@ -10,7 +10,7 @@ subroutine test_write()
|
|||||||
! ============ Test write functionality =============== !
|
! ============ Test write functionality =============== !
|
||||||
|
|
||||||
use trexio
|
use trexio
|
||||||
use, intrinsic :: iso_c_binding, only: c_new_line
|
use, intrinsic :: iso_c_binding
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ subroutine test_write()
|
|||||||
label_str=''
|
label_str=''
|
||||||
do i = 1,num
|
do i = 1,num
|
||||||
! label_str=label_str//trim(label(i))//' '
|
! label_str=label_str//trim(label(i))//' '
|
||||||
label_str=label_str//trim(label(i))//c_new_line
|
label_str=label_str//trim(label(i))//TREXIO_DELIM
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ subroutine test_read()
|
|||||||
tmp_str=''
|
tmp_str=''
|
||||||
do j=ind,128
|
do j=ind,128
|
||||||
|
|
||||||
if ( (label_str(j)==c_new_line) ) then
|
if ( (label_str(j)==TREXIO_DELIM) ) then
|
||||||
ind=j+1
|
ind=j+1
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user