From 6a2044cb01ad8a5e76d2354cd4925bcaac122215 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 7 Jul 2009 21:39:43 +0000 Subject: [PATCH] added verifyContextRundownFlush --- src/ca/acctst.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/ca/acctst.c b/src/ca/acctst.c index da009c5e0..9fdeebf95 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -2842,6 +2842,67 @@ void verifyName ( SEVCHK ( status, NULL ); } +void verifyContextRundownFlush ( const char * pName, unsigned interestLevel ) +{ + unsigned i; + + showProgressBegin ( "verifyContextRundownFlush", interestLevel ); + + for ( i=0u; i < 1000; i++ ) { + const dbr_double_t stim = i; + + { + chid chan; + int status; + status = ca_context_create ( ca_disable_preemptive_callback ); + SEVCHK ( status, "context create failed" ); + + status = ca_create_channel ( pName, 0, 0, 0, & chan ); + SEVCHK ( status, NULL ); + + status = ca_pend_io( timeoutToPendIO ); + SEVCHK ( status, "channel connect failed" ); + + status = ca_put ( DBR_DOUBLE, chan, & stim ); + SEVCHK ( status, "channel put failed" ); + + status = ca_clear_channel ( chan ); + SEVCHK ( status, NULL ); + + ca_context_destroy (); + } + + { + chid chan; + int status; + dbr_double_t resp; + status = ca_context_create ( ca_disable_preemptive_callback ); + SEVCHK ( status, "context create failed" ); + + status = ca_create_channel ( pName, 0, 0, 0, & chan ); + SEVCHK ( status, NULL ); + + status = ca_pend_io( timeoutToPendIO ); + SEVCHK ( status, "channel connect failed" ); + + status = ca_get ( DBR_DOUBLE, chan, & resp ); + SEVCHK ( status, "channel get failed" ); + + status = ca_pend_io ( timeoutToPendIO ); + SEVCHK ( status, "get, pend io failed" ); + + assert ( stim == resp ); + + status = ca_clear_channel ( chan ); + SEVCHK ( status, NULL ); + + ca_context_destroy (); + } + } + + showProgressEnd ( interestLevel ); +} + int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount, unsigned repetitionCount, enum ca_preemptive_callback_select select ) { @@ -2980,6 +3041,8 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount, caTaskExitTest ( interestLevel ); + verifyContextRundownFlush ( pName, interestLevel ); + free ( pChans ); printf ( "\nTest Complete\n" );