diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-11-15 02:57:16 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-11-15 02:57:16 (GMT) |
commit | 3cbd1175fec7a02d5a6804ac22fffe62488b010e (patch) | |
tree | b1b93a009c93416bba7ea1ae9772d74525383ab0 /test | |
parent | 1957c147114fd268ac23c65ad6b52d405d9dd63c (diff) | |
download | hdf5-3cbd1175fec7a02d5a6804ac22fffe62488b010e.zip hdf5-3cbd1175fec7a02d5a6804ac22fffe62488b010e.tar.gz hdf5-3cbd1175fec7a02d5a6804ac22fffe62488b010e.tar.bz2 |
[svn-r11714] 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')
-rw-r--r-- | test/group_new.h5 | bin | 0 -> 2280 bytes | |||
-rw-r--r-- | test/links.c | 6 | ||||
-rw-r--r-- | test/stab.c | 72 |
3 files changed, 78 insertions, 0 deletions
diff --git a/test/group_new.h5 b/test/group_new.h5 Binary files differnew file mode 100644 index 0000000..1e17ed6 --- /dev/null +++ b/test/group_new.h5 diff --git a/test/links.c b/test/links.c index df6fa1f..d819a5d 100644 --- a/test/links.c +++ b/test/links.c @@ -32,6 +32,12 @@ const char *FILENAME[] = { #define NAME_BUF_SIZE 1024 #define MAX_NAME_LEN ((64*1024)+1024) +/* The group_new.h5 is generated from gen_new_fill.c in HDF5 'test' directory + * for version 1.7 (after "compact group" checkin). To get this data file, + * simply compile gen_new_group.c with HDF5 library (after compact group + * checkin) and run it. */ +#define FILE_NEW_GROUPS "group_new.h5" + /*------------------------------------------------------------------------- * Function: mklinks diff --git a/test/stab.c b/test/stab.c index 947825c..df22bf7 100644 --- a/test/stab.c +++ b/test/stab.c @@ -30,6 +30,12 @@ const char *FILENAME[] = { NULL }; +/* The group_new.h5 is generated from gen_new_fill.c in HDF5 'test' directory + * for version 1.7 (after "compact group" checkin). To get this data file, + * simply compile gen_new_group.c with HDF5 library (after compact group + * checkin) and run it. */ +#define FILE_NEW_GROUPS "group_new.h5" + /*------------------------------------------------------------------------- * Function: test_misc @@ -214,6 +220,71 @@ test_large(hid_t file) /*------------------------------------------------------------------------- + * Function: read_new + * + * Purpose: Test reading a file with "new style" (compact) groups + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Quincey Koziol + * Monday, October 24, 2005 + * + *------------------------------------------------------------------------- + */ +static int +read_new(hid_t fapl) +{ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + char *srcdir = HDgetenv("srcdir"); /*where the src code is located*/ + char filename[512]=""; /* test file name */ + + TESTING("reading new groups"); + + /* Generate correct name for test file by prepending the source path */ + if(srcdir && ((HDstrlen(srcdir) + HDstrlen(FILE_NEW_GROUPS) + 1) < sizeof(filename))) { + HDstrcpy(filename, srcdir); + HDstrcat(filename, "/"); + } + HDstrcat(filename, FILE_NEW_GROUPS); + + /* Open file */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR; + + /* Attempt to open root group */ + if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR; + + /* Attempt to open new "empty" group (should fail) */ + H5E_BEGIN_TRY { + if(H5Gopen(gid, "empty") >= 0) TEST_ERROR; + } H5E_END_TRY; + + /* Attempt to open new group with link messages (should fail) */ + H5E_BEGIN_TRY { + if(H5Gopen(gid, "links") >= 0) TEST_ERROR; + } H5E_END_TRY; + + /* Close root group */ + if(H5Gclose(gid) < 0) TEST_ERROR; + + /* Close first file */ + if(H5Fclose(fid)<0) TEST_ERROR; + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} /* end read_new() */ + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Test groups @@ -258,6 +329,7 @@ main(void) nerrors += test_misc(file); nerrors += test_long(file); nerrors += test_large(file); + nerrors += read_new(fapl); if (nerrors) goto error; /* Cleanup */ |