From 6dcafe6b1e15fb6f5528e78b3b62c5246c94ad26 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 8 Mar 2001 21:23:37 +0000 Subject: [PATCH] improved beacon period test --- src/ca/acctst.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ca/acctst.c b/src/ca/acctst.c index 663118cb1..1cc6213ca 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -1599,15 +1599,20 @@ void verifyReasonableBeaconPeriod ( chid chan ) * 2) watch inactive circuit for awhile to see if it * prematurely disconnects */ - printf ( "Verifying beacon period - this takes %g sec. ", + printf ( "Verifying beacon period - this takes %g sec.\n", expectedBeaconPeriod * 2 ); - fflush ( stdout ); epicsThreadSleep ( expectedBeaconPeriod * 2 ); beaconPeriod = ca_beacon_period ( chan ); - error = fabs ( beaconPeriod - expectedBeaconPeriod ); - /* expect less than a 10% error */ - assert ( error / expectedBeaconPeriod < 0.1 ); - printf ( "done\n" ); + if ( beaconPeriod >= 0.0 ) { + error = beaconPeriod - expectedBeaconPeriod; + printf ( "Beacon period error = %f sec.\n", error ); + fflush ( stdout ); + /* expect less than a 10% error */ + assert ( fabs ( error ) / expectedBeaconPeriod < 0.1 ); + } + else { + printf ( "Unable to determine beacon period\n" ); + } } } @@ -1684,6 +1689,7 @@ int acctst ( char *pName, unsigned channelCount, unsigned repetitionCount ) verifyConnectionHandlerConnect ( pChans, channelCount, repetitionCount ); verifyBlockingConnect ( pChans, channelCount, repetitionCount ); verifyClear ( pChans ); + verifyReasonableBeaconPeriod ( chan ); /*