Ejemplo n.º 1
0
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ecreate_stack
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Ecreate_1stack
    (JNIEnv *env, jclass cls)
{
    hid_t ret_val = -1;

    ret_val = H5Ecreate_stack();
    if (ret_val < 0)
        h5libraryError(env);

    return (jlong)ret_val;
} /* end Java_hdf_hdf5lib_H5_H5Ecreate_1stack */
Ejemplo n.º 2
0
/*-------------------------------------------------------------------------
 * Function:	test_create
 *
 * Purpose:	Test creating an empty error stack
 *
 * Return:	Success:	0
 *		Failure:	-1
 *
 * Programmer:	Quincey Koziol
 *		November 1, 2007
 *
 *-------------------------------------------------------------------------
 */
static herr_t
test_create(void)
{
    const char *err_func = "test_create";      /* Function name for pushing error */
    const char *err_msg = "Error message";     /* Error message for pushing error */
    int         err_num;        /* Number of errors on stack */
    hid_t       estack_id;      /* Error stack ID */

    /* Create an empty error stack */
    if((estack_id = H5Ecreate_stack()) < 0) TEST_ERROR

    /* Check the number of errors on stack */
    err_num = H5Eget_num(estack_id);
    if(err_num != 0) TEST_ERROR

    /* Push an error with a long description */
    if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, err_msg) < 0) TEST_ERROR;

    /* Check the number of errors on stack */
    err_num = H5Eget_num(estack_id);
    if(err_num != 1) TEST_ERROR

    /* Clear the error stack */
    if(H5Eclear2(estack_id) < 0) TEST_ERROR

    /* Check the number of errors on stack */
    err_num = H5Eget_num(estack_id);
    if(err_num != 0) TEST_ERROR

    /* Close error stack */
    if(H5Eclose_stack(estack_id) < 0) TEST_ERROR

    return(0);

error:
    return(-1);
} /* end test_create() */