diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2017-05-05 21:57:29 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2017-05-05 21:57:29 (GMT) |
commit | 6d247775a6b2e42de604d0e9f5b17853e5a02ad9 (patch) | |
tree | e9b2c4f2f6684cd08507331aaf390d17022a164c /examples/h5dsm_ttconv.c | |
parent | 9035f351cd0f500c9a85fd70bd922cf1d9a625ce (diff) | |
download | hdf5-6d247775a6b2e42de604d0e9f5b17853e5a02ad9.zip hdf5-6d247775a6b2e42de604d0e9f5b17853e5a02ad9.tar.gz hdf5-6d247775a6b2e42de604d0e9f5b17853e5a02ad9.tar.bz2 |
Fix memory leak in collective group open through soft links. Minor
changes to examples.
Diffstat (limited to 'examples/h5dsm_ttconv.c')
-rw-r--r-- | examples/h5dsm_ttconv.c | 88 |
1 files changed, 59 insertions, 29 deletions
diff --git a/examples/h5dsm_ttconv.c b/examples/h5dsm_ttconv.c index 7aa0375..731573c 100644 --- a/examples/h5dsm_ttconv.c +++ b/examples/h5dsm_ttconv.c @@ -40,8 +40,11 @@ int main(int argc, char *argv[]) { /* Seed random number generator */ srand(time(NULL)); - if(argc != 2) - PRINTF_ERROR("argc must be 2\n"); + if((argc != 2) && (argc != 3)) + PRINTF_ERROR("argc must be 2 or 3\n"); + + if(argc == 3) + verbose_g = 0; /* Parse UUID */ if(0 != uuid_parse(argv[1], pool_uuid)) @@ -273,7 +276,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Full write/read, with member conversion @@ -378,7 +382,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Write by parts @@ -445,7 +450,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -509,7 +515,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -573,7 +580,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Read by parts @@ -613,7 +621,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Read member b */ memcpy(buf_conv, buf_conv_init, sizeof(buf_conv)); @@ -650,7 +659,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Read member c */ memcpy(buf_conv, buf_conv_init, sizeof(buf_conv)); @@ -687,7 +697,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Write/read partial attributes @@ -754,7 +765,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -818,7 +830,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -882,7 +895,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Test dataset @@ -955,7 +969,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Full write/read, with member conversion @@ -1060,7 +1075,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Write by parts @@ -1127,7 +1143,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -1191,7 +1208,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -1255,7 +1273,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Read by parts @@ -1295,7 +1314,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Read member b */ memcpy(buf_conv, buf_conv_init, sizeof(buf_conv)); @@ -1332,7 +1352,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Read member c */ memcpy(buf_conv, buf_conv_init, sizeof(buf_conv)); @@ -1369,7 +1390,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Write/read partial datasets @@ -1436,7 +1458,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -1500,7 +1523,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* Fill buffer */ for(i = 0; i < dims[0]; i++) { @@ -1564,7 +1588,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Test dataset with selections @@ -1652,7 +1677,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d does not match", i); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /*! ----------------------------------------------*/ /*! Temporary hack until overwrites are supported */ @@ -1753,7 +1779,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d, %d does not match", i, j); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /*! ----------------------------------------------*/ /*! Temporary hack until overwrites are supported */ @@ -1852,7 +1879,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d, %d does not match", i, j); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Partial read to contiguous buffer, member conversion to type "a" @@ -1907,7 +1935,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d, %d does not match", i, j); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Partial read to non-contiguous buffer, member conversion to type "a" @@ -1962,7 +1991,8 @@ int main(int argc, char *argv[]) { PRINTF_ERROR("Member c at location %d, %d does not match", i, j); } /* end for */ - printf("\n"); + if(verbose_g) + printf("\n"); /* * Close |