From 9bb068f3f316825f8de4981900c8c7f88b117a54 Mon Sep 17 00:00:00 2001 From: Ruey-Hsia Li Date: Mon, 1 Feb 1999 03:53:27 -0500 Subject: [svn-r1039] Added string tests and temporarily disabled test_compound_dt2() test. Reflected the format changes to the expected output. --- tools/testfiles/h5dumptst.c | 167 +++++++++++++++++++++------ tools/testfiles/tall-1.ddl | 10 +- tools/testfiles/tattr-1.ddl | 5 +- tools/testfiles/tattr-2.ddl | 5 +- tools/testfiles/tcomp-1.ddl | 267 +++++++++++++++++++++++++++++++++++++------- tools/testfiles/tcomp-3.ddl | 25 ++++- tools/testfiles/tdset-1.ddl | 8 +- 7 files changed, 397 insertions(+), 90 deletions(-) diff --git a/tools/testfiles/h5dumptst.c b/tools/testfiles/h5dumptst.c index 7cc9eb4..57d74ba 100644 --- a/tools/testfiles/h5dumptst.c +++ b/tools/testfiles/h5dumptst.c @@ -16,6 +16,7 @@ #define FILE10 "tloop.h5" #define FILE11 "tloop2.h5" #define FILE12 "tmany.h5" +#define FILE13 "tstr.h5" static void test_group(void) { hid_t fid, group; @@ -148,25 +149,12 @@ char buf[60]; int i, data[20]; double d[10]; char string[]= "string attribute"; -char str[10][8]; int point = 100; -int tmp[2]; fid = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen (fid, "/"); - /* attribute 0 */ -/* - dims[0] = 2; - space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate (root, "attr0", H5T_STD_I32LE, space, H5P_DEFAULT); - tmp[0] = 64; tmp[1] = 65; - H5Awrite(attr, H5T_STD_I32LE, tmp); - H5Sclose(space); - H5Aclose(attr); -*/ - /* attribute 1 */ dims[0] = 24; space = H5Screate_simple(1, dims, NULL); @@ -212,21 +200,6 @@ int tmp[2]; H5Sclose(space); H5Aclose(attr); - /* attribute 6 */ -/* - dims[0] = 10; - space = H5Screate_simple(1, dims, NULL); - type = H5Tcopy(H5T_C_S1); - H5Tset_size(type, 8); - attr = H5Acreate (root, "attr6", type, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - sprintf(str[i], "string%d", i); - H5Awrite(attr, type, str); - H5Tclose(type); - H5Sclose(space); - H5Aclose(attr); -*/ - H5Gclose(root); H5Fclose(fid); @@ -400,8 +373,8 @@ hsize_t dset3_dim[2]; dset3_dim[0] = 3; dset3_dim[1] = 6; space3 = H5Screate_simple(2, dset3_dim, NULL); dataset = H5Dcreate(group, "dset3", type, space3, H5P_DEFAULT); - for (i = 0; i < dset3_dim[0]; i++) { - for (j = 0; j < dset3_dim[1]; j++) { + for (i = 0; i < (int)dset3_dim[0]; i++) { + for (j = 0; j < (int)dset3_dim[1]; j++) { for (k = 0; k < 4; k++) dset3[i][j].a[k] = k; for (k = 0; k < 5; k++) @@ -777,7 +750,7 @@ hid_t fid, group; H5Gclose(group); /* create path from object at /g1 to object at /g2 and name it g1.1 */ - H5Glink (fid, H5G_LINK_HARD, "/g2", "/g1/g1.1"); /* + H5Glink (fid, H5G_LINK_HARD, "/g2", "/g1/g1.1"); /* create path from object at /g2 to object at /g1 and name it g2.1 */ H5Glink (fid, H5G_LINK_SOFT, "/g1", "/g2/g2.1"); @@ -806,9 +779,6 @@ double d[10]; char buf[60]; int i, j; int i0, i1, i2, i3; -int a[2][2][2][2]; -double b[2][2][2][2]; -double c[2][2][2][2]; hsize_t sdim, maxdim; typedef struct { /* compound type has members with rank > 1 */ @@ -876,7 +846,7 @@ const int perm[4] = {0,1,2,3}; /* the 0'th and the 3'rd indices are permuted */ H5Sclose(space2); H5Aclose(attr); - for (j=0; j