Merge remote-tracking branch 'launchpad/3.15'
* launchpad/3.15: oops std/filter/test: use dbUnitTest travis-ci enable mingw w/ dll travisci catools: Fix SEGFAULT from bad PV names typo Fix for dbCa warning seg-fault Fix postfix.h macro arg, document libCom/test: epicsCalcTest use exact postifx buffers
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
DBE_ARCHIVE (DBE_LOG)
|
||||
Trigger an event when an archive significant change in the channel's
|
||||
valuue occurs. Relies on the archiver monitor deadband field under DCT.
|
||||
value occurs. Relies on the archiver monitor deadband field under DCT.
|
||||
|
||||
DBE_ALARM
|
||||
Trigger an event when the alarm state changes
|
||||
|
||||
@@ -541,11 +541,11 @@ int main (int argc, char *argv[])
|
||||
for (n = 0; optind < argc; n++, optind++)
|
||||
pvs[n].name = argv[optind] ; /* Copy PV names from command line */
|
||||
|
||||
connect_pvs(pvs, nPvs);
|
||||
result = connect_pvs(pvs, nPvs);
|
||||
|
||||
/* Read and print data */
|
||||
|
||||
result = caget(pvs, nPvs, request, format, type, count);
|
||||
if (!result)
|
||||
result = caget(pvs, nPvs, request, format, type, count);
|
||||
|
||||
/* Shut down Channel Access */
|
||||
ca_context_destroy();
|
||||
|
||||
@@ -211,10 +211,11 @@ int main (int argc, char *argv[])
|
||||
for (n = 0; optind < argc; n++, optind++)
|
||||
pvs[n].name = argv[optind] ; /* Copy PV names from command line */
|
||||
|
||||
connect_pvs(pvs, nPvs);
|
||||
result = connect_pvs(pvs, nPvs);
|
||||
|
||||
/* Print data */
|
||||
result = cainfo(pvs, nPvs);
|
||||
if (!result)
|
||||
result = cainfo(pvs, nPvs);
|
||||
|
||||
/* Shut down Channel Access */
|
||||
ca_context_destroy();
|
||||
|
||||
@@ -139,7 +139,6 @@ static void addAction(caLink *pca, short link_action)
|
||||
if (++removesOutstanding >= removesOutstandingWarning) {
|
||||
errlogPrintf("dbCa::addAction pausing, %d channels to clear\n",
|
||||
removesOutstanding);
|
||||
printLinks(pca);
|
||||
}
|
||||
while (removesOutstanding >= removesOutstandingWarning) {
|
||||
epicsMutexUnlock(workListLock);
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
#define CALCPERFORM_NARGS 12
|
||||
#define CALCPERFORM_STACK 80
|
||||
|
||||
#define INFIX_TO_POSTFIX_SIZE(n) (n*21/6)
|
||||
#define INFIX_TO_POSTFIX_SIZE(n) ((n)*21/6)
|
||||
/* The above expression is an estimate of the maximum postfix buffer
|
||||
* size needed for a given infix expression buffer. The actual size
|
||||
* size needed for a given infix expression buffer (the argument must count
|
||||
* the trailing nil byte in the input expression string). The actual size
|
||||
* needed is never larger than this value, although it is actually a
|
||||
* few bytes smaller for some sizes.
|
||||
*
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
\*************************************************************************/
|
||||
// Author: Andrew Johnson
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "epicsUnitTest.h"
|
||||
#include "epicsTypes.h"
|
||||
#include "epicsMath.h"
|
||||
@@ -20,17 +23,23 @@ double doCalc(const char *expr) {
|
||||
double args[CALCPERFORM_NARGS] = {
|
||||
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0
|
||||
};
|
||||
char rpn[MAX_POSTFIX_SIZE];
|
||||
char *rpn = (char*)malloc(INFIX_TO_POSTFIX_SIZE(strlen(expr)+1));
|
||||
short err;
|
||||
double result = 0.0;
|
||||
result /= result; /* Start as NaN */
|
||||
|
||||
|
||||
if(!rpn) {
|
||||
testAbort("postfix: %s no memory", expr);
|
||||
return epicsNAN;
|
||||
}
|
||||
|
||||
if (postfix(expr, rpn, &err)) {
|
||||
testDiag("postfix: %s in expression '%s'", calcErrorStr(err), expr);
|
||||
} else
|
||||
if (calcPerform(args, &result, rpn) && finite(result)) {
|
||||
testDiag("calcPerform: error evaluating '%s'", expr);
|
||||
}
|
||||
free(rpn);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -40,11 +49,16 @@ void testCalc(const char *expr, double expected) {
|
||||
double args[CALCPERFORM_NARGS] = {
|
||||
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0
|
||||
};
|
||||
char rpn[MAX_POSTFIX_SIZE];
|
||||
char *rpn = (char*)malloc(INFIX_TO_POSTFIX_SIZE(strlen(expr)+1));
|
||||
short err;
|
||||
double result = 0.0;
|
||||
result /= result; /* Start as NaN */
|
||||
|
||||
if(!rpn) {
|
||||
testFail("postfix: %s no memory", expr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (postfix(expr, rpn, &err)) {
|
||||
testDiag("postfix: %s in expression '%s'", calcErrorStr(err), expr);
|
||||
} else
|
||||
@@ -63,6 +77,7 @@ void testCalc(const char *expr, double expected) {
|
||||
testDiag("Expected result is %g, actually got %g", expected, result);
|
||||
calcExprDump(rpn);
|
||||
}
|
||||
free(rpn);
|
||||
}
|
||||
|
||||
void testUInt32Calc(const char *expr, epicsUInt32 expected) {
|
||||
@@ -71,12 +86,17 @@ void testUInt32Calc(const char *expr, epicsUInt32 expected) {
|
||||
double args[CALCPERFORM_NARGS] = {
|
||||
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0
|
||||
};
|
||||
char rpn[MAX_POSTFIX_SIZE];
|
||||
char *rpn = (char*)malloc(INFIX_TO_POSTFIX_SIZE(strlen(expr)+1));
|
||||
short err;
|
||||
epicsUInt32 uresult;
|
||||
double result = 0.0;
|
||||
result /= result; /* Start as NaN */
|
||||
|
||||
if(!rpn) {
|
||||
testFail("postfix: %s no memory", expr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (postfix(expr, rpn, &err)) {
|
||||
testDiag("postfix: %s in expression '%s'", calcErrorStr(err), expr);
|
||||
} else
|
||||
@@ -91,38 +111,50 @@ void testUInt32Calc(const char *expr, epicsUInt32 expected) {
|
||||
expected, expected, uresult, uresult);
|
||||
calcExprDump(rpn);
|
||||
}
|
||||
free(rpn);
|
||||
}
|
||||
|
||||
void testArgs(const char *expr, unsigned long einp, unsigned long eout) {
|
||||
char rpn[MAX_POSTFIX_SIZE];
|
||||
char *rpn = (char*)malloc(INFIX_TO_POSTFIX_SIZE(strlen(expr)+1));
|
||||
short err = 0;
|
||||
unsigned long vinp, vout;
|
||||
|
||||
if(!rpn) {
|
||||
testFail("postfix: %s no memory", expr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (postfix(expr, rpn, &err)) {
|
||||
testFail("postfix: %s in expression '%s'", calcErrorStr(err), expr);
|
||||
return;
|
||||
testFail("postfix: %s in expression '%s'", calcErrorStr(err), expr);
|
||||
return;
|
||||
}
|
||||
if (calcArgUsage(rpn, &vinp, &vout)) {
|
||||
testFail("calcArgUsage returned error for '%s'", expr);
|
||||
return;
|
||||
testFail("calcArgUsage returned error for '%s'", expr);
|
||||
return;
|
||||
}
|
||||
if (!testOk(vinp == einp && vout == eout, "Args for '%s'", expr)) {
|
||||
testDiag("Expected (%lx, %lx) got (%lx, %lx)", einp, eout, vinp, vout);
|
||||
testDiag("Expected (%lx, %lx) got (%lx, %lx)", einp, eout, vinp, vout);
|
||||
}
|
||||
free(rpn);
|
||||
}
|
||||
|
||||
void testBadExpr(const char *expr, short expected_err) {
|
||||
/* Parse an invalid expression, test against expected error code */
|
||||
char rpn[MAX_POSTFIX_SIZE];
|
||||
char *rpn = (char*)malloc(INFIX_TO_POSTFIX_SIZE(strlen(expr)+1));
|
||||
short err = 0;
|
||||
|
||||
if(!rpn) {
|
||||
testFail("postfix: %s no memory", expr);
|
||||
return;
|
||||
}
|
||||
|
||||
postfix(expr, rpn, &err);
|
||||
if (!testOk(err == expected_err, "Bad expression '%s'", expr)) {
|
||||
testDiag("Expected '%s', actually got '%s'",
|
||||
calcErrorStr(expected_err), calcErrorStr(err));
|
||||
calcExprDump(rpn);
|
||||
testDiag("Expected '%s', actually got '%s'",
|
||||
calcErrorStr(expected_err), calcErrorStr(err));
|
||||
calcExprDump(rpn);
|
||||
}
|
||||
return;
|
||||
free(rpn);
|
||||
}
|
||||
|
||||
/* Test an expression that is also valid C code */
|
||||
|
||||
@@ -18,48 +18,42 @@ Recs_LIBS += dbCore Com
|
||||
|
||||
PROD_LIBS = Recs dbRecStd dbCore ca Com
|
||||
|
||||
TARGETS += $(COMMON_DIR)/tsTest.dbd
|
||||
DBDDEPENDS_FILES += tsTest.dbd$(DEP)
|
||||
tsTest_DBD += xRecord.dbd
|
||||
DBDDEPENDS_FILES += filterTest.dbd$(DEP)
|
||||
TARGETS += $(COMMON_DIR)/filterTest.dbd
|
||||
filterTest_DBD += menuGlobal.dbd
|
||||
filterTest_DBD += menuConvert.dbd
|
||||
filterTest_DBD += menuScan.dbd
|
||||
filterTest_DBD += filters.dbd
|
||||
filterTest_DBD += xRecord.dbd
|
||||
filterTest_DBD += arrRecord.dbd
|
||||
TESTFILES += $(COMMON_DIR)/filterTest.dbd
|
||||
|
||||
testHarness_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
|
||||
TESTPROD_HOST += tsTest
|
||||
tsTest_SRCS += tsTest.c
|
||||
tsTest_SRCS += tsTest_registerRecordDeviceDriver.cpp
|
||||
tsTest_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += tsTest.c
|
||||
testHarness_SRCS += tsTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/tsTest.dbd ../xRecord.db
|
||||
TESTFILES += ../xRecord.db
|
||||
TESTS += tsTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/dbndTest.dbd
|
||||
DBDDEPENDS_FILES += dbndTest.dbd$(DEP)
|
||||
dbndTest_DBD += xRecord.dbd
|
||||
TESTPROD_HOST += dbndTest
|
||||
dbndTest_SRCS += dbndTest.c
|
||||
dbndTest_SRCS += dbndTest_registerRecordDeviceDriver.cpp
|
||||
dbndTest_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += dbndTest.c
|
||||
testHarness_SRCS += dbndTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/dbndTest.dbd
|
||||
TESTS += dbndTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/arrTest.dbd
|
||||
DBDDEPENDS_FILES += arrTest.dbd$(DEP)
|
||||
arrTest_DBD += arrRecord.dbd
|
||||
TESTPROD_HOST += arrTest
|
||||
arrTest_SRCS += arrTest.cpp
|
||||
arrTest_SRCS += arrTest_registerRecordDeviceDriver.cpp
|
||||
arrTest_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += arrTest.cpp
|
||||
testHarness_SRCS += arrTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/arrTest.dbd ../arrTest.db
|
||||
TESTFILES += ../arrTest.db
|
||||
TESTS += arrTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/syncTest.dbd
|
||||
DBDDEPENDS_FILES += syncTest.dbd$(DEP)
|
||||
syncTest_DBD += xRecord.dbd
|
||||
TESTPROD_HOST += syncTest
|
||||
syncTest_SRCS += syncTest.c
|
||||
syncTest_SRCS += syncTest_registerRecordDeviceDriver.cpp
|
||||
syncTest_SRCS += filterTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += syncTest.c
|
||||
testHarness_SRCS += syncTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/syncTest.dbd
|
||||
TESTS += syncTest
|
||||
|
||||
# epicsRunFilterTests runs all the test programs in a known working order.
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include "envDefs.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbmf.h"
|
||||
#include "errlog.h"
|
||||
#include "registry.h"
|
||||
#include "subRecord.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbAccess.h"
|
||||
#include "asDbLib.h"
|
||||
@@ -38,14 +38,14 @@
|
||||
#include "iocsh.h"
|
||||
#include "dbChannel.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "dbUnitTest.h"
|
||||
#include "testMain.h"
|
||||
#include "osiFileName.h"
|
||||
|
||||
#include "arrRecord.h"
|
||||
|
||||
extern "C" {
|
||||
int arrTest_registerRecordDeviceDriver(struct dbBase *pdbbase);
|
||||
epicsShareExtern void (*pvar_func_arrInitialize)(void);
|
||||
void filterTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
}
|
||||
|
||||
#define CA_SERVER_PORT "65535"
|
||||
@@ -54,12 +54,6 @@ extern "C" {
|
||||
|
||||
const char *server_port = CA_SERVER_PORT;
|
||||
|
||||
extern "C" {
|
||||
static void exitSubroutine(subRecord *precord) {
|
||||
epicsExit((precord->a == 0.0) ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static int fl_equals_array(short type, const db_field_log *pfl1, void *p2) {
|
||||
for (int i = 0; i < pfl1->no_elements; i++) {
|
||||
switch (type) {
|
||||
@@ -298,23 +292,9 @@ static void check(short dbr_type) {
|
||||
TEST5B(3, -8, -4, "both sides from-end");
|
||||
}
|
||||
|
||||
static dbEventCtx evtctx;
|
||||
|
||||
extern "C" {
|
||||
static void arrTestCleanup(void* junk)
|
||||
{
|
||||
dbFreeBase(pdbbase);
|
||||
registryFree();
|
||||
pdbbase=0;
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
dbmfFreeChunks();
|
||||
}
|
||||
}
|
||||
|
||||
MAIN(arrTest)
|
||||
{
|
||||
dbEventCtx evtctx;
|
||||
const chFilterPlugin *plug;
|
||||
char arr[] = "arr";
|
||||
|
||||
@@ -324,26 +304,21 @@ MAIN(arrTest)
|
||||
|
||||
epicsEnvSet("EPICS_CA_SERVER_PORT", server_port);
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "arrTest.dbd",
|
||||
"." OSI_PATH_LIST_SEPARATOR ".." OSI_PATH_LIST_SEPARATOR
|
||||
"../O.Common" OSI_PATH_LIST_SEPARATOR "O.Common", NULL))
|
||||
testAbort("Database description not loaded");
|
||||
testdbPrepare();
|
||||
|
||||
(*pvar_func_arrInitialize)();
|
||||
arrTest_registerRecordDeviceDriver(pdbbase);
|
||||
registryFunctionAdd("exit", (REGISTRYFUNCTION) exitSubroutine);
|
||||
testdbReadDatabase("filterTest.dbd", NULL, NULL);
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "arrTest.db",
|
||||
"." OSI_PATH_LIST_SEPARATOR "..", NULL))
|
||||
testAbort("Test database not loaded");
|
||||
filterTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
epicsAtExit(&arrTestCleanup,NULL);
|
||||
testdbReadDatabase("arrTest.db", NULL, NULL);
|
||||
|
||||
eltc(0);
|
||||
testIocInitOk();
|
||||
eltc(1);
|
||||
|
||||
/* Start the IOC */
|
||||
|
||||
iocInit();
|
||||
evtctx = db_init_events();
|
||||
epicsThreadSleep(0.2);
|
||||
|
||||
testOk(!!(plug = dbFindFilter(arr, strlen(arr))), "plugin arr registered correctly");
|
||||
|
||||
@@ -351,5 +326,11 @@ MAIN(arrTest)
|
||||
check(DBR_DOUBLE);
|
||||
check(DBR_STRING);
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
|
||||
@@ -17,8 +17,10 @@
|
||||
#include "db_field_log.h"
|
||||
#include "dbCommon.h"
|
||||
#include "registry.h"
|
||||
#include "errlog.h"
|
||||
#include "chfPlugin.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "dbUnitTest.h"
|
||||
#include "epicsTime.h"
|
||||
#include "dbmf.h"
|
||||
#include "testMain.h"
|
||||
@@ -26,8 +28,7 @@
|
||||
|
||||
#define PATTERN 0x55
|
||||
|
||||
void dbndTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
epicsShareExtern void (*pvar_func_dbndInitialize)(void);
|
||||
void filterTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
static db_field_log fl;
|
||||
|
||||
@@ -115,21 +116,20 @@ MAIN(dbndTest)
|
||||
|
||||
testPlan(59);
|
||||
|
||||
dbChannelInit();
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("filterTest.dbd", NULL, NULL);
|
||||
|
||||
filterTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
testdbReadDatabase("xRecord.db", NULL, NULL);
|
||||
|
||||
eltc(0);
|
||||
testIocInitOk();
|
||||
eltc(1);
|
||||
|
||||
evtctx = db_init_events();
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "dbndTest.dbd",
|
||||
"." OSI_PATH_LIST_SEPARATOR ".." OSI_PATH_LIST_SEPARATOR
|
||||
"../O.Common" OSI_PATH_LIST_SEPARATOR "O.Common", NULL))
|
||||
testAbort("Database description 'dbndTest.dbd' not found");
|
||||
|
||||
(*pvar_func_dbndInitialize)(); /* manually initialize plugin */
|
||||
dbndTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "xRecord.db",
|
||||
"." OSI_PATH_LIST_SEPARATOR "..", NULL))
|
||||
testAbort("Test database 'xRecord.db' not found");
|
||||
|
||||
testOk(!!(plug = dbFindFilter(dbnd, strlen(dbnd))), "plugin dbnd registered correctly");
|
||||
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"dbnd\":{}}")), "dbChannel with plugin dbnd (delta=0) created");
|
||||
@@ -274,13 +274,12 @@ MAIN(dbndTest)
|
||||
mustPassOnce(pch, pfl2, "rel", 50., 7);
|
||||
|
||||
dbChannelDelete(pch);
|
||||
dbFreeBase(pdbbase);
|
||||
registryFree();
|
||||
pdbbase=0;
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
dbmfFreeChunks();
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
#include "dbChannel.h"
|
||||
#include "registry.h"
|
||||
#include "chfPlugin.h"
|
||||
#include "errlog.h"
|
||||
#include "dbmf.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "dbUnitTest.h"
|
||||
#include "epicsTime.h"
|
||||
#include "dbState.h"
|
||||
#include "testMain.h"
|
||||
@@ -28,8 +30,7 @@
|
||||
|
||||
#define PATTERN 0x55
|
||||
|
||||
void syncTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
epicsShareExtern void (*pvar_func_syncInitialize)(void);
|
||||
void filterTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
static db_field_log fl;
|
||||
static dbStateId red;
|
||||
@@ -142,21 +143,20 @@ MAIN(syncTest)
|
||||
|
||||
testPlan(139);
|
||||
|
||||
dbChannelInit();
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("filterTest.dbd", NULL, NULL);
|
||||
|
||||
filterTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
testdbReadDatabase("xRecord.db", NULL, NULL);
|
||||
|
||||
eltc(0);
|
||||
testIocInitOk();
|
||||
eltc(1);
|
||||
|
||||
evtctx = db_init_events();
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "syncTest.dbd",
|
||||
"." OSI_PATH_LIST_SEPARATOR ".." OSI_PATH_LIST_SEPARATOR
|
||||
"../O.Common" OSI_PATH_LIST_SEPARATOR "O.Common", NULL))
|
||||
testAbort("Database description 'syncTest.dbd' not found");
|
||||
|
||||
(*pvar_func_syncInitialize)(); /* manually initialize plugin */
|
||||
syncTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "xRecord.db",
|
||||
"." OSI_PATH_LIST_SEPARATOR "..", NULL))
|
||||
testAbort("Test database 'xRecord.db' not found");
|
||||
|
||||
testOk(!!(plug = dbFindFilter(myname, strlen(myname))), "plugin %s registered correctly", myname);
|
||||
testOk(!!(red = dbStateCreate("red")), "state 'red' created successfully");
|
||||
|
||||
@@ -367,13 +367,12 @@ MAIN(syncTest)
|
||||
db_delete_field_log(pfl[9]);
|
||||
|
||||
dbChannelDelete(pch);
|
||||
dbFreeBase(pdbbase);
|
||||
registryFree();
|
||||
pdbbase=0;
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
dbmfFreeChunks();
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbAccessDefs.h"
|
||||
#include "chfPlugin.h"
|
||||
#include "errlog.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "dbUnitTest.h"
|
||||
#include "registry.h"
|
||||
#include "dbmf.h"
|
||||
#include "epicsTime.h"
|
||||
@@ -24,8 +26,7 @@
|
||||
|
||||
#define PATTERN 0x55
|
||||
|
||||
void tsTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
epicsShareExtern void (*pvar_func_tsInitialize)(void);
|
||||
void filterTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
static db_field_log fl;
|
||||
|
||||
@@ -56,21 +57,20 @@ MAIN(tsTest)
|
||||
|
||||
testPlan(12);
|
||||
|
||||
dbChannelInit();
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("filterTest.dbd", NULL, NULL);
|
||||
|
||||
filterTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
testdbReadDatabase("xRecord.db", NULL, NULL);
|
||||
|
||||
eltc(0);
|
||||
testIocInitOk();
|
||||
eltc(1);
|
||||
|
||||
evtctx = db_init_events();
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "tsTest.dbd",
|
||||
"." OSI_PATH_LIST_SEPARATOR ".." OSI_PATH_LIST_SEPARATOR
|
||||
"../O.Common" OSI_PATH_LIST_SEPARATOR "O.Common", NULL))
|
||||
testAbort("Database description 'tsTest.dbd' not found");
|
||||
|
||||
(*pvar_func_tsInitialize)(); /* manually initialize plugin */
|
||||
tsTest_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
if (dbReadDatabase(&pdbbase, "xRecord.db",
|
||||
"." OSI_PATH_LIST_SEPARATOR "..", NULL))
|
||||
testAbort("Test database 'xRecord.db' not found");
|
||||
|
||||
testOk(!!(plug = dbFindFilter(ts, strlen(ts))), "plugin ts registered correctly");
|
||||
|
||||
testOk(!!(pch = dbChannelCreate("x.VAL{\"ts\":{}}")), "dbChannel with plugin ts created");
|
||||
@@ -108,13 +108,12 @@ MAIN(tsTest)
|
||||
"ts filter sets time stamp to \"now\"");
|
||||
|
||||
dbChannelDelete(pch);
|
||||
dbFreeBase(pdbbase);
|
||||
registryFree();
|
||||
pdbbase=0;
|
||||
|
||||
db_close_events(evtctx);
|
||||
|
||||
dbmfFreeChunks();
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
# This is a combined minimal DBD and DB file
|
||||
|
||||
recordtype(x) {
|
||||
field(NAME, DBF_STRING) {
|
||||
prompt("Record Name")
|
||||
special(SPC_NOMOD)
|
||||
size(61)
|
||||
}
|
||||
include "dbCommon.dbd"
|
||||
field(VAL, DBF_LONG) {
|
||||
prompt("Value")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user