From 5b1b3e80d805399b1554e44126b1d2c06bd30c41 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 6 Aug 2003 21:24:57 +0000 Subject: [PATCH] improved the ca_task_exit() trest --- src/ca/acctst.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/ca/acctst.c b/src/ca/acctst.c index dfbe5bf65..12e92d706 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -2410,20 +2410,31 @@ void verifyChannelPriorities ( const char *pName, unsigned interestLevel ) void verifyImmediateTearDown ( const char * pName, unsigned interestLevel ) { unsigned i; - double value; - int status; - chid chan; showProgressBegin ( "verifyImmediateTearDown", interestLevel ); for ( i = 0u; i < 1000; i++ ) { + chid chan; + int status; + double value = i; ca_task_initialize (); status = ca_create_channel ( pName, 0, 0, 0, & chan ); SEVCHK ( status, "immediate tear down channel create failed" ); status = ca_pend_io ( timeoutToPendIO ); SEVCHK ( status, "immediate tear down channel connect failed" ); assert ( status == ECA_NORMAL ); - value = i; + /* + * verify that puts pending when we call ca_task_exit() + * get flushed out + */ + if ( i > 0 ) { + double currentValue = 0.0; + status = ca_get ( DBR_DOUBLE, chan, & currentValue ); + SEVCHK ( status, "immediate tear down channel get failed" ); + status = ca_pend_io ( timeoutToPendIO ); + SEVCHK ( status, "immediate tear down channel get failed" ); + assert ( currentValue == i - 1 ); + } status = ca_put ( DBR_DOUBLE, chan, & value ); SEVCHK ( status, "immediate tear down channel put failed" ); ca_task_exit (); @@ -2433,23 +2444,6 @@ void verifyImmediateTearDown ( const char * pName, unsigned interestLevel ) } } - /* - * verify that puts pending when we call ca_task_exit() - * get flushed out - */ - ca_task_initialize (); - status = ca_create_channel ( pName, 0, 0, 0, & chan ); - SEVCHK ( status, "immediate tear down channel create failed" ); - status = ca_pend_io ( timeoutToPendIO ); - SEVCHK ( status, "immediate tear down channel connect failed" ); - assert ( status == ECA_NORMAL ); - status = ca_get ( DBR_DOUBLE, chan, & value ); - SEVCHK ( status, "immediate tear down channel get failed" ); - status = ca_pend_io ( timeoutToPendIO ); - SEVCHK ( status, "immediate tear down channel get failed" ); - assert ( value == i - 1u ); - ca_task_exit (); - showProgressEnd ( interestLevel ); }