diff --git a/modules/database/test/ioc/db/dbCaLinkTest.c b/modules/database/test/ioc/db/dbCaLinkTest.c index b433db9c6..8243a6c82 100644 --- a/modules/database/test/ioc/db/dbCaLinkTest.c +++ b/modules/database/test/ioc/db/dbCaLinkTest.c @@ -50,13 +50,6 @@ void dbTestIoc_registerRecordDeviceDriver(struct dbBase *); static epicsEventId waitEvent; static unsigned waitCounter; -static -void waitForUpdateN(DBLINK *plink, unsigned long n) -{ - while(dbCaGetUpdateCount(plink)type==CA_LINK); - waitForUpdateN(psrclnk, 1); + testdbCaWaitForUpdateCount(psrclnk, 1); dbScanLock((dbCommon*)ptarg); ptarg->val = 42; db_post_events(ptarg, &ptarg->val, DBE_VALUE|DBE_ALARM|DBE_ARCHIVE); dbScanUnlock((dbCommon*)ptarg); - waitForUpdateN(psrclnk, 2); + testdbCaWaitForUpdateCount(psrclnk, 2); dbScanLock((dbCommon*)psrc); /* local CA_LINK connects immediately */ @@ -218,14 +211,14 @@ static void testStringLink(void) testOk1(psrclnk->type==CA_LINK); - waitForUpdateN(psrclnk, 1); + testdbCaWaitForUpdateCount(psrclnk, 1); dbScanLock((dbCommon*)ptarg); strcpy(ptarg->desc, "hello"); db_post_events(ptarg, &ptarg->desc, DBE_VALUE|DBE_ALARM|DBE_ARCHIVE); dbScanUnlock((dbCommon*)ptarg); - waitForUpdateN(psrclnk, 2); + testdbCaWaitForUpdateCount(psrclnk, 2); dbScanLock((dbCommon*)psrc); /* local CA_LINK connects immediately */ @@ -400,7 +393,7 @@ static void testArrayLink(unsigned nsrc, unsigned ntarg) testIocInitOk(); eltc(1); - waitForUpdateN(psrclnk, 1); + testdbCaWaitForUpdateCount(psrclnk, 1); bufsrc = psrc->bptr; buftarg= ptarg->bptr; @@ -421,7 +414,7 @@ static void testArrayLink(unsigned nsrc, unsigned ntarg) db_post_events(ptarg, &ptarg->val, DBE_VALUE|DBE_ALARM|DBE_ARCHIVE); dbScanUnlock((dbCommon*)ptarg); - waitForUpdateN(psrclnk, 2); + testdbCaWaitForUpdateCount(psrclnk, 2); dbScanLock((dbCommon*)psrc); testDiag("fetch source.INP into source.BPTR");