Skip to content

Commit

Permalink
more test development
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Sep 5, 2019
1 parent 1503141 commit 9633f7f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/cunit/test_async_1d.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(int argc, char **argv)
/* Make sure we have 4 tasks. */
if (ntasks != TARGET_NTASKS) ERR(ERR_WRONG);

/* PIOc_set_log_level(4); */
PIOc_set_log_level(4);

/* Change error handling so we can test inval parameters. */
if ((ret = PIOc_set_iosystem_error_handling(PIO_DEFAULT, PIO_RETURN_ERROR, NULL)))
Expand All @@ -86,7 +86,7 @@ int main(int argc, char **argv)
int gdimlen[NDIM1] = {DIM_LEN_1};
PIO_Offset compmap[MAPLEN];
int varid;
int data;
int data, data_in;
int ioid;

/* Create a file. */
Expand All @@ -112,6 +112,7 @@ int main(int argc, char **argv)
ERR(ret);

/* Write a record of data. */
data = my_rank;
if ((ret = PIOc_setframe(ncid, 0, 0)))
ERR(ret);
if ((ret = PIOc_write_darray(ncid, 0, ioid, MAPLEN, &data, NULL)))
Expand All @@ -121,6 +122,20 @@ int main(int argc, char **argv)
if ((ret = PIOc_closefile(ncid)))
ERR(ret);

/* Reopen the file and check. */
if ((ret = PIOc_openfile(iosysid, &ncid, &iotype, FILE_NAME, 0)))
ERR(ret);

/* Read the data. */
if ((ret = PIOc_setframe(ncid, 0, 0)))
ERR(ret);
if ((ret = PIOc_read_darray(ncid, 0, ioid, MAPLEN, &data_in)))
ERR(ret);

/* Close the file. */
if ((ret = PIOc_closefile(ncid)))
ERR(ret);

/* Free the decomposition. */
if ((ret = PIOc_freedecomp(iosysid, ioid)))
ERR(ret);
Expand Down

0 comments on commit 9633f7f

Please sign in to comment.