summaryrefslogtreecommitdiffstats
path: root/test/dt_arith.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2016-09-29 20:17:55 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2016-09-29 20:17:55 (GMT)
commit5a7880183025f56421cf6f2274d9f1ac36f59641 (patch)
tree0cdce0036d5b02df97b3a2fcdf875184b6886e67 /test/dt_arith.c
parent1853868fdc9433f29adae5418d1fd0d65a45fabe (diff)
downloadhdf5-5a7880183025f56421cf6f2274d9f1ac36f59641.zip
hdf5-5a7880183025f56421cf6f2274d9f1ac36f59641.tar.gz
hdf5-5a7880183025f56421cf6f2274d9f1ac36f59641.tar.bz2
Clean up hardcoded constants and check return values better. (Comments from
group code review)
Diffstat (limited to 'test/dt_arith.c')
-rw-r--r--test/dt_arith.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c
index cdfe182..1ebcf74 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -94,6 +94,9 @@ static int skip_overflow_tests_g = 0;
#define TEST_DENORM 2
#define TEST_SPECIAL 3
+/* Temporary buffer sizes */
+#define TMP_BUF_DIM1 32
+#define TMP_BUF_DIM2 100
/* Don't use hardware conversions if set */
static int without_hardware_g = 0;
@@ -2678,11 +2681,11 @@ test_conv_int_2(void)
printf("%-70s", "Testing overlap calculations");
HDfflush(stdout);
- buf = (char *)HDcalloc(32, 100);
+ buf = (char *)HDcalloc(TMP_BUF_DIM1, TMP_BUF_DIM2);
HDassert(buf);
- for (i=1; i<=32; i++) {
- for (j=1; j<=32; j++) {
+ for(i = 1; i <= TMP_BUF_DIM1; i++) {
+ for(j = 1; j <= TMP_BUF_DIM1; j++) {
/* Source type */
src_type = H5Tcopy(H5T_NATIVE_CHAR);
@@ -2696,7 +2699,7 @@ test_conv_int_2(void)
* Conversion. If overlap calculations aren't right then an
* assertion will fail in H5T__conv_i_i()
*/
- H5Tconvert(src_type, dst_type, (size_t)100, buf, NULL, H5P_DEFAULT);
+ H5Tconvert(src_type, dst_type, (size_t)TMP_BUF_DIM2, buf, NULL, H5P_DEFAULT);
H5Tclose(src_type);
H5Tclose(dst_type);
}