summaryrefslogtreecommitdiffstats
path: root/test/tvlstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tvlstr.c')
-rw-r--r--test/tvlstr.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/test/tvlstr.c b/test/tvlstr.c
index fb6a876..7e47c7b 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -110,16 +110,13 @@ test_vlstr_free_custom(void *_mem, void *info)
static void
test_vlstrings_basic(void)
{
+ /* Information to write */
const char *wdata[SPACE1_DIM1] = {
- "Four score and seven years ago our forefathers brought forth on this continent a new "
- "nation,",
+ "Four score and seven years ago our forefathers brought forth on this continent a new nation,",
"conceived in liberty and dedicated to the proposition that all men are created equal.",
"Now we are engaged in a great civil war,",
- "testing whether that nation or any nation so conceived and so dedicated can long "
- "endure."}; /* Information
- to
- write
- */
+ "testing whether that nation or any nation so conceived and so dedicated can long endure."};
+
char * rdata[SPACE1_DIM1]; /* Information read in */
char * wdata2;
hid_t dataspace, dataset2;
@@ -206,7 +203,7 @@ test_vlstrings_basic(void)
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
- (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
+ (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
continue;
} /* end if */
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -310,7 +307,7 @@ test_vlstrings_special(void)
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
- (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
+ (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
continue;
} /* end if */
if ((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
@@ -539,7 +536,7 @@ test_compact_vlstring(void)
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
- (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
+ (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
continue;
} /* end if */
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -662,8 +659,6 @@ test_write_vl_string_attribute(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/****************************************************************
@@ -742,8 +737,6 @@ test_read_vl_string_attribute(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/* Helper routine for test_vl_rewrite() */
@@ -780,7 +773,7 @@ read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data)
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
- if (HDstrcmp(data, data_read))
+ if (HDstrcmp(data, data_read) != 0)
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read);
@@ -867,8 +860,6 @@ test_vl_rewrite(void)
ret = H5Fclose(file2);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
} /* end test_vl_rewrite() */
/****************************************************************