summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumpgentest.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2007-10-11 19:42:30 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2007-10-11 19:42:30 (GMT)
commit8e4bcb5fee17d87d07ab0672439ed391731c96b8 (patch)
tree32e7960fa662f4922b1930f90ae4abb8b994ef29 /tools/h5dump/h5dumpgentest.c
parente387120f945dcfdf113a34d47d828796dd84ad16 (diff)
downloadhdf5-8e4bcb5fee17d87d07ab0672439ed391731c96b8.zip
hdf5-8e4bcb5fee17d87d07ab0672439ed391731c96b8.tar.gz
hdf5-8e4bcb5fee17d87d07ab0672439ed391731c96b8.tar.bz2
[svn-r14201] attribute ordering: added objects that do not have creation order tracked
current behavior is if DCPL has creation order tracked for attributes then sort the attributes by creation order otherwise by name regarding sort order (ascending or descending) it is done in whatever is requested tested: linux
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r--tools/h5dump/h5dumpgentest.c90
1 files changed, 83 insertions, 7 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 0a6b607..d6893d9 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -5950,16 +5950,41 @@ gent_attr_creation_order(void)
goto out;
/*-------------------------------------------------------------------------
- * create a dataset and atributes in it
+ * create a dataset with creation order tracked for attributes and atributes in it
*-------------------------------------------------------------------------
*/
/* create a dataset */
- if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, "dt", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto out;
/* add attributes */
- for(i = 0; i < 3; i++) {
+ for(i = 0; i < 3; i++)
+ {
+ if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* close attribute */
+ if(H5Aclose(aid) < 0)
+ goto out;
+ } /* end for */
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+
+/*-------------------------------------------------------------------------
+ * create a dataset without creation order tracked for attributes and atributes in it
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a dataset */
+ if((did = H5Dcreate2(fid, "d", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* add attributes */
+ for(i = 0; i < 3; i++)
+ {
if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -5974,11 +5999,11 @@ gent_attr_creation_order(void)
/*-------------------------------------------------------------------------
- * create a group and atributes in it
+ * create a group with creation order tracked for attributes and atributes in it
*-------------------------------------------------------------------------
*/
- if((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "gt", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
/* add attributes */
@@ -5997,14 +6022,38 @@ gent_attr_creation_order(void)
goto out;
/*-------------------------------------------------------------------------
- * create a named datatype and atributes in it
+ * create a group without creation order tracked for attributes and atributes in it
+ *-------------------------------------------------------------------------
+ */
+
+ if((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* add attributes */
+ for(i = 0; i < 3; i++)
+ {
+ if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* close attribute */
+ if(H5Aclose(aid) < 0)
+ goto out;
+
+ } /* end for */
+
+ if(H5Gclose(gid) < 0)
+ goto out;
+
+
+/*-------------------------------------------------------------------------
+ * create a named datatype with creation order tracked for attributes and atributes in it
*-------------------------------------------------------------------------
*/
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
goto out;
- if((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0)
+ if((H5Tcommit2(fid, "tt", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0)
goto out;
/* add attributes */
@@ -6021,6 +6070,33 @@ gent_attr_creation_order(void)
if(H5Tclose(tid) < 0)
goto out;
+
+/*-------------------------------------------------------------------------
+ * create a named datatype without creation order tracked for attributes and atributes in it
+ *-------------------------------------------------------------------------
+ */
+
+ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ goto out;
+
+ if((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* add attributes */
+ for(i = 0; i < 3; i++)
+ {
+ if((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* close attribute */
+ if(H5Aclose(aid) < 0)
+ goto out;
+
+ } /* end for */
+
+ if(H5Tclose(tid) < 0)
+ goto out;
+
/*-------------------------------------------------------------------------
* add some attributes to the root group
*-------------------------------------------------------------------------