if(obj1_type != obj2_type) TEST_ERROR
                /* Open referenced objects */
                if((obj1_id = H5Rdereference2(parent1, H5P_DEFAULT, H5R_OBJECT, ref_buf1)) < 0) TEST_ERROR
                if((obj2_id = H5Rdereference2(parent2, H5P_DEFAULT, H5R_OBJECT, ref_buf2)) < 0) TEST_ERROR
                /* break the infinite loop when the ref_object points to itself */
                if(obj_owner > 0) {
                    H5O_info_t oinfo1, oinfo2;
                    if(H5Oget_info2(obj_owner, &oinfo1, 0) < 0) TEST_ERROR
                    if(H5Oget_info2(obj1_id, &oinfo2, 0) < 0) TEST_ERROR
                    if(H5Oget_info2(obj_owner, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR
                    if(H5Oget_info2(obj1_id, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
                    if(H5F_addr_eq(oinfo1.addr, oinfo2.addr)) {
                        if(H5Oclose(obj1_id) < 0) TEST_ERROR
                        if(H5Oclose(obj2_id) < 0) TEST_ERROR
                        return TRUE;
                    }
                }
                /* Check for types of objects handled */
                switch(obj1_type) {
                    case H5O_TYPE_DATASET:
Show more
                if(obj1_type != obj2_type) TEST_ERROR
                /* Open referenced objects */
                if((obj1_id = H5Rdereference2(parent1, H5P_DEFAULT, H5R_DATASET_REGION, ref_buf1)) < 0) TEST_ERROR
                if((obj2_id = H5Rdereference2(parent2, H5P_DEFAULT, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR
                /* break the infinite loop when the ref_object points to itself */
                if(obj_owner > 0) {
                    H5O_info_t oinfo1, oinfo2;
                    if(H5Oget_info2(obj_owner, &oinfo1, 0) < 0) TEST_ERROR
                    if(H5Oget_info2(obj1_id, &oinfo2, 0) < 0) TEST_ERROR
                    if(H5Oget_info2(obj_owner, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR
                    if(H5Oget_info2(obj1_id, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
                    if(H5F_addr_eq(oinfo1.addr, oinfo2.addr)) {
                        if(H5Oclose(obj1_id) < 0) TEST_ERROR
                        if(H5Oclose(obj2_id) < 0) TEST_ERROR
                        return TRUE;
                    }
                }
                /* Check for types of objects handled */
                switch(obj1_type) {
                    case H5O_TYPE_DATASET:
Show more
            if(H5Lget_info(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
            if(H5Lget_info(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR
            if(linfo.type != linfo2.type) TEST_ERROR
            /* Extra checks for "real" objects */
            if(linfo.type == H5L_TYPE_HARD) {
                hid_t oid, oid2;                /* IDs of objects within group */
                H5O_info_t oinfo, oinfo2;       /* Object info */
                /* Compare some pieces of the object info */
                if(H5Oget_info_by_name2(gid, objname, &oinfo, H5O_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
                if(H5Oget_info_by_name2(gid2, objname2, &oinfo2, H5O_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
                if(H5Oget_info_by_name2(gid, objname, &oinfo, H5O_INFO_BASIC|H5O_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
                if(H5Oget_info_by_name2(gid2, objname2, &oinfo2, H5O_INFO_BASIC|H5O_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
                if(oinfo.type != oinfo2.type) TEST_ERROR
                if(oinfo.rc != oinfo2.rc) TEST_ERROR
                /* If NULL messages are preserved, the number of messages
                 * should be the same in the destination.
                 * Otherwise, it should simply be true that the number
                 * of messages hasn't increased.
                 */
                 if(H5O_COPY_PRESERVE_NULL_FLAG & copy_flags) {
Show more
    /* open the destination attribute */
    if((aid = H5Aopen(tid2, "attr_self", H5P_DEFAULT)) < 0) TEST_ERROR
    /* open the destination attribute's datatype */
    if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
    /* verify that the attribute's datatype is committed */
    if(H5Tcommitted(tid) != TRUE) TEST_ERROR
    /* verify that the addresses of the datatypes are the same */
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid2, &oinfo2, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(H5Oget_info2(tid2, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.fileno != oinfo2.fileno || oinfo.addr != oinfo2.addr)
        FAIL_PUTS_ERROR("destination attribute does not use the same committed datatype")
    /* Verify that there are only 2 links int he destination root group */
    if(H5Gget_info(fid_dst, &ginfo) < 0)
    if(ginfo.nlinks != 2)
        FAIL_PUTS_ERROR("unexpected number of links in destination root group")
    /* close the attribute */
    if(H5Aclose(aid) < 0) TEST_ERROR
Show more
    if(H5Ocopy(fid_src2, "/", fid_dst, NAME_GROUP_TOP2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open SRC1 committed dtype, get address */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open SRC1 dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open SRC2 committed dtype, check address */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open SRC2 dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Now copy only the datasets to the destination file, and verify the committed
     * datatypes are merged
Show more
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open SRC1 dset dtype, get address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open SRC2 dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the SRC files */
    if(H5Fclose(fid_src1) < 0) TEST_ERROR
    if(H5Fclose(fid_src2) < 0) TEST_ERROR
Show more
    if(H5Ocopy(fid, NAME_GROUP_TOP2, fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid) < 0) TEST_ERROR
        if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open group 1 source committed dtype, get address */
    if((tid = H5Topen2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open group 1 source dset dtype, check address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open group 1 committed dtype, check address */
    if((tid = H5Topen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open group 1 dset dtype, check address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open group 2 source committed dtype, get address and make sure it is
     * different from group 1 source committed dtype */
    if((tid = H5Topen2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr == exp_addr) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open group 2 source dset dtype, check address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open group 2 committed dtype, check address */
    if((tid = H5Topen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open group 2 dset dtype, check address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /*
     * Now copy only the datasets to the destination group, and verify the committed
     * datatypes are merged as expected
     */
    /* Create destination group */
    if((gid = H5Gcreate2(fid, NAME_GROUP_TOP4, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
Show more
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid) < 0) TEST_ERROR
        if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open group 1 source dset dtype, get address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open group 1 dset dtype, check address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open group 2 source dset dtype, get address and make sure it is
     * different from group 1 source dset dtype */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr == exp_addr) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open group 2 dset dtype, check address */
    if((did = H5Dopen2(fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close file */
    if(H5Fclose(fid) < 0) TEST_ERROR
    /* close property list */
    if(H5Pclose(ocpypl_id) < 0) TEST_ERROR
Show more
    if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "b", get address */
    if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Now free suggestions, copy dataset without any suggestions, and verify
     * that it uses datatype "a" in the destination file
Show more
    if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "a", get address */
    if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open dset 2 dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open committed dtype "b", get address */
    if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the SRC file */
    if(H5Fclose(fid_src) < 0) TEST_ERROR
Show more
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open attribute dtype, get address */
    if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_TOP, "attr", H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Aclose(aid) < 0) TEST_ERROR
    /* Open dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the SRC file */
    if(H5Fclose(fid_src) < 0) TEST_ERROR
Show more
    if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR
    if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR
    /*
     * Test 1 : copy / in SRC file to DST file
     */
    if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    /* get address of committed datatype at root group */
    if((tid = H5Topen2(fid_dst, SRC_ROOT_GROUP "/" ROOT_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr_int = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype at /g0 */
    if((tid = H5Topen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" GROUP_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr_short = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* verify the datatype of first dataset is not committed */
    if((did = H5Dopen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" SRC_DSET1, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Tcommitted(tid)) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for second dataset */
    if((did = H5Dopen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_short) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for third dataset */
    if((did = H5Dopen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" SRC_NDT_DSET3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_int) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /*
     * Test 2: copy /g0 in SRC to DST
     */
    if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    /* get address of committed datatype at /g0 */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP "/" GROUP_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_short) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* verify the datatype of first dataset is not committed */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" SRC_DSET1, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Tcommitted(tid)) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for second dataset */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_short) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for third dataset */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" SRC_NDT_DSET3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_int) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /*
     * Test 3: copy datsets in /g0 at SRC to DST group /uncopied
     */
    if(H5Ocopy(fid_src, NAME_GROUP_TOP "/" SRC_DSET1, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_DSET1, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(H5Ocopy(fid_src, NAME_GROUP_TOP "/" SRC_NDT_DSET2, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(H5Ocopy(fid_src, NAME_GROUP_TOP "/" SRC_NDT_DSET3, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET3, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    /* Open attribute with anon ndt (short), get address */
    if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_UNCOPIED, DST_ATTR_ANON_SHORT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_short) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Aclose(aid) < 0) TEST_ERROR
    /* Open attribute with anon ndt (int), get address */
    if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_UNCOPIED, DST_ATTR_ANON_INT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_int) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Aclose(aid) < 0) TEST_ERROR
    /* verify the datatype of first dataset is not committed */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_DSET1, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Tcommitted(tid)) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for second dataset */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_short) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for third dataset */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr_int) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* close the SRC file */
    if(H5Fclose(fid_src) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
Show more
    if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR
    /* copy everything in SRC to DST */
    if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    /*
     * Verification
     */
    /* get address of committed datatype: /src_root/src_ndt_double */
    if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype: /dst_ndt_double */
    if((tid = H5Topen2(fid_dst, "/" DST_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype: /src_root/src_ndt_float */
    if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_FLOAT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype: /dst_ndt_float */
    if((tid = H5Topen2(fid_dst, "/" DST_NDT_FLOAT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype: /src_root/src_ndt_int */
    if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype: /dst_ndt_int */
    if((tid = H5Topen2(fid_dst, "/" DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* get address of committed datatype: /src_root/src_ndt_short */
    if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* open attribute; get its dtype; get dtype's address: /src_root/src_ndt_double/dst_attr */
    if((aid = H5Aopen_by_name(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, DST_ATTR, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Aclose(aid) < 0) TEST_ERROR
    /* close the files */
    if(H5Fclose(fid_src) < 0) TEST_ERROR
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the object copy property list */
    if(H5Pclose(ocpypl_id) < 0) TEST_ERROR
Show more
    if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* open committed dtype "/dst_ndt_int", get its address */
    if((tid = H5Topen2(fid_dst, DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* check address of "/uncopied/src_ndt_int" */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Test 2
     */
    /* open destination file */
Show more
    if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* open committed dtype "/uncopied/src_ndt_int", get its address */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* check address of "/src_ndt_int" */
    if((tid = H5Topen2(fid_dst, SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Test 3
     */
    /* open destination file */
Show more
    if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "/uncopied/src_ndt_int", get its address */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* check address of "/src_ndt_int2" */
    if((tid = H5Topen2(fid_dst, SRC_NDT_INT2, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Test 4
     */
    /* open destination file */
Show more
    if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "/dst_dt_int", get its address */
    if((tid = H5Topen2(fid_dst, DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* check address of "/uncopied/src_ndt_int2" */
    if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT2, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the SRC file */
    if(H5Fclose(fid_src) < 0) TEST_ERROR
    /* close property list */
Show more
    if(H5Ocopy(fid_src, SRC_NDT_DSET, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "/dst_ndt_int", get its address */
    if((tid = H5Topen2(fid_dst, DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* check address of datatype for the copied dataset: "/uncopied/src_ndt_dset"  */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Test 2
     */
Show more
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype dataset "/uncopied/src_ndt_dset", get its datatype address */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for the copied dataset: "/src_ndt_dset" */
    if((did = H5Dopen2(fid_dst, SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Test 3
     */
Show more
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* open the copied dataset: /uncopied/src_ndt_dset", get its address  */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for the copied dataset: "/src_ndt_dset2" */
    if((did = H5Dopen2(fid_dst, SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Test 4
     */
Show more
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* open the copied dataset: "/src_ndt_dset", get its datatype address */
    if((did = H5Dopen2(fid_dst, SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* check address of datatype for the copied dataset: /uncopied/src_ndt_dset2 */
    if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* close the DST file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the SRC file */
    if(H5Fclose(fid_src) < 0) TEST_ERROR
Show more
    if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "b", get address */
    if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open dset dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Set callback to continue the search
     */
Show more
    if(cb_udata.called != 1) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "a", get address */
    if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open copied dataset and its dtype, check address */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr != exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Stop the search, default action is to create an anonymous committed datatype
Show more
    if(cb_udata.called != 1) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "a", get address */
    if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open the copied dataset and get its dtype, addresses should not be equal */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr == exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open committed dtype "b", get address */
    if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open the copied dataset and get its dtype, addresses should not be equal */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr == exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /*
     * Stop the search, default action is to create an anonymous committed datatype.
Show more
    if(cb_udata.called != 1) TEST_ERROR
    if(reopen) {
        /* Reopen file */
        if(H5Fclose(fid_dst) < 0) TEST_ERROR
        if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
    } /* end if */
    /* Open committed dtype "a", get address */
    if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open the copied dataset and get its dtype, addresses should not be equal */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr == exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Open committed dtype "b", get address */
    if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    exp_addr = oinfo.addr;
    if(H5Tclose(tid) < 0) TEST_ERROR
    /* Open the copied dataset and get its dtype, addresses should not be equal */
    if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
    if((tid = H5Dget_type(did)) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, 0) < 0) TEST_ERROR
    if(H5Oget_info2(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
    if(oinfo.addr == exp_addr) TEST_ERROR
    if(H5Tclose(tid) < 0) TEST_ERROR
    if(H5Dclose(did) < 0) TEST_ERROR
    /* Close destination file */
    if(H5Fclose(fid_dst) < 0) TEST_ERROR
    /* close the SRC file */
    if(H5Fclose(fid_src) < 0) TEST_ERROR