summaryrefslogtreecommitdiffstats
path: root/test/tvltypes.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2006-05-02 19:42:41 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2006-05-02 19:42:41 (GMT)
commit1acc676fcf1e2451d1935f95731b5644a60a0e0d (patch)
treefad0f4a8941a8550cec3ca5ae9861dee869cc278 /test/tvltypes.c
parent720f6cb0654db81051c1d3d5c150cac8537e6bc2 (diff)
downloadhdf5-1acc676fcf1e2451d1935f95731b5644a60a0e0d.zip
hdf5-1acc676fcf1e2451d1935f95731b5644a60a0e0d.tar.gz
hdf5-1acc676fcf1e2451d1935f95731b5644a60a0e0d.tar.bz2
[svn-r12322] Purpose: Test some functions
Description: Test some data type functions that are and aren't supposed to work with some data types. Platforms tested: h5committest and fuss.
Diffstat (limited to 'test/tvltypes.c')
-rw-r--r--test/tvltypes.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/tvltypes.c b/test/tvltypes.c
index df72c52..a12de08 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -164,6 +164,66 @@ test_vltypes_dataset_create(void)
/****************************************************************
**
+** test_vltypes_funcs(): Test some type functions that are and
+** aren't supposed to work with VL type.
+**
+****************************************************************/
+static void
+test_vltypes_funcs(void)
+{
+ hid_t type; /* Datatype ID */
+ int size;
+ H5T_pad_t inpad;
+ H5T_norm_t norm;
+ H5T_cset_t cset;
+ H5T_str_t strpad;
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing some type functions for VL\n"));
+
+ /* Create a datatype to refer to */
+ type = H5Tvlen_create (H5T_IEEE_F32BE);
+ CHECK(type, FAIL, "H5Tvlen_create");
+
+ size=H5Tget_precision(type);
+ CHECK(size, FAIL, "H5Tget_precision");
+
+ size=H5Tget_size(type);
+ CHECK(size, FAIL, "H5Tget_size");
+
+ size=H5Tget_ebias(type);
+ CHECK(size, FAIL, "H5Tget_ebias");
+
+ ret=H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
+ CHECK(ret, FAIL, "H5Tset_pad");
+
+ inpad=H5Tget_inpad(type);
+ CHECK(inpad, FAIL, "H5Tget_inpad");
+
+ norm=H5Tget_norm(type);
+ CHECK(norm, FAIL, "H5Tget_norm");
+
+ ret=H5Tset_offset(type, 16);
+ CHECK(ret, FAIL, "H5Tset_offset");
+
+ H5E_BEGIN_TRY {
+ cset=H5Tget_cset(type);
+ } H5E_END_TRY;
+ VERIFY(cset, FAIL, "H5Tget_cset");
+
+ H5E_BEGIN_TRY {
+ strpad=H5Tget_strpad(type);
+ } H5E_END_TRY;
+ VERIFY(strpad, FAIL, "H5Tget_strpad");
+
+ /* Close datatype */
+ ret = H5Tclose(type);
+ CHECK(ret, FAIL, "H5Tclose");
+}
+
+/****************************************************************
+**
** test_vltypes_vlen_atomic(): Test basic VL datatype code.
** Tests VL datatypes of atomic datatypes
**
@@ -2042,6 +2102,7 @@ test_vltypes(void)
/* These next tests use the same file */
test_vltypes_dataset_create(); /* Check dataset of VL when fill value
* won't be rewritten to it.*/
+ test_vltypes_funcs(); /* Test functions with VL types */
test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */
rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */
test_vltypes_vlen_compound(); /* Test VL compound datatypes */