Skip to content

Commit 7ffefc3

Browse files
committed
alignment_test.c - error returned from file create/open is fatal
1 parent f62a649 commit 7ffefc3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/testcases/alignment_test.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ int main(int argc, char** argv) {
6464

6565
/* create a new file for writing ----------------------------------------*/
6666
cmode = NC_CLOBBER | NC_64BIT_DATA;
67-
err = ncmpi_create(MPI_COMM_WORLD, filename, cmode, info, &ncid); CHECK_ERR
67+
err = ncmpi_create(MPI_COMM_WORLD, filename, cmode, info, &ncid);
68+
CHECK_ERROUT
6869

6970
/* define dimension */
7071
err = ncmpi_def_dim(ncid, "Y", NC_UNLIMITED, &dimid[0]); CHECK_ERR
@@ -137,7 +138,8 @@ int main(int argc, char** argv) {
137138
MPI_Info_set(info, "nc_var_align_size", "197"); /* size in bytes */
138139

139140
/* open the file for adding more metadata */
140-
err = ncmpi_open(MPI_COMM_WORLD, filename, NC_WRITE, info, &ncid); CHECK_ERR
141+
err = ncmpi_open(MPI_COMM_WORLD, filename, NC_WRITE, info, &ncid);
142+
CHECK_ERROUT
141143

142144
/* get header size and extent, and offsets of all variables */
143145
err = ncmpi_inq_header_size(ncid, &header_size[0]); CHECK_ERR
@@ -323,6 +325,7 @@ int main(int argc, char** argv) {
323325
else printf(PASS_STR);
324326
}
325327

328+
err_out:
326329
MPI_Finalize();
327330
return (nerrs > 0);
328331
}

0 commit comments

Comments
 (0)