mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-11-03 20:54:07 +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] = "";
|
||||
for (int i=0; i<num; i++){
|
||||
strcat(labelxxx,label[i]);
|
||||
strcat(labelxxx,"\n");
|
||||
strcat(labelxxx,TREXIO_DELIM);
|
||||
}
|
||||
|
||||
/*================= START OF TEST ==================*/
|
||||
@ -180,8 +180,10 @@ int test_h5read() {
|
||||
printf("%s\n", labelxxx);
|
||||
//assert( strcmp(label[1], "Na") == 0 );
|
||||
char * pch;
|
||||
pch = strtok(labelxxx, "\n");
|
||||
pch = strtok(labelxxx, TREXIO_DELIM);
|
||||
assert( strcmp(pch, "C") == 0 );
|
||||
pch = strtok(NULL, TREXIO_DELIM);
|
||||
assert( strcmp(pch, "Na") == 0 );
|
||||
|
||||
// close current session
|
||||
rc = trexio_close(file);
|
||||
|
@ -10,7 +10,7 @@ subroutine test_write()
|
||||
! ============ Test write functionality =============== !
|
||||
|
||||
use trexio
|
||||
use, intrinsic :: iso_c_binding, only: c_new_line
|
||||
use, intrinsic :: iso_c_binding
|
||||
|
||||
implicit none
|
||||
|
||||
@ -47,7 +47,7 @@ subroutine test_write()
|
||||
label_str=''
|
||||
do i = 1,num
|
||||
! 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
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ subroutine test_read()
|
||||
tmp_str=''
|
||||
do j=ind,128
|
||||
|
||||
if ( (label_str(j)==c_new_line) ) then
|
||||
if ( (label_str(j)==TREXIO_DELIM) ) then
|
||||
ind=j+1
|
||||
exit
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user