mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-03 02:32:04 +08:00
Merge pull request #503 in HDFFV/hdf5 from ~BYRN/hdf5_adb:bugfix/HDFFV-10186-tbitnopaque-test to develop
* commit 'ec0935a924a84b18b29473b4fcec7c3f4e1aca76': HDFFV-10186 xml test also needs endianess aware files HDFFV-10186 - h5tools_str_append is not printf HDFFV-10186 braces formatting Fix reference file contents HDFFV-10186 Add endianess to bitfield and fix tests
This commit is contained in:
commit
fcdf2ace7d
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -726,7 +726,8 @@ tools/testfiles/tattrreg.h5 -text
|
||||
tools/testfiles/tbigdims.h5 -text
|
||||
tools/testfiles/tbinary.h5 -text
|
||||
tools/testfiles/tbitfields.h5 -text
|
||||
tools/testfiles/tbitnopaque.ddl -text
|
||||
tools/testfiles/tbitnopaque_be.ddl -text
|
||||
tools/testfiles/tbitnopaque_le.ddl -text
|
||||
tools/testfiles/tbitnopaque.h5 -text svneol=unset#application/x-hdf
|
||||
tools/testfiles/tchar.h5 -text
|
||||
tools/testfiles/tcmpdattrintsize.h5 -text
|
||||
|
6
MANIFEST
6
MANIFEST
@ -1629,7 +1629,8 @@
|
||||
./tools/testfiles/tbinregR.exp
|
||||
./tools/testfiles/tbinregR.ddl
|
||||
./tools/testfiles/tbitfields.h5
|
||||
./tools/testfiles/tbitnopaque.ddl
|
||||
./tools/testfiles/tbitnopaque_be.ddl
|
||||
./tools/testfiles/tbitnopaque_le.ddl
|
||||
./tools/testfiles/tbitnopaque.h5
|
||||
./tools/testfiles/tboot1.ddl
|
||||
./tools/testfiles/tboot2.ddl
|
||||
@ -2079,7 +2080,8 @@
|
||||
./tools/testfiles/tarray6.h5.xml
|
||||
./tools/testfiles/tarray7.h5.xml
|
||||
./tools/testfiles/tattr.h5.xml
|
||||
./tools/testfiles/tbitfields.h5.xml
|
||||
./tools/testfiles/tbitfields_be.h5.xml
|
||||
./tools/testfiles/tbitfields_le.h5.xml
|
||||
./tools/testfiles/tcompound.h5.xml
|
||||
./tools/testfiles/tcompound2.h5.xml
|
||||
./tools/testfiles/tcompound_complex.h5.xml
|
||||
|
@ -325,7 +325,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unknown Extension Label: 0x%02x\n", Label);
|
||||
printf("Unknown Extension Label: %#02x\n", Label);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
|
||||
|
||||
default:
|
||||
fprintf(stderr,
|
||||
"Unknown Block Separator Character: 0x%02x\n", Identifier);
|
||||
"Unknown Block Separator Character: %#02x\n", Identifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ h5str_sprintf
|
||||
this_str = (char*)HDmalloc(4 * (nll + 1));
|
||||
|
||||
if (1 == nll) {
|
||||
sprintf(this_str, "0x%02x", ucptr[0]);
|
||||
sprintf(this_str, "%#02x", ucptr[0]);
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < (int)nll; i++)
|
||||
@ -481,7 +481,7 @@ h5str_sprintf
|
||||
this_str = (char*)HDmalloc(4 * (nll + 1));
|
||||
|
||||
if (1 == nll) {
|
||||
sprintf(this_str, "0x%02x", ucptr[0]);
|
||||
sprintf(this_str, "%#02x", ucptr[0]);
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < (int)nll; i++)
|
||||
@ -1051,8 +1051,20 @@ h5str_get_little_endian_type
|
||||
p_type=H5Tcopy(H5T_IEEE_F64LE);
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_BITFIELD:
|
||||
{
|
||||
if ( size == 1)
|
||||
p_type=H5Tcopy(H5T_STD_B8LE);
|
||||
else if ( size == 2)
|
||||
p_type=H5Tcopy(H5T_STD_B16LE);
|
||||
else if ( size == 4)
|
||||
p_type=H5Tcopy(H5T_STD_B32LE);
|
||||
else if ( size == 8)
|
||||
p_type=H5Tcopy(H5T_STD_B64LE);
|
||||
}
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_OPAQUE:
|
||||
case H5T_STRING:
|
||||
case H5T_COMPOUND:
|
||||
@ -1122,8 +1134,20 @@ h5str_get_big_endian_type
|
||||
p_type=H5Tcopy(H5T_IEEE_F64BE);
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_BITFIELD:
|
||||
{
|
||||
if ( size == 1)
|
||||
p_type=H5Tcopy(H5T_STD_B8BE);
|
||||
else if ( size == 2)
|
||||
p_type=H5Tcopy(H5T_STD_B16BE);
|
||||
else if ( size == 4)
|
||||
p_type=H5Tcopy(H5T_STD_B32BE);
|
||||
else if ( size == 8)
|
||||
p_type=H5Tcopy(H5T_STD_B64BE);
|
||||
}
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_OPAQUE:
|
||||
case H5T_STRING:
|
||||
case H5T_COMPOUND:
|
||||
|
29
src/H5T.c
29
src/H5T.c
@ -67,6 +67,19 @@
|
||||
dt->shared->type = H5T_BITFIELD; \
|
||||
}
|
||||
|
||||
#define H5T_INIT_TYPE_BITFIELD_COMMON(ENDIANNESS) { \
|
||||
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
|
||||
H5T_INIT_TYPE_BITFIELD_CORE; \
|
||||
}
|
||||
|
||||
#define H5T_INIT_TYPE_BITFIELDLE_CORE { \
|
||||
H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_LE) \
|
||||
}
|
||||
|
||||
#define H5T_INIT_TYPE_BITFIELDBE_CORE { \
|
||||
H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_BE) \
|
||||
}
|
||||
|
||||
/* Define the code template for times for the "GUTS" in the H5T_INIT_TYPE macro */
|
||||
#define H5T_INIT_TYPE_TIME_CORE { \
|
||||
dt->shared->type = H5T_TIME; \
|
||||
@ -896,29 +909,29 @@ H5T__init_package(void)
|
||||
*/
|
||||
|
||||
/* little-endian (order is irrelevant) 8-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -)
|
||||
bitfield=dt; /* Keep type for later */
|
||||
|
||||
/* big-endian (order is irrelevant) 8-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -)
|
||||
|
||||
/* Little-endian 16-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -)
|
||||
|
||||
/* Big-endian 16-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -)
|
||||
|
||||
/* Little-endian 32-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -)
|
||||
|
||||
/* Big-endian 32-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -)
|
||||
|
||||
/* Little-endian 64-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -)
|
||||
|
||||
/* Big-endian 64-bit bitfield */
|
||||
H5T_INIT_TYPE(BITFIELD, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -)
|
||||
H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -)
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* The Unix architecture for dates and times.
|
||||
|
@ -395,9 +395,9 @@ hsize_t diff_attr(hid_t loc1_id,
|
||||
continue;
|
||||
}
|
||||
|
||||
if((mtype1_id = h5tools_get_native_type(ftype1_id)) < 0)
|
||||
if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0)
|
||||
goto error;
|
||||
if((mtype2_id = h5tools_get_native_type(ftype2_id)) < 0)
|
||||
if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0)
|
||||
goto error;
|
||||
if((msize1 = H5Tget_size(mtype1_id)) == 0)
|
||||
goto error;
|
||||
|
@ -329,10 +329,10 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
h5difftrace("check for memory type and sizes\n");
|
||||
if ((m_tid1=h5tools_get_native_type(f_tid1)) < 0)
|
||||
if ((m_tid1=H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0)
|
||||
goto error;
|
||||
|
||||
if ((m_tid2=h5tools_get_native_type(f_tid2)) < 0)
|
||||
if ((m_tid2=H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0)
|
||||
goto error;
|
||||
|
||||
m_size1 = H5Tget_size( m_tid1 );
|
||||
|
@ -33,19 +33,14 @@ print_dimensions (int rank, hsize_t *dims)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( rank <= 0 )
|
||||
{
|
||||
if( rank <= 0 )
|
||||
parallel_print("H5S_SCALAR" );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!dims)
|
||||
parallel_print("dimension is NULL");
|
||||
else
|
||||
{
|
||||
else {
|
||||
parallel_print("[");
|
||||
for ( i = 0; i < rank-1; i++)
|
||||
{
|
||||
for ( i = 0; i < rank-1; i++) {
|
||||
parallel_print(HSIZE_T_FORMAT, dims[i]);
|
||||
parallel_print("x");
|
||||
}
|
||||
@ -74,91 +69,108 @@ print_dimensions (int rank, hsize_t *dims)
|
||||
*/
|
||||
void print_type(hid_t type)
|
||||
{
|
||||
switch (H5Tget_class(type))
|
||||
{
|
||||
switch (H5Tget_class(type)) {
|
||||
case H5T_INTEGER:
|
||||
if (H5Tequal(type, H5T_STD_I8BE)) {
|
||||
if(H5Tequal(type, H5T_STD_I8BE))
|
||||
parallel_print("H5T_STD_I8BE");
|
||||
} else if (H5Tequal(type, H5T_STD_I8LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I8LE))
|
||||
parallel_print("H5T_STD_I8LE");
|
||||
} else if (H5Tequal(type, H5T_STD_I16BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I16BE))
|
||||
parallel_print("H5T_STD_I16BE");
|
||||
} else if (H5Tequal(type, H5T_STD_I16LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I16LE))
|
||||
parallel_print("H5T_STD_I16LE");
|
||||
} else if (H5Tequal(type, H5T_STD_I32BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I32BE))
|
||||
parallel_print("H5T_STD_I32BE");
|
||||
} else if (H5Tequal(type, H5T_STD_I32LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I32LE))
|
||||
parallel_print("H5T_STD_I32LE");
|
||||
} else if (H5Tequal(type, H5T_STD_I64BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I64BE))
|
||||
parallel_print("H5T_STD_I64BE");
|
||||
} else if (H5Tequal(type, H5T_STD_I64LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_I64LE))
|
||||
parallel_print("H5T_STD_I64LE");
|
||||
} else if (H5Tequal(type, H5T_STD_U8BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U8BE))
|
||||
parallel_print("H5T_STD_U8BE");
|
||||
} else if (H5Tequal(type, H5T_STD_U8LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U8LE))
|
||||
parallel_print("H5T_STD_U8LE");
|
||||
} else if (H5Tequal(type, H5T_STD_U16BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U16BE))
|
||||
parallel_print("H5T_STD_U16BE");
|
||||
} else if (H5Tequal(type, H5T_STD_U16LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U16LE))
|
||||
parallel_print("H5T_STD_U16LE");
|
||||
} else if (H5Tequal(type, H5T_STD_U32BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U32BE))
|
||||
parallel_print("H5T_STD_U32BE");
|
||||
} else if (H5Tequal(type, H5T_STD_U32LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U32LE))
|
||||
parallel_print("H5T_STD_U32LE");
|
||||
} else if (H5Tequal(type, H5T_STD_U64BE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U64BE))
|
||||
parallel_print("H5T_STD_U64BE");
|
||||
} else if (H5Tequal(type, H5T_STD_U64LE)) {
|
||||
else if(H5Tequal(type, H5T_STD_U64LE))
|
||||
parallel_print("H5T_STD_U64LE");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_SCHAR)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_SCHAR))
|
||||
parallel_print("H5T_NATIVE_SCHAR");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_UCHAR)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_UCHAR))
|
||||
parallel_print("H5T_NATIVE_UCHAR");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_SHORT)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_SHORT))
|
||||
parallel_print("H5T_NATIVE_SHORT");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_USHORT)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_USHORT))
|
||||
parallel_print("H5T_NATIVE_USHORT");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_INT)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_INT))
|
||||
parallel_print("H5T_NATIVE_INT");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_UINT)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_UINT))
|
||||
parallel_print("H5T_NATIVE_UINT");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_LONG)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_LONG))
|
||||
parallel_print("H5T_NATIVE_LONG");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_ULONG)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_ULONG))
|
||||
parallel_print("H5T_NATIVE_ULONG");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_LLONG)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_LLONG))
|
||||
parallel_print("H5T_NATIVE_LLONG");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_ULLONG)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_ULLONG))
|
||||
parallel_print("H5T_NATIVE_ULLONG");
|
||||
} else {
|
||||
else
|
||||
parallel_print("undefined integer");
|
||||
}
|
||||
break;
|
||||
|
||||
case H5T_FLOAT:
|
||||
if (H5Tequal(type, H5T_IEEE_F32BE)) {
|
||||
if(H5Tequal(type, H5T_IEEE_F32BE))
|
||||
parallel_print("H5T_IEEE_F32BE");
|
||||
} else if (H5Tequal(type, H5T_IEEE_F32LE)) {
|
||||
else if(H5Tequal(type, H5T_IEEE_F32LE))
|
||||
parallel_print("H5T_IEEE_F32LE");
|
||||
} else if (H5Tequal(type, H5T_IEEE_F64BE)) {
|
||||
else if(H5Tequal(type, H5T_IEEE_F64BE))
|
||||
parallel_print("H5T_IEEE_F64BE");
|
||||
} else if (H5Tequal(type, H5T_IEEE_F64LE)) {
|
||||
else if(H5Tequal(type, H5T_IEEE_F64LE))
|
||||
parallel_print("H5T_IEEE_F64LE");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_FLOAT)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_FLOAT))
|
||||
parallel_print("H5T_NATIVE_FLOAT");
|
||||
} else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_DOUBLE))
|
||||
parallel_print("H5T_NATIVE_DOUBLE");
|
||||
#if H5_SIZEOF_LONG_DOUBLE !=0
|
||||
} else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) {
|
||||
else if(H5Tequal(type, H5T_NATIVE_LDOUBLE))
|
||||
parallel_print("H5T_NATIVE_LDOUBLE");
|
||||
#endif
|
||||
} else {
|
||||
else
|
||||
parallel_print("undefined float");
|
||||
}
|
||||
break;
|
||||
|
||||
case H5T_BITFIELD:
|
||||
if(H5Tequal(type, H5T_STD_B8BE))
|
||||
parallel_print("H5T_STD_B8BE");
|
||||
else if(H5Tequal(type, H5T_STD_B8LE))
|
||||
parallel_print("H5T_STD_B8LE");
|
||||
else if(H5Tequal(type, H5T_STD_B16BE))
|
||||
parallel_print("H5T_STD_B16BE");
|
||||
else if(H5Tequal(type, H5T_STD_B16LE))
|
||||
parallel_print("H5T_STD_B16LE");
|
||||
else if(H5Tequal(type, H5T_STD_B32BE))
|
||||
parallel_print("H5T_STD_B32BE");
|
||||
else if(H5Tequal(type, H5T_STD_B32LE))
|
||||
parallel_print("H5T_STD_B32LE");
|
||||
else if(H5Tequal(type, H5T_STD_B64BE))
|
||||
parallel_print("H5T_STD_B64BE");
|
||||
else if(H5Tequal(type, H5T_STD_B64LE))
|
||||
parallel_print("H5T_STD_B64LE");
|
||||
else
|
||||
parallel_print("undefined bitfield");
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_STRING:
|
||||
case H5T_BITFIELD:
|
||||
case H5T_OPAQUE:
|
||||
case H5T_COMPOUND:
|
||||
case H5T_REFERENCE:
|
||||
@ -189,16 +201,16 @@ diff_basename(const char *name)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (name == NULL)
|
||||
if(name == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Find the end of the base name */
|
||||
i = HDstrlen(name);
|
||||
while (i > 0 && '/' == name[i - 1])
|
||||
while(i > 0 && '/' == name[i - 1])
|
||||
--i;
|
||||
|
||||
/* Skip backward over base name */
|
||||
while (i > 0 && '/' != name[i - 1])
|
||||
while(i > 0 && '/' != name[i - 1])
|
||||
--i;
|
||||
|
||||
return(name+i);
|
||||
@ -256,7 +268,7 @@ get_type(h5trav_type_t type)
|
||||
H5_ATTR_PURE const char*
|
||||
get_sign(H5T_sign_t sign)
|
||||
{
|
||||
switch (sign)
|
||||
switch(sign)
|
||||
{
|
||||
case H5T_SGN_NONE:
|
||||
return "H5T_SGN_NONE";
|
||||
@ -291,7 +303,7 @@ get_sign(H5T_sign_t sign)
|
||||
H5_ATTR_PURE const char*
|
||||
get_class(H5T_class_t tclass)
|
||||
{
|
||||
switch (tclass) {
|
||||
switch(tclass) {
|
||||
case H5T_TIME:
|
||||
return("H5T_TIME");
|
||||
|
||||
@ -361,14 +373,11 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
|
||||
{
|
||||
herr_t ret = SUCCEED;
|
||||
|
||||
if( (*m_size1) != (*m_size2) )
|
||||
{
|
||||
if( (*m_size1) < (*m_size2) )
|
||||
{
|
||||
if((*m_size1) != (*m_size2)) {
|
||||
if((*m_size1) < (*m_size2)) {
|
||||
H5Tclose( *m_tid1 );
|
||||
|
||||
if(( (*m_tid1) = h5tools_get_native_type(f_tid2_id)) < 0)
|
||||
{
|
||||
if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) {
|
||||
ret = FAIL;
|
||||
goto out;
|
||||
}
|
||||
@ -378,8 +387,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
|
||||
else {
|
||||
H5Tclose(*m_tid2);
|
||||
|
||||
if(( (*m_tid2) = h5tools_get_native_type(f_tid1_id)) < 0)
|
||||
{
|
||||
if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) {
|
||||
ret = FAIL;
|
||||
goto out;
|
||||
}
|
||||
@ -387,7 +395,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
|
||||
*m_size2 = H5Tget_size(*m_tid2);
|
||||
} /* end else */
|
||||
} /* end if */
|
||||
HDassert( (*m_size1) == (*m_size2) );
|
||||
HDassert((*m_size1) == (*m_size2));
|
||||
|
||||
out:
|
||||
return ret;
|
||||
|
@ -1322,6 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
|
||||
case H5T_INTEGER:
|
||||
case H5T_FLOAT:
|
||||
case H5T_ENUM:
|
||||
case H5T_BITFIELD:
|
||||
block_index = block_nelmts * size;
|
||||
while(block_index > 0) {
|
||||
size_t bytes_in = 0; /* # of bytes to write */
|
||||
@ -1488,7 +1489,6 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_BITFIELD:
|
||||
case H5T_OPAQUE:
|
||||
for (block_index = 0; block_index < block_nelmts; block_index++) {
|
||||
mem = ((unsigned char*)_mem) + block_index * size;
|
||||
|
@ -586,7 +586,6 @@ H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin);
|
||||
H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin);
|
||||
H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl,
|
||||
const char *driver, char *drivername, size_t drivername_len);
|
||||
H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type);
|
||||
H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type);
|
||||
H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type);
|
||||
H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid);
|
||||
|
@ -1795,7 +1795,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
|
||||
else if (bin_form == 3)
|
||||
p_type = h5tools_get_big_endian_type(f_type);
|
||||
else
|
||||
p_type = h5tools_get_native_type(f_type);
|
||||
p_type = H5Tget_native_type(f_type, H5T_DIR_DEFAULT);
|
||||
|
||||
if (p_type < 0)
|
||||
goto done;
|
||||
@ -2957,7 +2957,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t
|
||||
hid_t n_type;
|
||||
void *buf = NULL;
|
||||
|
||||
n_type = h5tools_get_native_type(type_id);
|
||||
n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT);
|
||||
|
||||
size = H5Tget_size(n_type);
|
||||
buf = HDmalloc(size);
|
||||
@ -3785,7 +3785,7 @@ void
|
||||
h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type)
|
||||
{
|
||||
unsigned packed_bits_size = 0;
|
||||
hid_t n_type = h5tools_get_native_type(type);
|
||||
hid_t n_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
|
||||
|
||||
if(H5Tget_class(n_type) == H5T_INTEGER) {
|
||||
if(H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE)
|
||||
@ -4043,7 +4043,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info,
|
||||
unsigned int vl_data = 0; /* contains VL datatypes */
|
||||
|
||||
type = H5Aget_type(obj_id);
|
||||
p_type = h5tools_get_native_type(type);
|
||||
p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
|
||||
|
||||
ndims = H5Sget_simple_extent_dims(space, size, NULL);
|
||||
|
||||
|
@ -100,8 +100,18 @@ h5tools_get_little_endian_type(hid_t tid)
|
||||
p_type=H5Tcopy(H5T_IEEE_F64LE);
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_BITFIELD:
|
||||
if ( size == 1)
|
||||
p_type=H5Tcopy(H5T_STD_B8LE);
|
||||
else if ( size == 2)
|
||||
p_type=H5Tcopy(H5T_STD_B16LE);
|
||||
else if ( size == 4)
|
||||
p_type=H5Tcopy(H5T_STD_B32LE);
|
||||
else if ( size == 8)
|
||||
p_type=H5Tcopy(H5T_STD_B64LE);
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_OPAQUE:
|
||||
case H5T_STRING:
|
||||
case H5T_COMPOUND:
|
||||
@ -177,8 +187,18 @@ h5tools_get_big_endian_type(hid_t tid)
|
||||
p_type=H5Tcopy(H5T_IEEE_F64BE);
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_BITFIELD:
|
||||
if ( size == 1)
|
||||
p_type=H5Tcopy(H5T_STD_B8BE);
|
||||
else if ( size == 2)
|
||||
p_type=H5Tcopy(H5T_STD_B16BE);
|
||||
else if ( size == 4)
|
||||
p_type=H5Tcopy(H5T_STD_B32BE);
|
||||
else if ( size == 8)
|
||||
p_type=H5Tcopy(H5T_STD_B64BE);
|
||||
break;
|
||||
|
||||
case H5T_TIME:
|
||||
case H5T_OPAQUE:
|
||||
case H5T_STRING:
|
||||
case H5T_COMPOUND:
|
||||
|
@ -1952,7 +1952,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset,
|
||||
/* VL data special information */
|
||||
unsigned int vl_data = 0; /* contains VL datatypes */
|
||||
|
||||
p_type = h5tools_get_native_type(type);
|
||||
p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
|
||||
|
||||
/* Check if we have VL data in the dataset's datatype */
|
||||
if (h5tools_detect_vlen(p_type) == TRUE)
|
||||
|
@ -1620,7 +1620,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
|
||||
if(hexdump_g)
|
||||
p_type = H5Tcopy(type);
|
||||
else
|
||||
p_type = h5tools_get_native_type(type);
|
||||
p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
|
||||
|
||||
if(p_type >= 0) {
|
||||
/* VL data special information */
|
||||
|
@ -291,7 +291,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
|
||||
* anonymously */
|
||||
if (dt_ret->id_out < 0) {
|
||||
if (options->use_native == 1)
|
||||
dt_ret->id_out = h5tools_get_native_type(type_in);
|
||||
dt_ret->id_out = H5Tget_native_type(type_in, H5T_DIR_DEFAULT);
|
||||
else
|
||||
dt_ret->id_out = H5Tcopy(type_in);
|
||||
if (dt_ret->id_out < 0)
|
||||
@ -422,7 +422,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
|
||||
} /* end if */
|
||||
else {
|
||||
if (options->use_native == 1)
|
||||
wtype_id = h5tools_get_native_type(ftype_id);
|
||||
wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT);
|
||||
else
|
||||
wtype_id = H5Tcopy(ftype_id);
|
||||
} /* end else */
|
||||
|
@ -916,7 +916,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
/* wtype_id will have already been set if using a named dtype */
|
||||
if (!is_named) {
|
||||
if (options->use_native == 1)
|
||||
wtype_id = h5tools_get_native_type(ftype_id);
|
||||
wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT);
|
||||
else
|
||||
wtype_id = H5Tcopy(ftype_id);
|
||||
} /* end if */
|
||||
|
@ -126,8 +126,8 @@ int do_copy_refobjs(hid_t fidin,
|
||||
for(k = 0; k < rank; k++)
|
||||
nelmts *= dims[k];
|
||||
|
||||
if((mtype_id = h5tools_get_native_type(ftype_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_get_native_type failed");
|
||||
if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
|
||||
|
||||
if((msize = H5Tget_size(mtype_id)) == 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
|
||||
@ -484,8 +484,8 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
|
||||
type_class = H5Tget_class(ftype_id);
|
||||
|
||||
if((mtype_id = h5tools_get_native_type(ftype_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_get_native_type failed");
|
||||
if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
|
||||
|
||||
if((msize = H5Tget_size(mtype_id)) == 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
|
||||
|
@ -62,7 +62,8 @@
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbin4.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbinregR.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbigdims.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbitnopaque.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbitnopaque_be.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbitnopaque_le.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tboot1.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tboot2.ddl
|
||||
${HDF5_TOOLS_DIR}/testfiles/tboot2A.ddl
|
||||
@ -810,8 +811,10 @@
|
||||
tbinregR.out.err
|
||||
tbigdims.out
|
||||
tbigdims.out.err
|
||||
tbitnopaque.out
|
||||
tbitnopaque.out.err
|
||||
tbitnopaque_be.out
|
||||
tbitnopaque_be.out.err
|
||||
tbitnopaque_le.out
|
||||
tbitnopaque_le.out.err
|
||||
tboot1.out
|
||||
tboot1.out.err
|
||||
tboot2.out
|
||||
@ -1172,7 +1175,11 @@
|
||||
ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5)
|
||||
ADD_H5_TEST (tcompound_complex2 0 --enable-error-stack tcompound_complex2.h5)
|
||||
# tests for bitfields and opaque data types
|
||||
ADD_H5_TEST (tbitnopaque 0 --enable-error-stack tbitnopaque.h5)
|
||||
if (H5_WORDS_BIGENDIAN)
|
||||
ADD_H5_TEST (tbitnopaque_be 0 --enable-error-stack tbitnopaque.h5)
|
||||
else ()
|
||||
ADD_H5_TEST (tbitnopaque_le 0 --enable-error-stack tbitnopaque.h5)
|
||||
endif ()
|
||||
|
||||
#test for the nested compound type
|
||||
ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5)
|
||||
|
@ -81,7 +81,8 @@
|
||||
${HDF5_TOOLS_DIR}/testfiles/tarray6.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tarray7.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tattr.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbitfields.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbitfields_be.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tbitfields_le.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tcompound_complex.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tcompound.h5.xml
|
||||
${HDF5_TOOLS_DIR}/testfiles/tcompound2.h5.xml
|
||||
@ -221,8 +222,10 @@
|
||||
tarray7.h5.out.err
|
||||
tattr.h5.out
|
||||
tattr.h5.out.err
|
||||
tbitfields.h5.out
|
||||
tbitfields.h5.out.err
|
||||
tbitfields_be.h5.out
|
||||
tbitfields_be.h5.out.err
|
||||
tbitfields_le.h5.out
|
||||
tbitfields_le.h5.out.err
|
||||
tcompound.h5.out
|
||||
tcompound.h5.out.err
|
||||
tcompound2.h5.out
|
||||
@ -344,7 +347,11 @@
|
||||
########## test XML
|
||||
ADD_XML_H5_TEST (tall.h5 0 tall.h5)
|
||||
ADD_XML_H5_TEST (tattr.h5 0 tattr.h5)
|
||||
ADD_XML_H5_TEST (tbitfields.h5 0 tbitfields.h5)
|
||||
if (H5_WORDS_BIGENDIAN)
|
||||
ADD_XML_H5_TEST (tbitfields_be.h5 0 tbitfields.h5)
|
||||
else ()
|
||||
ADD_XML_H5_TEST (tbitfields_le.h5 0 tbitfields.h5)
|
||||
endif ()
|
||||
ADD_XML_H5_TEST (tcompound.h5 0 tcompound.h5)
|
||||
ADD_XML_H5_TEST (tcompound2.h5 0 tcompound2.h5)
|
||||
ADD_XML_H5_TEST (tdatareg.h5 0 tdatareg.h5)
|
||||
|
@ -218,7 +218,8 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tbin4.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tbinregR.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tbigdims.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tbitnopaque.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tbitnopaque_be.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tbitnopaque_le.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tboot1.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tboot2.ddl
|
||||
$SRC_H5DUMP_TESTFILES/tboot2A.ddl
|
||||
@ -1062,7 +1063,11 @@ TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5
|
||||
TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5
|
||||
TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5
|
||||
# tests for bitfields and opaque data types
|
||||
TOOLTEST tbitnopaque.ddl --enable-error-stack tbitnopaque.h5
|
||||
if test $WORDS_BIGENDIAN != "yes"; then
|
||||
TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5
|
||||
else
|
||||
TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5
|
||||
fi
|
||||
|
||||
#test for the nested compound type
|
||||
TOOLTEST tnestcomp-1.ddl --enable-error-stack tnestedcomp.h5
|
||||
|
@ -124,7 +124,8 @@ $SRC_H5DUMP_TESTFILES/tarray3.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tarray6.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tarray7.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tattr.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tbitfields_be.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tbitfields_le.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tcompound.h5.xml
|
||||
$SRC_H5DUMP_TESTFILES/tcompound2.h5.xml
|
||||
@ -299,7 +300,11 @@ COPY_TESTFILES_TO_TESTDIR
|
||||
# test XML
|
||||
TOOLTEST tall.h5.xml --xml tall.h5
|
||||
TOOLTEST tattr.h5.xml --xml tattr.h5
|
||||
TOOLTEST tbitfields.h5.xml --xml tbitfields.h5
|
||||
if test $WORDS_BIGENDIAN != "yes"; then
|
||||
TOOLTEST tbitfields_le.h5.xml --xml tbitfields.h5
|
||||
else
|
||||
TOOLTEST tbitfields_be.h5.xml --xml tbitfields.h5
|
||||
fi
|
||||
TOOLTEST tcompound.h5.xml --xml tcompound.h5
|
||||
TOOLTEST tcompound2.h5.xml --xml tcompound2.h5
|
||||
TOOLTEST tdatareg.h5.xml --xml tdatareg.h5
|
||||
|
@ -86,8 +86,7 @@ int main(void)
|
||||
H5Tinsert(cmp, "Not Ok", sizeof(fok) + sizeof(string5), array_dt);
|
||||
H5Tclose(array_dt);
|
||||
|
||||
fix = h5tools_get_native_type(cmp);
|
||||
|
||||
fix = H5Tget_native_type(cmp, H5T_DIR_DEFAULT);
|
||||
cmp1 = H5Tcreate(H5T_COMPOUND, sizeof(fok));
|
||||
|
||||
cdim[0] = sizeof(fok) / sizeof(float);
|
||||
@ -208,35 +207,3 @@ out:
|
||||
return result;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: h5tools_get_native_type
|
||||
*
|
||||
* Purpose: Wrapper around H5Tget_native_type() to work around
|
||||
* Problems with bitfields.
|
||||
*
|
||||
* Return: Success: datatype ID
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, October 5, 2004
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hid_t
|
||||
h5tools_get_native_type(hid_t type)
|
||||
{
|
||||
hid_t p_type;
|
||||
H5T_class_t type_class;
|
||||
|
||||
type_class = H5Tget_class(type);
|
||||
if(type_class==H5T_BITFIELD)
|
||||
p_type=H5Tcopy(type);
|
||||
else
|
||||
p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT);
|
||||
|
||||
return(p_type);
|
||||
}
|
||||
|
||||
|
103
tools/testfiles/tbitfields_be.h5.xml
Normal file
103
tools/testfiles/tbitfields_be.h5.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
|
||||
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
|
||||
<hdf5:Group Name="typetests" OBJ-XID="xid_1344" H5Path="/typetests" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:Dataset Name="bitfield_1" OBJ-XID="xid_1720" H5Path= "/typetests/bitfield_1" Parents="xid_1344" H5ParentPaths="/typetests">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
</hdf5:StorageLayout>
|
||||
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
|
||||
<hdf5:FillValue>
|
||||
<hdf5:NoFill/>
|
||||
</hdf5:FillValue>
|
||||
</hdf5:FillValueInfo>
|
||||
<hdf5:Dataspace>
|
||||
<hdf5:SimpleDataspace Ndims="1">
|
||||
<hdf5:Dimension DimSize="32" MaxDimSize="32"/>
|
||||
</hdf5:SimpleDataspace>
|
||||
</hdf5:Dataspace>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:BitfieldType ByteOrder="LE" Size="1"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
<hdf5:Data>
|
||||
<hdf5:DataFromFile>
|
||||
0xff
|
||||
0xfe
|
||||
0xfd
|
||||
0xfc
|
||||
0xfb
|
||||
0xfa
|
||||
0xf9
|
||||
0xf8
|
||||
0xf7
|
||||
0xf6
|
||||
0xf5
|
||||
0xf4
|
||||
0xf3
|
||||
0xf2
|
||||
0xf1
|
||||
0xf0
|
||||
0xef
|
||||
0xee
|
||||
0xed
|
||||
0xec
|
||||
0xeb
|
||||
0xea
|
||||
0xe9
|
||||
0xe8
|
||||
0xe7
|
||||
0xe6
|
||||
0xe5
|
||||
0xe4
|
||||
0xe3
|
||||
0xe2
|
||||
0xe1
|
||||
0xe0
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Dataset Name="bitfield_2" OBJ-XID="xid_2352" H5Path= "/typetests/bitfield_2" Parents="xid_1344" H5ParentPaths="/typetests">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
</hdf5:StorageLayout>
|
||||
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
|
||||
<hdf5:FillValue>
|
||||
<hdf5:NoFill/>
|
||||
</hdf5:FillValue>
|
||||
</hdf5:FillValueInfo>
|
||||
<hdf5:Dataspace>
|
||||
<hdf5:SimpleDataspace Ndims="1">
|
||||
<hdf5:Dimension DimSize="16" MaxDimSize="16"/>
|
||||
</hdf5:SimpleDataspace>
|
||||
</hdf5:Dataspace>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:BitfieldType ByteOrder="LE" Size="2"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
<hdf5:Data>
|
||||
<hdf5:DataFromFile>
|
||||
fe:ff
|
||||
fc:fd
|
||||
fa:fb
|
||||
f8:f9
|
||||
f6:f7
|
||||
f4:f5
|
||||
f2:f3
|
||||
f0:f1
|
||||
ee:ef
|
||||
ec:ed
|
||||
ea:eb
|
||||
e8:e9
|
||||
e6:e7
|
||||
e4:e5
|
||||
e2:e3
|
||||
e0:e1
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
293
tools/testfiles/tbitnopaque_be.ddl
Normal file
293
tools/testfiles/tbitnopaque_be.ddl
Normal file
@ -0,0 +1,293 @@
|
||||
HDF5 "tbitnopaque.h5" {
|
||||
GROUP "/" {
|
||||
GROUP "bittypetests" {
|
||||
DATASET "bitfield_1" {
|
||||
DATATYPE H5T_STD_B8LE
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6,
|
||||
(10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec,
|
||||
(20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2,
|
||||
(30): 0xe1, 0xe0
|
||||
}
|
||||
}
|
||||
DATASET "bitfield_2" {
|
||||
DATATYPE H5T_STD_B16LE
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): ff:ff, ff:ef, ff:df, ff:cf, ff:bf, ff:af, ff:9f, ff:8f, ff:7f,
|
||||
(9): ff:6f, ff:5f, ff:4f, ff:3f, ff:2f, ff:1f, ff:0f, fe:ff, fe:ef,
|
||||
(18): fe:df, fe:cf, fe:bf, fe:af, fe:9f, fe:8f, fe:7f, fe:6f, fe:5f,
|
||||
(27): fe:4f, fe:3f, fe:2f, fe:1f, fe:0f
|
||||
}
|
||||
}
|
||||
DATASET "bitfield_3" {
|
||||
DATATYPE H5T_STD_B32LE
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): ff:ff:ff:ff, ff:ff:ff:df, ff:ff:ff:bf, ff:ff:ff:9f,
|
||||
(4): ff:ff:ff:7f, ff:ff:ff:5f, ff:ff:ff:3f, ff:ff:ff:1f,
|
||||
(8): ff:ff:fe:ff, ff:ff:fe:df, ff:ff:fe:bf, ff:ff:fe:9f,
|
||||
(12): ff:ff:fe:7f, ff:ff:fe:5f, ff:ff:fe:3f, ff:ff:fe:1f,
|
||||
(16): ff:ff:fd:ff, ff:ff:fd:df, ff:ff:fd:bf, ff:ff:fd:9f,
|
||||
(20): ff:ff:fd:7f, ff:ff:fd:5f, ff:ff:fd:3f, ff:ff:fd:1f,
|
||||
(24): ff:ff:fc:ff, ff:ff:fc:df, ff:ff:fc:bf, ff:ff:fc:9f,
|
||||
(28): ff:ff:fc:7f, ff:ff:fc:5f, ff:ff:fc:3f, ff:ff:fc:1f
|
||||
}
|
||||
}
|
||||
DATASET "bitfield_4" {
|
||||
DATATYPE H5T_STD_B64LE
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): ff:ff:ff:ff:ff:ff:ff:ff, ff:ff:ff:ff:ff:ff:ff:bf,
|
||||
(2): ff:ff:ff:ff:ff:ff:ff:7f, ff:ff:ff:ff:ff:ff:ff:3f,
|
||||
(4): ff:ff:ff:ff:ff:ff:fe:ff, ff:ff:ff:ff:ff:ff:fe:bf,
|
||||
(6): ff:ff:ff:ff:ff:ff:fe:7f, ff:ff:ff:ff:ff:ff:fe:3f,
|
||||
(8): ff:ff:ff:ff:ff:ff:fd:ff, ff:ff:ff:ff:ff:ff:fd:bf,
|
||||
(10): ff:ff:ff:ff:ff:ff:fd:7f, ff:ff:ff:ff:ff:ff:fd:3f,
|
||||
(12): ff:ff:ff:ff:ff:ff:fc:ff, ff:ff:ff:ff:ff:ff:fc:bf,
|
||||
(14): ff:ff:ff:ff:ff:ff:fc:7f, ff:ff:ff:ff:ff:ff:fc:3f,
|
||||
(16): ff:ff:ff:ff:ff:ff:fb:ff, ff:ff:ff:ff:ff:ff:fb:bf,
|
||||
(18): ff:ff:ff:ff:ff:ff:fb:7f, ff:ff:ff:ff:ff:ff:fb:3f,
|
||||
(20): ff:ff:ff:ff:ff:ff:fa:ff, ff:ff:ff:ff:ff:ff:fa:bf,
|
||||
(22): ff:ff:ff:ff:ff:ff:fa:7f, ff:ff:ff:ff:ff:ff:fa:3f,
|
||||
(24): ff:ff:ff:ff:ff:ff:f9:ff, ff:ff:ff:ff:ff:ff:f9:bf,
|
||||
(26): ff:ff:ff:ff:ff:ff:f9:7f, ff:ff:ff:ff:ff:ff:f9:3f,
|
||||
(28): ff:ff:ff:ff:ff:ff:f8:ff, ff:ff:ff:ff:ff:ff:f8:bf,
|
||||
(30): ff:ff:ff:ff:ff:ff:f8:7f, ff:ff:ff:ff:ff:ff:f8:3f
|
||||
}
|
||||
}
|
||||
}
|
||||
GROUP "cmpdtypetests" {
|
||||
DATASET "compound_1" {
|
||||
DATATYPE H5T_COMPOUND {
|
||||
H5T_STD_B8LE "a";
|
||||
H5T_STD_B16LE "b";
|
||||
H5T_STD_B32LE "c";
|
||||
H5T_STD_B64LE "d";
|
||||
}
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): {
|
||||
0xff,
|
||||
ff:ff,
|
||||
ff:ff:ff:ff,
|
||||
ff:ff:ff:ff:ff:ff:ff:ff
|
||||
},
|
||||
(1): {
|
||||
0xfe,
|
||||
ff:ef,
|
||||
ff:ff:ff:df,
|
||||
ff:ff:ff:ff:ff:ff:ff:bf
|
||||
},
|
||||
(2): {
|
||||
0xfd,
|
||||
ff:df,
|
||||
ff:ff:ff:bf,
|
||||
ff:ff:ff:ff:ff:ff:ff:7f
|
||||
},
|
||||
(3): {
|
||||
0xfc,
|
||||
ff:cf,
|
||||
ff:ff:ff:9f,
|
||||
ff:ff:ff:ff:ff:ff:ff:3f
|
||||
},
|
||||
(4): {
|
||||
0xfb,
|
||||
ff:bf,
|
||||
ff:ff:ff:7f,
|
||||
ff:ff:ff:ff:ff:ff:fe:ff
|
||||
},
|
||||
(5): {
|
||||
0xfa,
|
||||
ff:af,
|
||||
ff:ff:ff:5f,
|
||||
ff:ff:ff:ff:ff:ff:fe:bf
|
||||
},
|
||||
(6): {
|
||||
0xf9,
|
||||
ff:9f,
|
||||
ff:ff:ff:3f,
|
||||
ff:ff:ff:ff:ff:ff:fe:7f
|
||||
},
|
||||
(7): {
|
||||
0xf8,
|
||||
ff:8f,
|
||||
ff:ff:ff:1f,
|
||||
ff:ff:ff:ff:ff:ff:fe:3f
|
||||
},
|
||||
(8): {
|
||||
0xf7,
|
||||
ff:7f,
|
||||
ff:ff:fe:ff,
|
||||
ff:ff:ff:ff:ff:ff:fd:ff
|
||||
},
|
||||
(9): {
|
||||
0xf6,
|
||||
ff:6f,
|
||||
ff:ff:fe:df,
|
||||
ff:ff:ff:ff:ff:ff:fd:bf
|
||||
},
|
||||
(10): {
|
||||
0xf5,
|
||||
ff:5f,
|
||||
ff:ff:fe:bf,
|
||||
ff:ff:ff:ff:ff:ff:fd:7f
|
||||
},
|
||||
(11): {
|
||||
0xf4,
|
||||
ff:4f,
|
||||
ff:ff:fe:9f,
|
||||
ff:ff:ff:ff:ff:ff:fd:3f
|
||||
},
|
||||
(12): {
|
||||
0xf3,
|
||||
ff:3f,
|
||||
ff:ff:fe:7f,
|
||||
ff:ff:ff:ff:ff:ff:fc:ff
|
||||
},
|
||||
(13): {
|
||||
0xf2,
|
||||
ff:2f,
|
||||
ff:ff:fe:5f,
|
||||
ff:ff:ff:ff:ff:ff:fc:bf
|
||||
},
|
||||
(14): {
|
||||
0xf1,
|
||||
ff:1f,
|
||||
ff:ff:fe:3f,
|
||||
ff:ff:ff:ff:ff:ff:fc:7f
|
||||
},
|
||||
(15): {
|
||||
0xf0,
|
||||
ff:0f,
|
||||
ff:ff:fe:1f,
|
||||
ff:ff:ff:ff:ff:ff:fc:3f
|
||||
},
|
||||
(16): {
|
||||
0xef,
|
||||
fe:ff,
|
||||
ff:ff:fd:ff,
|
||||
ff:ff:ff:ff:ff:ff:fb:ff
|
||||
},
|
||||
(17): {
|
||||
0xee,
|
||||
fe:ef,
|
||||
ff:ff:fd:df,
|
||||
ff:ff:ff:ff:ff:ff:fb:bf
|
||||
},
|
||||
(18): {
|
||||
0xed,
|
||||
fe:df,
|
||||
ff:ff:fd:bf,
|
||||
ff:ff:ff:ff:ff:ff:fb:7f
|
||||
},
|
||||
(19): {
|
||||
0xec,
|
||||
fe:cf,
|
||||
ff:ff:fd:9f,
|
||||
ff:ff:ff:ff:ff:ff:fb:3f
|
||||
},
|
||||
(20): {
|
||||
0xeb,
|
||||
fe:bf,
|
||||
ff:ff:fd:7f,
|
||||
ff:ff:ff:ff:ff:ff:fa:ff
|
||||
},
|
||||
(21): {
|
||||
0xea,
|
||||
fe:af,
|
||||
ff:ff:fd:5f,
|
||||
ff:ff:ff:ff:ff:ff:fa:bf
|
||||
},
|
||||
(22): {
|
||||
0xe9,
|
||||
fe:9f,
|
||||
ff:ff:fd:3f,
|
||||
ff:ff:ff:ff:ff:ff:fa:7f
|
||||
},
|
||||
(23): {
|
||||
0xe8,
|
||||
fe:8f,
|
||||
ff:ff:fd:1f,
|
||||
ff:ff:ff:ff:ff:ff:fa:3f
|
||||
},
|
||||
(24): {
|
||||
0xe7,
|
||||
fe:7f,
|
||||
ff:ff:fc:ff,
|
||||
ff:ff:ff:ff:ff:ff:f9:ff
|
||||
},
|
||||
(25): {
|
||||
0xe6,
|
||||
fe:6f,
|
||||
ff:ff:fc:df,
|
||||
ff:ff:ff:ff:ff:ff:f9:bf
|
||||
},
|
||||
(26): {
|
||||
0xe5,
|
||||
fe:5f,
|
||||
ff:ff:fc:bf,
|
||||
ff:ff:ff:ff:ff:ff:f9:7f
|
||||
},
|
||||
(27): {
|
||||
0xe4,
|
||||
fe:4f,
|
||||
ff:ff:fc:9f,
|
||||
ff:ff:ff:ff:ff:ff:f9:3f
|
||||
},
|
||||
(28): {
|
||||
0xe3,
|
||||
fe:3f,
|
||||
ff:ff:fc:7f,
|
||||
ff:ff:ff:ff:ff:ff:f8:ff
|
||||
},
|
||||
(29): {
|
||||
0xe2,
|
||||
fe:2f,
|
||||
ff:ff:fc:5f,
|
||||
ff:ff:ff:ff:ff:ff:f8:bf
|
||||
},
|
||||
(30): {
|
||||
0xe1,
|
||||
fe:1f,
|
||||
ff:ff:fc:3f,
|
||||
ff:ff:ff:ff:ff:ff:f8:7f
|
||||
},
|
||||
(31): {
|
||||
0xe0,
|
||||
fe:0f,
|
||||
ff:ff:fc:1f,
|
||||
ff:ff:ff:ff:ff:ff:f8:3f
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GROUP "opaquetypetests" {
|
||||
DATASET "opaque_1" {
|
||||
DATATYPE H5T_OPAQUE {
|
||||
OPAQUE_TAG "1-byte opaque type";
|
||||
}
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6,
|
||||
(10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec,
|
||||
(20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2,
|
||||
(30): 0xe1, 0xe0
|
||||
}
|
||||
}
|
||||
DATASET "opaque_2" {
|
||||
DATATYPE H5T_OPAQUE {
|
||||
OPAQUE_TAG "2-byte opaque type";
|
||||
}
|
||||
DATASPACE SIMPLE { ( 32 ) / ( 32 ) }
|
||||
DATA {
|
||||
(0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff,
|
||||
(9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe,
|
||||
(18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe,
|
||||
(27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user