diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 20:43:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 20:43:30 (GMT) |
commit | 1e91d96fa02466ffe451319bdac1005f84dc7993 (patch) | |
tree | 4de04ef502c313dfd766497b20235188761146c0 /hl/test/test_lite.c | |
parent | 95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff) | |
download | hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2 |
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'hl/test/test_lite.c')
-rw-r--r-- | hl/test/test_lite.c | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index cf139d9..6ff3134 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1038,26 +1038,26 @@ make_attributes(hid_t loc_id, const char *obj_name) HL_TESTING2("H5LTget_attribute_info"); - if (NULL == (dims_out = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)rank_out))) + if (NULL == (dims_out = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)rank_out))) return -1; if (H5LTget_attribute_info(loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0) { - HDfree(dims_out); + free(dims_out); return -1; } for (i = 0; i < rank_out; i++) { if (dims_out[i] != 5) { - HDfree(dims_out); + free(dims_out); return -1; } } if (type_class != H5T_INTEGER) { - HDfree(dims_out); + free(dims_out); return -1; } - HDfree(dims_out); + free(dims_out); PASSED(); @@ -1092,17 +1092,17 @@ test_integers(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) { - HDfree(dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1150,17 +1150,17 @@ test_fps(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) { - HDfree(dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1221,19 +1221,19 @@ test_strings(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1256,46 +1256,46 @@ test_strings(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); /* Length of the character buffer is larger then needed */ str_len = str_len + 10; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len - 1) != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); /* Length of the character buffer is smaller then needed */ str_len = 21; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } /* check the truncated string */ @@ -1306,12 +1306,12 @@ test_strings(void) "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len) != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1321,7 +1321,7 @@ test_strings(void) out: if (dt_str) - HDfree(dt_str); + free(dt_str); H5_FAILED(); return -1; @@ -1358,21 +1358,21 @@ test_opaques(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp( dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1438,22 +1438,22 @@ test_enums(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1502,18 +1502,18 @@ test_variables(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1564,21 +1564,21 @@ test_arrays(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1625,19 +1625,19 @@ test_compounds(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " "\"two_field\" : 6;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1738,13 +1738,13 @@ test_compound_bug(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1775,14 +1775,14 @@ test_compound_bug(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1813,9 +1813,9 @@ test_complicated_compound(void) HL_TESTING3(" text for complicated compound types"); /* Open input file */ - fp = HDfopen(filename, "r"); + fp = fopen(filename, "r"); if (fp == NULL) { - HDprintf("Could not find file %s. Try set $srcdir \n", filename); + printf("Could not find file %s. Try set $srcdir \n", filename); goto out; } @@ -1823,15 +1823,15 @@ test_complicated_compound(void) * Library has convenient function getline() but isn't available on * all machines. */ - if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL) + if ((line = (char *)calloc(size, sizeof(char))) == NULL) goto out; if (HDfgets(line, (int)size, fp) == NULL) goto out; while (HDstrlen(line) == size - 1) { size *= 2; if (line) - HDfree(line); - if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL) + free(line); + if ((line = (char *)calloc(size, sizeof(char))) == NULL) goto out; if (HDfseek(fp, 0L, SEEK_SET) != 0) goto out; @@ -1857,7 +1857,7 @@ test_complicated_compound(void) goto out; if (line) - HDfree(line); + free(line); PASSED(); return 0; @@ -1865,7 +1865,7 @@ test_complicated_compound(void) out: if (line) - HDfree(line); + free(line); if (fp) HDfclose(fp); |