improved the ca_task_exit() trest

This commit is contained in:
Jeff Hill
2003-08-06 21:24:57 +00:00
parent fbc524d308
commit 5b1b3e80d8
+15 -21
View File
@@ -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 );
}