summaryrefslogtreecommitdiffstats
path: root/src/H5EAtest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-05-26 23:22:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-05-26 23:22:27 (GMT)
commite5d055581558413f5257edf27fbfab5650c02896 (patch)
treeda634d40ec673839610cfec23d13fb3c83353eab /src/H5EAtest.c
parente3d0563a73d203b23df569cd4d0ce4e0596c52f2 (diff)
downloadhdf5-e5d055581558413f5257edf27fbfab5650c02896.zip
hdf5-e5d055581558413f5257edf27fbfab5650c02896.tar.gz
hdf5-e5d055581558413f5257edf27fbfab5650c02896.tar.bz2
[svn-r16983] Description:
Bring r16977:16982 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) (h5committest not required on this branch)
Diffstat (limited to 'src/H5EAtest.c')
-rw-r--r--src/H5EAtest.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index fa0a62f..646b674 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -58,6 +58,7 @@
/* Callback context */
typedef struct H5EA__test_ctx_t {
uint32_t bogus; /* Placeholder field to verify that context is working */
+ H5EA__ctx_cb_t *cb; /* Pointer to context's callback action */
} H5EA__test_ctx_t;
@@ -128,10 +129,11 @@ H5FL_DEFINE_STATIC(H5EA__test_ctx_t);
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
-H5EA__test_crt_context(void UNUSED *udata))
+H5EA__test_crt_context(void *_udata))
/* Local variables */
H5EA__test_ctx_t *ctx; /* Context for callbacks */
+ H5EA__ctx_cb_t *udata = (H5EA__ctx_cb_t *)_udata; /* User data for context */
/* Sanity checks */
@@ -141,6 +143,7 @@ H5EA__test_crt_context(void UNUSED *udata))
/* Initialize the context */
ctx->bogus = H5EA__TEST_BOGUS_VAL;
+ ctx->cb = udata;
/* Set return value */
ret_value = ctx;
@@ -221,8 +224,8 @@ END_FUNC(STATIC) /* end H5EA__test_fill() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR,
-herr_t, SUCCEED, -,
+BEGIN_FUNC(STATIC, ERR,
+herr_t, SUCCEED, FAIL,
H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx))
/* Local variables */
@@ -235,6 +238,12 @@ H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx))
HDassert(nelmts);
HDassert(H5EA__TEST_BOGUS_VAL == ctx->bogus);
+ /* Check for callback action */
+ if(ctx->cb) {
+ if((*ctx->cb->encode)(elmt, nelmts, ctx->cb->udata) < 0)
+ H5E_THROW(H5E_BADVALUE, "extensible array testing callback action failed")
+ } /* end if */
+
/* Encode native elements into raw elements */
while(nelmts) {
/* Encode element */
@@ -248,6 +257,8 @@ H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx))
nelmts--;
} /* end while */
+CATCH
+
END_FUNC(STATIC) /* end H5EA__test_encode() */