summaryrefslogtreecommitdiffstats
path: root/test/tunicode.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
commita1708eb023f2c8f8ac6c2c17bf1e598c8dff956e (patch)
tree34c87a3753b36c4c8d689d58bf456eaf261cd235 /test/tunicode.c
parentbea1e576c5ef5500678f7ce913d835341b625e8f (diff)
downloadhdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.zip
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.gz
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.bz2
[svn-r11712] Purpose:
New feature Description: Check in baseline for compact group revisions, which radically revises the source code for managing groups and object headers. WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! This initiates the "unstable" phase of the 1.7.x branch, leading up to the 1.8.0 release. Please test this code, but do _NOT_ keep files created with it - the format will change again before the release and you will not be able to read your old files!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! Solution: There's too many changes to really describe them all, but some of them include: - Stop abusing the H5G_entry_t structure and split it into two separate structures for non-symbol table node use within the library: H5O_loc_t for object locations in a file and H5G_name_t to store the path to an opened object. H5G_entry_t is now only used for storing symbol table entries on disk. - Retire H5G_namei() in favor of a more general mechanism for traversing group paths and issuing callbacks on objects located. This gets us out of the business of hacking H5G_namei() for new features, generally. - Revised H5O* routines to take a H5O_loc_t instead of H5G_entry_t - Lots more... Platforms tested: h5committested and maybe another dozen configurations.... :-)
Diffstat (limited to 'test/tunicode.c')
-rw-r--r--test/tunicode.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/tunicode.c b/test/tunicode.c
index 22146bf..f4c4cda 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -468,6 +468,7 @@ void test_objnames(hid_t fid, const char* string)
CHECK(ret, FAIL, "H5Dclose");
ret = H5Sclose(space_id);
CHECK(ret, FAIL, "H5Sclose");
+
ret = H5Gclose(grp2_id);
CHECK(ret, FAIL, "H5Gclose");
@@ -481,9 +482,9 @@ void test_objnames(hid_t fid, const char* string)
ret = H5Glink2(fid, GROUP2_NAME, H5G_LINK_HARD, grp3_id, GROUP2_NAME);
CHECK(ret, FAIL, "H5Glink2");
- strcpy(path_buf, GROUP2_NAME);
- strcat(path_buf, "/");
- strcat(path_buf, string);
+ HDstrcpy(path_buf, GROUP2_NAME);
+ HDstrcat(path_buf, "/");
+ HDstrcat(path_buf, string);
ret = H5Glink(grp3_id, H5G_LINK_SOFT, path_buf, string);
CHECK(ret, FAIL, "H5Glink");
@@ -580,6 +581,7 @@ void test_compound(hid_t fid, const char * string)
herr_t ret;
/* Initialize compound data */
+ HDmemset(&s1, 0, sizeof(s1_t)); /* To make purify happy */
s1.a = COMP_INT_VAL;
s1.c = COMP_DOUBLE_VAL;
s1.b = COMP_FLOAT_VAL;
@@ -793,6 +795,7 @@ void test_unicode(void)
unsigned int unicode_point; /* Unicode code point for a single character */
hid_t fid; /* ID of file */
int x; /* Temporary variable */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing UTF-8 Encoding\n"));
@@ -800,13 +803,14 @@ void test_unicode(void)
/* Create a random string with length NUM_CHARS */
HDsrandom((unsigned long)HDtime(NULL));
+ HDmemset(test_string, 0, sizeof(test_string));
for(x=0; x<NUM_CHARS; x++)
{
/* We need to avoid unprintable characters (codes 0-31) and the
* . and / characters, since they aren't allowed in path names.
*/
- unicode_point = HDrandom() % (MAX_CODE_POINT-32) + 32;
- if(unicode_point != 56 && unicode_point != 57)
+ unicode_point = (HDrandom() % (MAX_CODE_POINT-32)) + 32;
+ if(unicode_point != 46 && unicode_point != 47)
cur_pos = write_char(unicode_point, test_string, cur_pos);
}
@@ -832,6 +836,10 @@ void test_unicode(void)
test_enum(fid, test_string);
test_opaque(fid, test_string);
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
/* This function could be useful in debugging if certain strings
* create errors.
*/