Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing text output in nc_test4/tst_files6.c and tst_rename.c #1187

Merged
merged 4 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions nc_test4/tst_files6.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ main(int argc, char **argv)
if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
if (strcmp(name_in, DIM_NAME) || len_in != DIM_LEN) ERR;
if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in,
&dimid_in, &natts_in)) ERR;
&dimid_in, &natts_in)) ERR;
if (strcmp(name_in, VAR_NAME1) || xtype_in != NC_FLOAT ||
ndims_in != 1 || dimid_in != 0 || natts_in != 0) ERR;
ndims_in != 1 || dimid_in != 0 || natts_in != 0) ERR;
if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims_in,
&dimid_in, &natts_in)) ERR;
&dimid_in, &natts_in)) ERR;
if (strcmp(name_in, VAR_NAME2) || xtype_in != NC_FLOAT ||
ndims_in != 1 || dimid_in != 0 || natts_in != 0) ERR;
ndims_in != 1 || dimid_in != 0 || natts_in != 0) ERR;
if (nc_inq_var(ncid, 2, name_in, &xtype_in, &ndims_in,
&dimid_in, &natts_in)) ERR;
&dimid_in, &natts_in)) ERR;
if (strcmp(name_in, DIM_NAME) || xtype_in != NC_FLOAT ||
ndims_in != 1 || dimid_in != 0 || natts_in != 0) ERR;
ndims_in != 1 || dimid_in != 0 || natts_in != 0) ERR;
if (nc_close(ncid)) ERR;
}
SUMMARIZE_ERR;
Expand All @@ -72,12 +72,15 @@ main(int argc, char **argv)
if ((grpid = H5Gcreate2(hdfid, GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((grpid2 = H5Gcreate2(grpid, GROUP_NAME_2, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
H5P_DEFAULT)) < 0) ERR;
if (H5Lcreate_soft(GROUP_NAME, grpid2, TRUE_FANS, H5P_DEFAULT,
H5P_DEFAULT) < 0) ERR;
if (H5Fclose(hdfid) < 0) ERR;

H5close(); /* Force HDF5 to forget about this file. */
/* Force HDF5 to forget about this file. This resets the error
* stack, so turn off HDF5 error messages again. */
H5close();
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);

/* Now try and open it with netCDF. It will not work. */
if (nc_open(HDF5_FILE_NAME, NC_NOWRITE, &ncid) != NC_EHDFERR) ERR;
Expand Down
16 changes: 8 additions & 8 deletions nc_test4/tst_rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ main(int argc, char **argv)
char *file_names[] = {FILE_NAME3, FILE_NAME4};
int format;

fprintf(stderr,"*** Testing netcdf rename bugs and fixes.\n");
printf("*** Testing netcdf rename bugs and fixes.\n");
/* nc_set_log_level(5); */

for (format = 0; format < NUM_FORMATS; format++)
Expand All @@ -142,7 +142,7 @@ main(int argc, char **argv)
float rh_in[DIM_LEN];
int ii;

fprintf(stderr,"*** Test Charlie's test for renaming without enddef...");
printf("*** Test Charlie's test for renaming without enddef...");
{
int ncid, dimid, varid;

Expand Down Expand Up @@ -175,7 +175,7 @@ main(int argc, char **argv)

}
SUMMARIZE_ERR;
fprintf(stderr,"*** Test Charlie's test for renaming with one enddef...");
printf("*** Test Charlie's test for renaming with one enddef...");
{
int ncid, dimid, varid;

Expand Down Expand Up @@ -217,7 +217,7 @@ main(int argc, char **argv)

}
SUMMARIZE_ERR;
fprintf(stderr,"*** Test Charlie's test for renaming with enddef...");
printf("*** Test Charlie's test for renaming with enddef...");
{
int ncid, dimid, varid;
float data[DIM1_LEN] = {0, 90.0, 180.0, 270.0};
Expand Down Expand Up @@ -427,8 +427,8 @@ main(int argc, char **argv)
}
SUMMARIZE_ERR;

fprintf(stderr,"*** Test renaming just coordinate variable for %s...",
fmt_names[format]);
printf("*** Test renaming just coordinate variable for %s...",
fmt_names[format]);
{
if (create_test_file(file_names[format], formats[format])) ERR;
if (nc_open(file_names[format], NC_WRITE, &ncid)) ERR;
Expand All @@ -452,8 +452,8 @@ main(int argc, char **argv)
}
SUMMARIZE_ERR;

fprintf(stderr,"*** Test renaming just coordinate dimension for %s...",
fmt_names[format]);
printf("*** Test renaming just coordinate dimension for %s...",
fmt_names[format]);
{
if (create_test_file(file_names[format], formats[format])) ERR;
if (nc_open(file_names[format], NC_WRITE, &ncid)) ERR;
Expand Down