2003-04-01 01:59:04 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 01:59:04 +08:00
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-04-01 01:59:04 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
2002-10-15 04:08:57 +08:00
|
|
|
|
/*
|
|
|
|
|
* Programmer: Pedro Vicente <pvn@ncsa.uiuc.edu>
|
|
|
|
|
* April 12, 2002
|
|
|
|
|
*
|
2003-04-30 01:30:16 +08:00
|
|
|
|
* Purpose: Tests the "ID to name" functionality
|
2002-10-15 04:08:57 +08:00
|
|
|
|
*/
|
|
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
|
#define H5G_FRIEND /*suppress error about including H5Gpkg */
|
|
|
|
|
#define H5I_FRIEND /*suppress error about including H5Ipkg */
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
/* Define these macros to indicate that the testing APIs should be available */
|
2005-12-26 13:28:18 +08:00
|
|
|
|
#define H5G_TESTING
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
#define H5I_TESTING
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
2002-04-17 01:39:38 +08:00
|
|
|
|
#include "h5test.h"
|
2005-12-26 13:28:18 +08:00
|
|
|
|
#include "H5Gpkg.h" /* Groups */
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
#include "H5Ipkg.h" /* IDs */
|
2003-05-07 03:38:35 +08:00
|
|
|
|
|
|
|
|
|
|
2002-08-29 02:34:12 +08:00
|
|
|
|
/* Compound datatype */
|
|
|
|
|
typedef struct s1_t {
|
|
|
|
|
unsigned int a;
|
|
|
|
|
unsigned int b;
|
|
|
|
|
float c;
|
|
|
|
|
} s1_t;
|
|
|
|
|
|
2002-10-15 04:08:57 +08:00
|
|
|
|
const char *FILENAME[] = {
|
|
|
|
|
"getname",
|
|
|
|
|
"getname1",
|
|
|
|
|
"getname2",
|
|
|
|
|
"getname3",
|
|
|
|
|
NULL
|
|
|
|
|
};
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
#define NAME_BUF_SIZE 64
|
|
|
|
|
#define SMALL_NAME_BUF_SIZE 2
|
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Object reference macros */
|
|
|
|
|
#define SPACE1_RANK 1
|
|
|
|
|
#define SPACE1_DIM1 8
|
|
|
|
|
|
|
|
|
|
/* Dataset region reference macros */
|
|
|
|
|
#define REFREG_DSETNAMEV "MATRIX"
|
|
|
|
|
#define REFREG_DSETNAMER "REGION_REFERENCES"
|
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
static int
|
|
|
|
|
check_name(hid_t id, const char *chk_name, const char *chk_user_path)
|
2002-08-29 02:34:12 +08:00
|
|
|
|
{
|
2005-12-26 13:28:18 +08:00
|
|
|
|
char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
|
|
|
|
|
char user_path[NAME_BUF_SIZE]; /* Buffer to hold user path */
|
|
|
|
|
size_t user_path_len; /* Length of user path */
|
|
|
|
|
unsigned user_path_hidden; /* Whether the user path is hidden */
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
/* Get name */
|
|
|
|
|
*name = '\0';
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
if(H5Iget_name(id, name, NAME_BUF_SIZE) < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
/* Get user path */
|
|
|
|
|
*user_path = '\0';
|
2012-02-10 10:16:52 +08:00
|
|
|
|
if(H5G__user_path_test(id, user_path, &user_path_len, &user_path_hidden) < 0) TEST_ERROR
|
2002-04-17 01:39:38 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
/* Check on name from H5Iget_name() */
|
|
|
|
|
if(HDstrcmp(name, chk_name)) goto error;
|
|
|
|
|
|
|
|
|
|
/* Check on user path */
|
|
|
|
|
if(HDstrcmp(user_path, chk_user_path)) goto error;
|
|
|
|
|
|
|
|
|
|
/* Check that if user path is hidden, the name from H5Iget_name() and the user path should be different */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
if(user_path_hidden && !HDstrcmp(chk_name, chk_user_path)) TEST_ERROR
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
|
|
|
|
/* Everything matches */
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
/* Something doesn't match or something bad happened */
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2002-04-17 01:39:38 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
static int
|
|
|
|
|
test_main(hid_t file_id, hid_t fapl)
|
2002-04-17 01:39:38 +08:00
|
|
|
|
{
|
2006-11-18 21:52:32 +08:00
|
|
|
|
char filename1[1024];
|
|
|
|
|
char filename2[1024];
|
|
|
|
|
char filename3[1024];
|
|
|
|
|
hid_t file1_id, file2_id, file3_id;
|
|
|
|
|
hid_t group_id, group2_id, group3_id, group4_id, group5_id, group6_id, group7_id;
|
|
|
|
|
hid_t dataset_id, dataset2_id;
|
|
|
|
|
hid_t space_id;
|
|
|
|
|
hid_t type_id, type2_id;
|
|
|
|
|
hsize_t dims[1] = { 5 };
|
2015-04-09 00:06:48 +08:00
|
|
|
|
size_t name_len; /* Name length */
|
|
|
|
|
H5O_info_t oinfo; /* Object info structs */
|
|
|
|
|
hid_t dtype; /* Object identifier for testing */
|
|
|
|
|
hid_t dtype_anon; /* Object identifier for testing anonymous */
|
|
|
|
|
ssize_t size; /* Size returned by H5Iget_name */
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Initialize the file names */
|
|
|
|
|
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
|
|
|
|
|
h5_fixname(FILENAME[2], fapl, filename2, sizeof filename2);
|
|
|
|
|
h5_fixname(FILENAME[3], fapl, filename3, sizeof filename3);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-08-24 04:25:25 +08:00
|
|
|
|
* Test H5Iget_name with one group
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
TESTING("H5Iget_name with one group");
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g0" in the root group using absolute name */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g0", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g0", "/g0") < 0) TEST_ERROR
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-08-24 04:25:25 +08:00
|
|
|
|
* Test H5Iget_name with more than one group
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
TESTING("H5Iget_name with more than one group");
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g1" in the root group using absolute name */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g2" in group "g1" using absolute name */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-08-28 23:02:54 +08:00
|
|
|
|
* Test H5Iget_name with H5Gopen2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Gopen2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
* Test H5Iget_name with H5Dcreate2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Dcreate2");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create the dataspace */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset inside "g1" */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
* Test H5Iget_name with H5Dopen2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Dopen2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the dataset */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(file_id, "d1", H5P_DEFAULT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the dataset */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(group_id, "d1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with a long path
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with a long path");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g2/bar/baz" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "g2/bar", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "g2/bar/baz", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a dataset */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the dataset */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(file_id, "/g2/bar/baz/d1", H5P_DEFAULT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/g2/bar/baz/d1", "/g2/bar/baz/d1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Tcommit2
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Tcommit2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a datatype */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Insert fields */
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) TEST_ERROR
|
|
|
|
|
if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) TEST_ERROR
|
|
|
|
|
if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Save datatype for later */
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
if(H5Tcommit2(file_id, "t1", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close datatype */
|
|
|
|
|
H5Tclose(type_id);
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Topen2
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Topen2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the named datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((type_id = H5Topen2(file_id, "t1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-08-29 06:30:13 +08:00
|
|
|
|
* Test H5Iget_name with H5Lmove and H5Gopen2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lmove and H5Gopen2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g1", H5L_SAME_LOC, "/g1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
* Test H5Iget_name with H5Lmove and H5Dopen2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lmove and H5Dopen2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the dataset */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(file_id, "/d1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename dataset */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/d1", H5L_SAME_LOC, "/d1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(check_name(dataset_id, "/d1a", "/d1a") < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
* Test H5Iget_name with H5Lmove and H5Topen2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lmove and H5Topen2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the named datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((type_id = H5Topen2(file_id, "/t1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename datatype */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/t1", H5L_SAME_LOC, "/t1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(check_name(type_id, "/t1a", "/t1a") < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close datatype */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-08-29 06:30:13 +08:00
|
|
|
|
* Test H5Iget_name with H5Lmove and relative names
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lmove and relative names");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "/g3" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "/g3/foo" using absolute name */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g3/foo1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open group "/g3/foo" again */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g3/foo1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(group_id, "foo1", H5L_SAME_LOC, "foo2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group again */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "g3/foo2", H5L_SAME_LOC, "g3/foo1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lmove and a long path
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lmove and a long path");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g4/A/B" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "g4/A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "g4/A/B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g5/C" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group4_id = H5Gcreate2(file_id, "g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group5_id = H5Gcreate2(file_id, "g5/C", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Move group "B" to "D"*/
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g4/A/B", H5L_SAME_LOC, "/g5/C/D", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g5/C/D", "/g5/C/D") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Move group "/g5/C/D" back to "/g4/A/B" using relative name */
|
2007-08-29 06:45:23 +08:00
|
|
|
|
if(H5Lmove(group5_id, "D", group2_id, "B", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Move group "/g4/A/B" to "/g4/F/B" using relative name */
|
2007-08-29 06:45:23 +08:00
|
|
|
|
if(H5Lmove(group_id, "A", group_id, "F", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g4/F/B", "/g4/F/B") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g4/F", "/g4/F") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lmove and a long path #2
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lmove and a long path #2");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g6/A/B" and "g7" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "g6/A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "g6/A/B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file_id, "g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g6/A/B", "/g6/A/B") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Move group "A" to "C"*/
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g6/A", H5L_SAME_LOC, "/g7/C", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g7/C", "/g7/C") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g7/C/B", "/g7/C/B") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-08-30 04:44:19 +08:00
|
|
|
|
* Test H5Iget_name with H5Ldelete
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Ldelete");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new group. */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g8", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Ldelete and a long path
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Ldelete and a long path");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g9/a/b" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g9", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "g9/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "g9/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g9/a", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Recreate groups */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group2_id = H5Gcreate2(group_id, "a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete, using relative path */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(group_id, "a", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g10/a/b" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "g10/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "g10/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g10/a/b", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Recreate group */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete, using relative path */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(group_id, "a/b", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Ldelete, same names
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Ldelete, same names");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g11/g" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "g11/g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create two datasets "g11/d" and "g11/g/d"*/
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((dataset2_id = H5Dcreate2(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g11/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset2_id, "/g11/g/d", "/g11/g/d") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with H5Fmount; with IDs on the list
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Fmount; with IDs on the list");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a group "g12" in the first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g12", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and dataset "d" in it */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a dataspace */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create the dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "g12" in the first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access dataset D in the first file under "/G/D" name */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(file_id, "/g12/d", H5P_DEFAULT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/g12/d", "/g12/d") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g12") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2003-05-07 03:38:35 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Fmount; long name
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Fmount; long name");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a group "g13/g1/g2" in the first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g13", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g13/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g13/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "g" in it */
|
|
|
|
|
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g14", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g14/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g14/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g13/g1" in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g13/g1") < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the file to mount */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file1_id, "/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
/* Mount second file under "/g13/g1" in the first file(again) */
|
|
|
|
|
if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get a group ID for the parent of the newly mounted group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Funmount(group2_id, "g1") < 0) FAIL_STACK_ERROR
|
2002-04-17 01:39:38 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
/* Mount second file under "/g13/g1" in the first file(again) */
|
|
|
|
|
if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get a group ID for the newly mounted group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g13/g1" in the first file, using relative path */
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g13", "/g13") < 0) TEST_ERROR
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get a group ID for the newly mounted group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file, with relative path */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g13/g1" in the first file, using relative path */
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-09-18 23:51:29 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get a group ID for the newly mounted group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file, with relative path */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with H5Funmount
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Funmount");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a group "g15/g1/g2" in the first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g15", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g15/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g15/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
|
|
|
|
H5Gclose(group4_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "g" in it */
|
|
|
|
|
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g16", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g16/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g16/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g13/g1" in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the second file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g15/g1/g16/g4/g5", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "", "/g15/g1/g2/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g15/g1/g16/g4/g5", "/g15/g1/g16/g4/g5") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g15/g1") < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g15/g1/g2/g3", "/g15/g1/g2/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g16/g4/g5", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with a defined type dataset
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with a defined type dataset");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Insert fields */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g17" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Save datatype for later */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Tcommit2(group_id, "t", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a dataspace */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(group_id , "d", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the named datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((type_id = H5Topen2(file_id, "/g17/t", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the dataset */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(file_id, "/g17/d", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get datatype*/
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((type_id = H5Dget_type(dataset_id)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with objects that have two names
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
[svn-r9329]
Purpose:
Feature
Description:
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
2004-09-29 03:04:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with datasets that have two names");
|
[svn-r9329]
Purpose:
Feature
Description:
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
2004-09-29 03:04:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/* Open dataset named "d"*/
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset_id = H5Dopen2(file_id, "/g17/d", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
[svn-r9329]
Purpose:
Feature
Description:
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
2004-09-29 03:04:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/* Create link to dataset named "link" */
|
2007-08-29 05:31:57 +08:00
|
|
|
|
if(H5Lcreate_hard(dataset_id, ".", file_id, "/g17/link", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset2_id = H5Dopen2(file_id, "/g17/link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
[svn-r9329]
Purpose:
Feature
Description:
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
2004-09-29 03:04:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/* Make sure that the two IDs use two different names */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/g17/d", "/g17/d") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(dataset2_id, "/g17/link", "/g17/link") < 0) TEST_ERROR
|
[svn-r9329]
Purpose:
Feature
Description:
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
2004-09-29 03:04:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
|
[svn-r9329]
Purpose:
Feature
Description:
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
2004-09-29 03:04:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with different files, test1
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with different files");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new file using default properties. */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
/* Create a new file using default properties. */
|
|
|
|
|
if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create the dataspace */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file2_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset2_id, "/d", "/d") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with different files, test2
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with different files #2");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new file using default properties. */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
/* Create a new file using default properties. */
|
|
|
|
|
if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create the dataspace */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file3_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/d", "/d") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset2_id, "", "") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with a small buffer for name
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with a small buffer for name");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
{
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/*small buffer to hold name and its size */
|
|
|
|
|
char name2[SMALL_NAME_BUF_SIZE];
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get name */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*name2 = '\0';
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
name_len=(size_t)H5Iget_name(group_id, name2, SMALL_NAME_BUF_SIZE);
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Check that name is longer */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(name_len <= SMALL_NAME_BUF_SIZE) TEST_ERROR
|
|
|
|
|
if(HDstrcmp(name2, "/")) TEST_ERROR
|
2005-12-26 13:28:18 +08:00
|
|
|
|
}
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g17", "/g17") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with a dynamic buffer for name
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with a dynamic buffer for name");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Reopen the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get name */
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
name_len = (size_t)H5Iget_name(group_id, NULL, NAME_BUF_SIZE);
|
2005-12-26 13:28:18 +08:00
|
|
|
|
|
|
|
|
|
{
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* dynamic buffer to hold name */
|
|
|
|
|
char *name3;
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Include the extra null character */
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
name3 = (char *)HDmalloc(name_len + 1);
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(!name3) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get name with dynamic buffer */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*name3 = '\0';
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Iget_name(group_id, name3, name_len + 1) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(HDstrcmp(name3, "/g17")) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*name3 = '\0';
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Get name with smaller buffer */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*name3 = '\0';
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Iget_name(group_id, name3, 3) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(HDstrcmp(name3, "/g")) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
HDfree(name3);
|
2005-12-26 13:28:18 +08:00
|
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with invalid IDs
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with invalid IDs");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a dataspace */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Define a datatype */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(file_id , "d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
{
|
|
|
|
|
char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
|
|
|
|
|
|
|
|
|
|
/* Get name for non commited datatype, it should fail */
|
|
|
|
|
H5E_BEGIN_TRY {
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Iget_name(type_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR
|
2005-12-26 13:28:18 +08:00
|
|
|
|
} H5E_END_TRY;
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2005-12-26 13:28:18 +08:00
|
|
|
|
/* Get name for dataspace, it should fail */
|
|
|
|
|
H5E_BEGIN_TRY {
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(H5Iget_name(space_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR
|
2005-12-26 13:28:18 +08:00
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
}
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with added names with mounting
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
TESTING("H5Iget_name with added names with mounting");
|
|
|
|
|
|
|
|
|
|
/* Create a group "g18/g2" in the first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g18", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g18/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Also create a dataset and a datatype */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset_id = H5Dcreate2(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Create second file and group "/g3/g4/g5" in it */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file1_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group5_id = H5Gcreate2(file1_id, "/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Mount first file at "g3/g4" in the second file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Get name for the group ID in the first file, should be "/g18/g2" still */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Get name for the dataset ID in the first file, should be "/g18/g2/d2" still */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Get name for the datatype ID in the first file, should be "/g18/g2/t2" still */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Open the mounted group, dataset, and datatype through their new names */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group6_id = H5Gopen2(file1_id, "/g3/g4/g18/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dataset2_id = H5Dopen2(file1_id, "/g3/g4/g18/d2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if((type2_id = H5Topen2(file1_id, "/g3/g4/g18/t2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Verify names */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "/g3/g4/g18/g2", "/g3/g4/g18/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(dataset2_id, "/g3/g4/g18/d2", "/g3/g4/g18/d2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(type2_id, "/g3/g4/g18/t2", "/g3/g4/g18/t2") < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Verify that old IDs still refer to objects by their old names */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Unmount */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Funmount(file1_id, "/g3/g4") < 0) FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
|
|
|
|
/* Get name for the IDs of the first file, should be unchanged */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
2006-11-04 12:35:54 +08:00
|
|
|
|
/* Get name for the IDs of the second file, should be local names now */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "/g18/g2", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(dataset2_id, "/g18/d2", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(type2_id, "/g18/t2", "") < 0) TEST_ERROR
|
|
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
|
if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Tclose(type2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
PASSED();
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with H5Fclose
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Fclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a file and group "/g1/g2" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Fmount and H5Ldelete
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Fmount and H5Ldelete");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a file and group "/g1/g2" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new file and group "/g3/g4" in it */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount first file at "/g3/g4" in the second file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the mounted group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file1_id, "/g3/g4/g1/g2", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "", "") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Fmount and H5Lmove
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Fmount and H5Lmove");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a file and group "/g1/g2" in it */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a new file and group "/g3/g4" in it */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount first file at "g3/g4" in the second file */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the mounted group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open another mounted group, in the middle of the path */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group6_id = H5Gopen2(file2_id, "/g3/g4/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file2_id, "/g3/g4/g1/g2", H5L_SAME_LOC, "/g3/g4/g1/g5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file2_id, "/g3/g4/g1", H5L_SAME_LOC, "/g3/g4/g1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1a/g5", "/g3/g4/g1a/g5") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g1a/g5", "/g1a/g5") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "/g3/g4/g1a", "/g3/g4/g1a") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename middle group back, using relative path */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(group3_id, "g4/g1a", H5L_SAME_LOC, "g4/g1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename end group back, using relative path */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(group3_id, "g4/g1/g5", H5L_SAME_LOC, "g4/g1/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename mount point */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file2_id, "/g3/g4", H5L_SAME_LOC, "/g3/g4a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g3/g4a", "/g3/g4a") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group5_id, "/g3/g4a/g1/g2", "/g3/g4a/g1/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group6_id, "/g3/g4a/g1", "/g3/g4a/g1") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename mount point back, using relative path*/
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(group3_id, "g4a", H5L_SAME_LOC, "g4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lcreate_hard
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lcreate_hard");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g19/g1" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g19", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g19/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create hard link to "g19/g1/ group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g19/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename original group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename original group back, using relative path */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(group_id, "g3", H5L_SAME_LOC, "g1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create another hard link to "/g19/g1" group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete group */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g19/g3", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close the unlinked group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create another hard link to "/g19/g1" group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete group, using relative path */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(group_id, "g3", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close the unlinked group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lcreate_soft
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lcreate_soft");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g20/g1" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g20", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g20/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create symbolic link to "g20/g1/ group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_soft("/g20/g1", file_id, "/g20/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g20/g1", "/g20/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g20/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g20/g2", "/g20/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lcreate_soft and move target
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lcreate_soft and move target");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g21/g1" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g21/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create symbolic link to "g21/g1/ group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_soft("/g21/g1", file_id, "/g21/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g21/g1", "/g21/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g21/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g21/g1", H5L_SAME_LOC, "/g21/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g21/g3", "/g21/g3") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g21/g2", "/g21/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lcreate_soft and move source
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lcreate_soft and move source");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g22/g1" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g22/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create symbolic link to "g22/g1/ group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_soft("/g22/g1", file_id, "/g22/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g22/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename soft link */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g22/g2", H5L_SAME_LOC, "/g22/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g22/g3", "/g22/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename soft link, using relative paths */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(group_id, "g3", H5L_SAME_LOC, "g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g22/g2", "/g22/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lcreate_soft and unlink target
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lcreate_soft and unlink target");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g23/g1" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g23", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g23/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create symbolic link to "g23/g1/ group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_soft("/g23/g1", file_id, "/g23/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g23/g1", "/g23/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g23/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete group */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g23/g1", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g23/g2", "/g23/g2") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with H5Lcreate_soft and unlink source
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
TESTING("H5Iget_name with H5Lcreate_soft and unlink source");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "g24/g1" */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g24", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g24/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create symbolic link to "g24/g1/ group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_soft("/g24/g1", file_id, "/g24/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g24/g1", "/g24/g1") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g24/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-11-04 12:35:54 +08:00
|
|
|
|
/* Delete symbolic link */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(file_id, "/g24/g2", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g24/g1", "") < 0) TEST_ERROR
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with several nested mounted files
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with several nested mounted files");
|
2002-08-29 02:34:12 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a group "g25/g1/g2" in the first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g25", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g25/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g25/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "/g26/g3/g4" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g26", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g26/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g26/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create third file and group "/g27/g5/g6" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file2_id, "/g27", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file2_id, "/g27/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file2_id, "/g27/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create fourth file and group "/g28/g5/g6" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file3_id, "/g28", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file3_id, "/g28/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file3_id, "/g28/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group which will be hidden in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g25/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g25/g1" in the first file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group which will be hidden in the second file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount third file under "/g25/g1/g26/g3" in the first file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the third file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g6", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount fourth file under "/g25/g1/g26/g3/g27/g5" in the first file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group in the fourth file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group4_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", "/g25/g1/g26/g3/g27/g5/g28/g7/g8") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5") < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g28/g7/g8", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g25/g1/g26/g3") < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g27/g5/g6", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g25/g1") < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g26/g3/g4", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name and H5Lmove with repeated path components
|
2006-08-01 03:46:16 +08:00
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-29 06:30:13 +08:00
|
|
|
|
TESTING("H5Iget_name and H5Lmove with repeated path components");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a group "g29/g1/g2/g1/g2" in a file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g29", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g29/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g29/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file_id, "/g29/g1/g2/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group5_id = H5Gcreate2(file_id, "/g29/g1/g2/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g29/g1/g2/g1/g2", H5L_SAME_LOC, "/g29/g1/g2/g1/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g29/g1/g2/g1/g3", "/g29/g1/g2/g1/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group in middle of path, keeping within the same group */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g29/g1/g2/g1", H5L_SAME_LOC, "/g29/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g29/g1/g2/g3", "/g29/g1/g2/g3") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group5_id, "/g29/g1/g2/g3/g3", "/g29/g1/g2/g3/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Rename group in middle of path, moving to another group in file */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Lmove(file_id, "/g29/g1/g2/g3", H5L_SAME_LOC, "/g29/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g29/g3", "/g29/g3") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group5_id, "/g29/g3/g3", "/g29/g3/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 06:30:13 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with higher mounted file
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with higher mounted file");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create a group "/g30/g1/g2" in the first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g30", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g30/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g30/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "/g31/g3/g4" in it */
|
|
|
|
|
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g31", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g31/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g31/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create third file and group "/g32/g5/g6" in it */
|
|
|
|
|
file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file2_id, "/g32", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file2_id, "/g32/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file2_id, "/g32/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create fourth file and group "/g33/g5/g6" in it */
|
|
|
|
|
file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file3_id, "/g33", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file3_id, "/g33/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file3_id, "/g33/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group which will be hidden in the first file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file_id, "/g30/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g30/g1" in the first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group which will be hidden in the second file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount third file under "/g30/g1/g31/g3" in the first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group which will be hidden in the third file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group3_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g32/g5/g6", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount fourth file under "/g30" in the first file, hiding the files below it */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Access group which will be in the fourth file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group4_id = H5Gopen2(file_id, "/g30/g33/g7/g8", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g30/g33/g7/g8", "/g30/g33/g7/g8") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount fourth file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g30") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount third file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g30/g1/g31/g3") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g32/g5/g6", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount second file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g30/g1") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "/g32/g5/g6", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "/g31/g3/g4", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close groups */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
|
|
|
|
H5Gclose(group4_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close files */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Fclose(file1_id);
|
|
|
|
|
H5Fclose(file2_id);
|
|
|
|
|
H5Fclose(file3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with multiple hard links and mounted files
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with multiple hard links and mounted files");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "/g35/g3/g4" in it */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g35", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g35/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g35/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "/g34/g1/g2" in first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g34", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g34/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g34/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create hard link to "/g34/g1/g2 group */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_hard(file_id, "/g34/g1/g2", H5L_SAME_LOC, "/g34/g2a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open the link to the group */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group4_id = H5Gopen2(file_id, "/g34/g2a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g34/g1" in the first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "", "/g34/g1/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount second file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g34/g1") < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
2007-08-29 03:47:00 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with mounted files and unlinking
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with mounted files and unlinking");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create group "/g36/g1/g2" in first file */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file_id, "/g36", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file_id, "/g36/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file_id, "/g36/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "/g37/g4" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g37", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g37/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g37/g4/g5a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group4_id = H5Gcreate2(file1_id, "/g37/g4/g5b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g36/g1" in the first file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open group in mounted file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group5_id = H5Gopen2(file_id, "/g36/g1/g37/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group5_id, "/g36/g1/g37", "/g36/g1/g37") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open group to delete in mounted file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "/g36/g1/g37/g4/g5a", "/g36/g1/g37/g4/g5a") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete end group in mounted file, using relative paths */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(group5_id, "g4/g5a", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group3_id, "", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close deleted group */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Open groups to delete in mounted file */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group7_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5b", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "/g36/g1/g37/g4", "/g36/g1/g37/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group7_id, "/g36/g1/g37/g4/g5b", "/g36/g1/g37/g4/g5b") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Delete middle group in mounted file, using relative paths */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(group5_id, "g4", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group6_id, "", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group2_id, "", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group7_id, "", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group4_id, "", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close deleted groups */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group7_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close group in mounted file */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Funmount(file_id, "/g36/g1") < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with mounting already mounted files
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with mounting already mounted files");
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create file and group "/g38/g1/g2" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g38", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g38/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g38/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "/g39/g1/g2" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file2_id, "/g39", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file2_id, "/g39/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file2_id, "/g39/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create third file and group "/g40/g5/g6" in it */
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file3_id, "/g40", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file3_id, "/g40/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file3_id, "/g40/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g38/g1" in the first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file1_id, "/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount first file under "/g40/g5" in the third file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(file3_id, "/g40/g5/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g40/g5/g38/g1/g39/g3/g4", "/g40/g5/g38/g1/g39/g3/g4") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file3_id, "/g40/g5") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g38/g1/g39/g3/g4", "") < 0) TEST_ERROR
|
|
|
|
|
if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount second file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file1_id, "/g38/g1") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g39/g3/g4", "") < 0) TEST_ERROR
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Fclose(file1_id);
|
|
|
|
|
H5Fclose(file2_id);
|
|
|
|
|
H5Fclose(file3_id);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2002-10-15 04:08:57 +08:00
|
|
|
|
|
2005-03-18 10:56:01 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-08-01 03:46:16 +08:00
|
|
|
|
* Test H5Iget_name with opening object in unmounted file
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
TESTING("H5Iget_name with opening object in unmounted file");
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create file and group "/g39/g1/g2" in it */
|
|
|
|
|
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file1_id, "/g41", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file1_id, "/g41/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file1_id, "/g41/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Create second file and group "/g42/g1/g2" in it */
|
|
|
|
|
file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group_id = H5Gcreate2(file2_id, "/g42", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group2_id = H5Gcreate2(file2_id, "/g42/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
|
|
|
|
if((group3_id = H5Gcreate2(file2_id, "/g42/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Gclose(group3_id);
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Mount second file under "/g41/g1" in the first file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT) < 0) TEST_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group_id = H5Gopen2(file1_id, "/g41/g1/g42/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group_id, "/g41/g1/g42/g3", "/g41/g1/g42/g3") < 0) TEST_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Unmount file */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Funmount(file1_id, "/g41/g1") < 0) TEST_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group2_id = H5Gopen2(group_id, "g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Verify */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(check_name(group2_id, "/g42/g3/g4", "") < 0) TEST_ERROR
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
H5Gclose(group_id);
|
|
|
|
|
H5Gclose(group2_id);
|
|
|
|
|
H5Fclose(file1_id);
|
2015-04-09 00:06:48 +08:00
|
|
|
|
|
|
|
|
|
PASSED();
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Test H5Iget_name with anonymous datatypes
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
TESTING("H5Iget_name with anonymous datatypes");
|
|
|
|
|
|
|
|
|
|
/* Commit the type anonymously and link it in */
|
|
|
|
|
if((dtype = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
|
|
|
|
|
/* Test H5Iget_name with created datatype, should fail because not committed */
|
|
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
|
if((size = H5Iget_name(dtype, NULL, 0)) >= 0) TEST_ERROR
|
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
|
|
|
|
|
if(H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Test H5Iget_name with anonymously created datatype, should pass because committed */
|
|
|
|
|
if((size = H5Iget_name(dtype, NULL, 0)) != 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create a link to the object */
|
|
|
|
|
if( H5Olink(dtype, file2_id, "datatype", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Commit a second datatype with no links to it and commit it */
|
|
|
|
|
if((dtype_anon = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
|
|
|
|
|
if(H5Tcommit_anon(file2_id, dtype_anon, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Test H5Iget_name with anonymously created datatype, should pass because committed */
|
|
|
|
|
if((size = H5Iget_name(dtype_anon, NULL,0)) != 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Store the address of the datatype for later use */
|
|
|
|
|
if(H5Oget_info(dtype_anon, &oinfo) < 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Update the reference count to dtype_anon to preserve the datatype */
|
|
|
|
|
if(H5Oincr_refcount(dtype_anon) < 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
if(H5Tclose(dtype) < 0) TEST_ERROR
|
|
|
|
|
if(H5Tclose(dtype_anon) < 0) TEST_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Re-open the file and check that the anonymous datatypes persist */
|
2015-04-09 23:57:01 +08:00
|
|
|
|
if( (file2_id = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
|
2015-04-09 00:06:48 +08:00
|
|
|
|
|
|
|
|
|
/* Check the H5Iget_name does not return an error for anon committed datatypes */
|
|
|
|
|
if((dtype_anon = H5Oopen_by_addr(file2_id, oinfo.addr)) < 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
if((size = H5Iget_name(dtype_anon,NULL,0)) != 0) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
if(H5Tclose(dtype_anon) < 0) TEST_ERROR
|
|
|
|
|
if(H5Fclose(file2_id) < 0) TEST_ERROR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
PASSED();
|
2005-03-18 10:56:01 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
return(0);
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
return(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
test_obj_ref(hid_t fapl)
|
|
|
|
|
{
|
|
|
|
|
char filename1[1024];
|
|
|
|
|
char filename2[1024];
|
|
|
|
|
hid_t fid1, fid2; /* HDF5 File IDs */
|
|
|
|
|
hid_t dataset, dataset2; /* Dataset ID */
|
|
|
|
|
hid_t group, group2; /* Group ID */
|
|
|
|
|
hid_t sid1; /* Dataspace ID */
|
|
|
|
|
hid_t tid1; /* Datatype ID */
|
|
|
|
|
hsize_t dims1[] = {SPACE1_DIM1};
|
|
|
|
|
hobj_ref_t wbuf[SPACE1_DIM1]; /* Buffer to write to disk */
|
|
|
|
|
int tu32[SPACE1_DIM1]; /* Int data */
|
2016-07-18 08:18:42 +08:00
|
|
|
|
ssize_t namelen; /* Length of the name */
|
2006-11-18 21:52:32 +08:00
|
|
|
|
int i; /* counting variables */
|
|
|
|
|
char buf[100];
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Initialize the file names */
|
|
|
|
|
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
|
|
|
|
|
h5_fixname(FILENAME[2], fapl, filename2, sizeof filename2);
|
|
|
|
|
|
|
|
|
|
/* Create files */
|
|
|
|
|
if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create dataspace for datasets */
|
|
|
|
|
if((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create a group */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create a single dataset inside the second file, which will be mounted
|
|
|
|
|
* and used to mask objects in the first file */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset = H5Dcreate2(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if(H5Dclose(dataset) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
/* Create a dataset(inside Group1) */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Initialize data buffer */
|
|
|
|
|
for(i = 0; i < SPACE1_DIM1; i++)
|
|
|
|
|
tu32[i] = i * 3;
|
|
|
|
|
|
|
|
|
|
/* Write selection to disk */
|
|
|
|
|
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tu32) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Close Dataset */
|
|
|
|
|
if(H5Dclose(dataset) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
/* Create another dataset(inside Group1) */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Close Dataset */
|
|
|
|
|
if(H5Dclose(dataset) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Create a datatype to refer to */
|
|
|
|
|
if((tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-08-01 03:46:16 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Insert fields */
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
if(H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
if(H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
if(H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Save datatype for later */
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
|
if(H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Close datatype */
|
|
|
|
|
if(H5Tclose(tid1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create a new group in group1 */
|
2007-08-24 04:25:25 +08:00
|
|
|
|
if((group2 = H5Gcreate2(group, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Create a hard link to group1 in group2 */
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Lcreate_hard(fid1, "/Group1", H5L_SAME_LOC, "/Group1/Group2/Link", H5P_DEFAULT, H5P_DEFAULT) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Create dataset in that group */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset = H5Dcreate2(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Close Dataset */
|
|
|
|
|
if(H5Dclose(dataset) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Close group */
|
|
|
|
|
if(H5Gclose(group) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if(H5Gclose(group2) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Open up that hard link and make a new dataset there */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset = H5Dcreate2(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
if(H5Dclose(dataset) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if(H5Gclose(group) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Create a dataset to store references */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create reference to dataset */
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create reference to dataset */
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create reference to group */
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create reference to named datatype */
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Create reference to root group */
|
2014-07-31 04:55:14 +08:00
|
|
|
|
if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, (hid_t)-1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Write selection to disk */
|
|
|
|
|
if(H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to normal dataset in root group");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2014-02-04 23:11:20 +08:00
|
|
|
|
|
|
|
|
|
/* Check H5Rget_name returns the correct length of the name when name is NULL */
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 0);
|
|
|
|
|
if(namelen != 9) TEST_ERROR
|
2014-02-04 23:11:20 +08:00
|
|
|
|
/* Make sure size parameter is ignored */
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200);
|
|
|
|
|
if(namelen != 9) TEST_ERROR
|
2014-02-04 23:11:20 +08:00
|
|
|
|
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to dataset in /Group1");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(namelen == 16))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(namelen == 16))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to /Group1");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(group, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Group1") == 0) &&(namelen == 7))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Group1") == 0) &&(namelen == 7))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to datatype in /Group1");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((tid1 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(tid1, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Tclose(tid1) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(namelen == 17))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(namelen == 17))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to dataset in nested group");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(namelen == 23))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(namelen == 23))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to nested group");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(group, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(namelen == 14))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(namelen == 14))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to dataset created via hard link");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(namelen == 16))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(namelen == 16))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
HDmemset(buf, 0, sizeof(buf));
|
2008-09-16 23:52:51 +08:00
|
|
|
|
TESTING("getting path to root group");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(group, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(!((HDstrcmp(buf, "/") == 0) &&(namelen == 1))) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7], (char*)buf, sizeof(buf));
|
|
|
|
|
if(!((HDstrcmp(buf, "/") == 0) &&(namelen == 1))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
/* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */
|
|
|
|
|
if(H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
TESTING("getting path to dataset hidden by a mounted file");
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(namelen != 0) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf));
|
|
|
|
|
if(namelen != 0) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
/* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2007-08-30 04:44:19 +08:00
|
|
|
|
if(H5Ldelete(fid1, "/Group1/Dataset2", H5P_DEFAULT) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
|
TESTING("getting path to dataset that has been unlinked");
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
|
2007-08-29 03:47:00 +08:00
|
|
|
|
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
|
2016-07-18 08:18:42 +08:00
|
|
|
|
if(namelen != 0) TEST_ERROR
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf = '\0';
|
2016-07-18 08:18:42 +08:00
|
|
|
|
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf));
|
|
|
|
|
if(namelen != 0) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Close disk dataspace */
|
|
|
|
|
if(H5Sclose(sid1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
/* Close Dataset */
|
|
|
|
|
if(H5Dclose(dataset) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
|
/* Close file */
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if(H5Fclose(fid1) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if(H5Fclose(fid2) < 0)
|
2007-08-29 03:47:00 +08:00
|
|
|
|
FAIL_STACK_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
test_reg_ref(hid_t fapl)
|
|
|
|
|
{
|
|
|
|
|
char filename1[1024];
|
|
|
|
|
hid_t file_id; /* file identifier */
|
|
|
|
|
hid_t dsetv_id; /*dataset identifiers*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
hid_t dsetr_id;
|
|
|
|
|
hid_t space_id, spacer_id;
|
2006-11-18 21:52:32 +08:00
|
|
|
|
hsize_t dims[2] = {2,9};
|
|
|
|
|
hsize_t dimsr[1] = {2};
|
|
|
|
|
int rank = 2;
|
|
|
|
|
int rankr = 1;
|
|
|
|
|
hdset_reg_ref_t ref[2];
|
|
|
|
|
hdset_reg_ref_t ref_out[2];
|
|
|
|
|
int data[2][9] = {{1,1,2,3,3,4,5,5,6},{1,2,2,3,4,4,5,6,6}};
|
|
|
|
|
hsize_t start[2];
|
|
|
|
|
hsize_t count[2];
|
|
|
|
|
hsize_t coord[2][3] = {{0, 0, 1}, {6, 0, 8}};
|
|
|
|
|
unsigned num_points = 3;
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
ssize_t name_size1, name_size2;
|
2006-11-18 21:52:32 +08:00
|
|
|
|
char buf1[NAME_BUF_SIZE], buf2[NAME_BUF_SIZE];
|
|
|
|
|
|
|
|
|
|
/* Initialize the file name */
|
|
|
|
|
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
|
|
|
|
|
|
2006-12-14 22:34:39 +08:00
|
|
|
|
/* Create file with default file create property but vfd access property. */
|
2006-11-18 21:52:32 +08:00
|
|
|
|
if((file_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create dataspace for datasets */
|
|
|
|
|
if((space_id = H5Screate_simple(rank, dims, NULL)) < 0)
|
|
|
|
|
TEST_ERROR
|
|
|
|
|
if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0)
|
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create integer dataset */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dsetv_id = H5Dcreate2(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Write data to the dataset */
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, data) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dclose(dsetv_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Dataset with references */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
|
if((dsetr_id = H5Dcreate2(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Create a reference to the hyperslab.
|
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
start[0] = 0;
|
|
|
|
|
start[1] = 3;
|
2006-11-18 21:52:32 +08:00
|
|
|
|
count[0] = 2;
|
|
|
|
|
count[1] = 3;
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create a reference to elements selection */
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Sselect_none(space_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Write dataset with the references */
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Close all objects */
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Sclose(space_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Sclose(spacer_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dclose(dsetr_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Fclose(file_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Reopen the file to read selections back */
|
2006-12-14 22:34:39 +08:00
|
|
|
|
if((file_id = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Reopen the dataset with object references and read references to the buffer */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
if((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Get name of the dataset the first region reference points to using H5Rget_name */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
TESTING("H5Rget_name to get name from region reference(hyperslab)");
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf1 = '\0';
|
2014-02-04 23:11:20 +08:00
|
|
|
|
|
|
|
|
|
/* Check H5Rget_name returns the correct length of the name when name is NULL */
|
|
|
|
|
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], NULL, 0);
|
|
|
|
|
if(name_size1 != 7) TEST_ERROR
|
|
|
|
|
|
|
|
|
|
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE );
|
2008-09-16 23:52:51 +08:00
|
|
|
|
if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
TESTING("H5Iget_name to get name from region reference(hyperslab)");
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Dereference the first reference */
|
2011-07-19 07:12:28 +08:00
|
|
|
|
dsetv_id = H5Rdereference2(dsetr_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_out[0]);
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Get name of the dataset the first region reference points using H5Iget_name */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf2 = '\0';
|
2008-09-16 23:52:51 +08:00
|
|
|
|
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dclose(dsetv_id) < 0) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
PASSED()
|
|
|
|
|
|
|
|
|
|
/* Get name of the dataset the second region reference points to using H5Rget_name */
|
2007-08-28 23:02:54 +08:00
|
|
|
|
TESTING("H5Rget_name to get name from region reference(pnt selec)");
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf1 = '\0';
|
2008-09-16 23:52:51 +08:00
|
|
|
|
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1], (char*)buf1, NAME_BUF_SIZE);
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
PASSED()
|
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
|
TESTING("H5Iget_name to get name from region reference(pnt selec)");
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Dereference the second reference */
|
2011-07-19 07:12:28 +08:00
|
|
|
|
if((dsetv_id = H5Rdereference2(dsetr_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
/* Get name of the dataset the first region reference points using H5Iget_name */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
*buf2 = '\0';
|
2008-09-16 23:52:51 +08:00
|
|
|
|
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dclose(dsetv_id) < 0) TEST_ERROR
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
PASSED()
|
|
|
|
|
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Dclose(dsetr_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2009-03-11 03:00:39 +08:00
|
|
|
|
if(H5Fclose(file_id) < 0)
|
2006-11-18 21:52:32 +08:00
|
|
|
|
TEST_ERROR
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: test_elinks
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Verify that querying names of objects reached via external
|
|
|
|
|
* links uses cached path/name information for object and doesn't
|
|
|
|
|
* search the file.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
|
|
|
|
* Failure: 1
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Tuesday, July 27, 2010
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static int
|
|
|
|
|
test_elinks(hid_t fapl)
|
|
|
|
|
{
|
|
|
|
|
char filename1[1024], filename2[1024]; /* Filenames */
|
|
|
|
|
hid_t fid1, fid2; /* HDF5 File IDs */
|
|
|
|
|
hid_t group, group2; /* Group IDs */
|
|
|
|
|
char name[NAME_BUF_SIZE]; /* Buffer for storing object's name */
|
|
|
|
|
ssize_t namelen; /* Length of object's name */
|
|
|
|
|
hbool_t name_cached; /* Indicate if name is cached */
|
|
|
|
|
|
|
|
|
|
/* Initialize the file names */
|
|
|
|
|
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
|
|
|
|
|
h5_fixname(FILENAME[2], fapl, filename2, sizeof filename2);
|
|
|
|
|
|
|
|
|
|
/* Create files */
|
|
|
|
|
if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create a group in the second file */
|
|
|
|
|
if((group2 = H5Gcreate2(fid2, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Close Group */
|
|
|
|
|
if(H5Gclose(group2) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create an external link in first file to the group in the second file */
|
|
|
|
|
if(H5Lcreate_external(filename2, "Group2", fid1, "Link_to_Group2", H5P_DEFAULT, H5P_DEFAULT) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Create an external link in second file to the external link in the first file */
|
|
|
|
|
if(H5Lcreate_external(filename1, "Link_to_Group2", fid2, "Link_to_Link_to_Group2", H5P_DEFAULT, H5P_DEFAULT) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Open the group in thesecond file through the external link */
|
|
|
|
|
if((group = H5Gopen2(fid1, "Link_to_Group2", H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Query the external link object's name */
|
|
|
|
|
*name = '\0';
|
|
|
|
|
name_cached = FALSE;
|
|
|
|
|
namelen = H5I_get_name_test(group, (char*)name, sizeof(name), &name_cached);
|
|
|
|
|
if(!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
|
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Close Group */
|
|
|
|
|
if(H5Gclose(group) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Open the group in the second file through the external link to the external link */
|
|
|
|
|
if((group = H5Gopen2(fid2, "Link_to_Link_to_Group2", H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Query the external link to external link object's name */
|
|
|
|
|
*name = '\0';
|
|
|
|
|
name_cached = FALSE;
|
|
|
|
|
namelen = H5I_get_name_test(group, (char*)name, sizeof(name), &name_cached);
|
|
|
|
|
if(!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
|
|
|
|
|
TEST_ERROR
|
|
|
|
|
|
|
|
|
|
/* Close Group */
|
|
|
|
|
if(H5Gclose(group) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
/* Close files */
|
|
|
|
|
if(H5Fclose(fid1) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
if(H5Fclose(fid2) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-18 21:52:32 +08:00
|
|
|
|
int
|
|
|
|
|
main(void)
|
|
|
|
|
{
|
2007-08-28 23:02:54 +08:00
|
|
|
|
hid_t file_id =(-1);
|
2007-06-16 03:11:59 +08:00
|
|
|
|
int nerrors = 0;
|
|
|
|
|
hid_t fapl;
|
|
|
|
|
char filename0[1024];
|
|
|
|
|
|
|
|
|
|
/* Reset the library and get the file access property list */
|
|
|
|
|
h5_reset();
|
|
|
|
|
fapl = h5_fileaccess();
|
|
|
|
|
h5_fixname(FILENAME[0], fapl, filename0, sizeof filename0);
|
|
|
|
|
|
|
|
|
|
/* Create a new file_id using default create property but vfd access
|
|
|
|
|
* property.
|
|
|
|
|
*/
|
2007-08-28 23:02:54 +08:00
|
|
|
|
if((file_id = H5Fcreate(filename0,H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
2007-06-16 03:11:59 +08:00
|
|
|
|
|
|
|
|
|
/* Call "main" test routine */
|
|
|
|
|
nerrors += test_main(file_id, fapl);
|
|
|
|
|
nerrors += test_obj_ref(fapl);
|
|
|
|
|
nerrors += test_reg_ref(fapl);
|
[svn-r19133] Description:
Correct traversal of user-defined links (including external links) to
retain path information of object, allowing H5Iget_name() queries to work
quickly (without searching entire destination file). This required some
refactoring and addition of a mechanism to detect if a "fast" query was
performed (for the tests).
Minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-07-28 20:27:56 +08:00
|
|
|
|
nerrors += test_elinks(fapl);
|
2007-06-16 03:11:59 +08:00
|
|
|
|
|
|
|
|
|
/* Close file */
|
|
|
|
|
H5Fclose(file_id);
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
2011-04-16 06:05:23 +08:00
|
|
|
|
/* Verify symbol table messages are cached */
|
|
|
|
|
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
|
|
|
|
|
|
2007-06-16 03:11:59 +08:00
|
|
|
|
if(nerrors)
|
|
|
|
|
goto error;
|
|
|
|
|
puts("All getname tests passed.");
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
2007-06-16 03:11:59 +08:00
|
|
|
|
h5_cleanup(FILENAME, fapl);
|
2006-11-18 21:52:32 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
|
H5Fclose(file_id);
|
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
|
|
|
|
|
puts("***** GET NAME TESTS FAILED *****");
|
|
|
|
|
|
|
|
|
|
return 1;
|
2002-04-17 01:39:38 +08:00
|
|
|
|
}
|
|
|
|
|
|