Skip to content

Commit

Permalink
hds: Protect some of the test with status checks
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Oct 31, 2014
1 parent bfd3083 commit fba5a46
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions libraries/hds/hdsTest.c
Expand Up @@ -116,15 +116,19 @@ int main (void) {
hdsdim celldims[] = {1};
hdsdim gdims[DAT__MXDIM];
datShape(loc1, DAT__MXDIM, gdims, &gndim, &status);
printf("GROUP NDIMS: %d\n", gndim);
for (i=0; i<gndim; i++) {
printf(" Dim[%d] = %zu\n", i, (size_t)gdims[i]);
if (status == SAI__OK) {
printf("GROUP NDIMS: %d\n", gndim);
for (i=0; i<gndim; i++) {
printf(" Dim[%d] = %zu\n", i, (size_t)gdims[i]);
}
}
datVec( loc1, &loc2, &status);
datShape(loc2, DAT__MXDIM, gdims, &gndim, &status);
printf("GROUP NDIMS: %d\n", gndim);
for (i=0; i<gndim; i++) {
printf(" Dim[%d] = %zu\n", i, (size_t)gdims[i]);
if (status == SAI__OK) {
printf("GROUP NDIMS: %d\n", gndim);
for (i=0; i<gndim; i++) {
printf(" Dim[%d] = %zu\n", i, (size_t)gdims[i]);
}
}
datCell( loc2, 1, celldims, &loc3, &status );
datAnnul( &loc3, &status );
Expand Down Expand Up @@ -481,7 +485,9 @@ static void traceme (const HDSLoc * loc, int *status) {
hdsTrace( loc, &nlev, path_str, file_str,
status, sizeof(path_str),
sizeof(file_str));
printf("File: '%s' Path: '%s' Level = %d\n", file_str,
path_str, nlev);
if (*status == SAI__OK) {
printf("File: '%s' Path: '%s' Level = %d\n", file_str,
path_str, nlev);
}
}

0 comments on commit fba5a46

Please sign in to comment.