From 6bdb8f911a3b8f58bcafc094bf40663f706c094d Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 23 Jul 2014 16:18:32 -0500 Subject: [PATCH] Suppress errlog output of expected warning messages. --- src/ioc/db/test/dbChannelTest.c | 3 +++ src/ioc/db/test/dbPutLinkTest.c | 3 +++ src/ioc/db/test/dbShutdownTest.c | 3 +++ src/libCom/error/errlog.c | 1 + 4 files changed, 10 insertions(+) diff --git a/src/ioc/db/test/dbChannelTest.c b/src/ioc/db/test/dbChannelTest.c index 5eb431f3e..75d3185aa 100644 --- a/src/ioc/db/test/dbChannelTest.c +++ b/src/ioc/db/test/dbChannelTest.c @@ -21,6 +21,7 @@ #include "epicsUnitTest.h" #include "testMain.h" #include "osiFileName.h" +#include "errlog.h" /* Expected call bit definitions */ #define e_start 0x00000001 @@ -199,7 +200,9 @@ MAIN(testDbChannel) /* dbChannelTest is an API routine... */ testOk(!dbChannelCreate("y"), "Create, bad record"); testOk(!dbChannelCreate("x.NOFIELD"), "Create, bad field"); testOk(!dbChannelCreate("x.{not-json}"), "Create, bad JSON"); + eltc(0); testOk(!dbChannelCreate("x.{\"none\":null}"), "Create, bad filter"); + eltc(1); dbRegisterFilter("any", &testIf, NULL); diff --git a/src/ioc/db/test/dbPutLinkTest.c b/src/ioc/db/test/dbPutLinkTest.c index fc5ad7a27..a5a4e8084 100644 --- a/src/ioc/db/test/dbPutLinkTest.c +++ b/src/ioc/db/test/dbPutLinkTest.c @@ -22,6 +22,7 @@ #include "dbStaticLib.h" #include "osiFileName.h" #include "dbmf.h" +#include "errlog.h" #include "xRecord.h" @@ -62,7 +63,9 @@ static void testSet(void) testdbReadDatabase("dbPutLinkTest.db", NULL, NULL); + eltc(0); testIocInitOk(); + eltc(1); prec = (xRecord*)testdbRecordPtr("x1"); plink = &prec->lnk; diff --git a/src/ioc/db/test/dbShutdownTest.c b/src/ioc/db/test/dbShutdownTest.c index b74b68d08..55a8f3e0c 100644 --- a/src/ioc/db/test/dbShutdownTest.c +++ b/src/ioc/db/test/dbShutdownTest.c @@ -20,6 +20,7 @@ #include "dbStaticLib.h" #include "osiFileName.h" #include "dbmf.h" +#include "errlog.h" #include "testMain.h" @@ -72,7 +73,9 @@ void cycle(void) { testdbReadDatabase("xRecord.db", NULL, NULL); + eltc(0); testIocInitOk(); + eltc(1); epicsThreadMap(findCommonThread); checkCommonThreads(); diff --git a/src/libCom/error/errlog.c b/src/libCom/error/errlog.c index fbad162e1..680a1316a 100644 --- a/src/libCom/error/errlog.c +++ b/src/libCom/error/errlog.c @@ -368,6 +368,7 @@ epicsShareFunc int epicsShareAPI errlogRemoveListeners( epicsShareFunc int epicsShareAPI eltc(int yesno) { errlogInit(0); + errlogFlush(); pvtData.toConsole = yesno; return 0; }