test dbReadDatabaseFP()
This commit is contained in:
@@ -155,7 +155,7 @@ static void *getLastTemp(void)
|
||||
return(ptempListNode->item);
|
||||
}
|
||||
|
||||
static char *dbOpenFile(DBBASE *pdbbase,const char *filename,FILE **fp)
|
||||
const char *dbOpenFile(DBBASE *pdbbase,const char *filename,FILE **fp)
|
||||
{
|
||||
ELLLIST *ppathList = (ELLLIST *)pdbbase->pathPvt;
|
||||
dbPathNode *pdbPathNode;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#ifndef INCdbStaticPvth
|
||||
#define INCdbStaticPvth 1
|
||||
|
||||
#include "dbCoreAPI.h"
|
||||
#include "dbStaticLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -42,6 +43,9 @@ void dbMsgPrint(DBENTRY *pdbentry, const char *fmt, ...) EPICS_PRINTF_STYLE(2,3)
|
||||
|
||||
void dbPutStringSuggest(DBENTRY *pdbentry, const char *pstring);
|
||||
|
||||
DBCORE_API
|
||||
const char *dbOpenFile(DBBASE *pdbbase,const char *filename,FILE **fp);
|
||||
|
||||
struct jlink;
|
||||
|
||||
typedef struct dbLinkInfo {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <errlog.h>
|
||||
#include <osiFileName.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
@@ -294,12 +295,22 @@ void dbTestIoc_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
MAIN(dbStaticTest)
|
||||
{
|
||||
const char *ldir;
|
||||
FILE *fp = NULL;
|
||||
|
||||
testPlan(310);
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("dbTestIoc.dbd", NULL, NULL);
|
||||
dbTestIoc_registerRecordDeviceDriver(pdbbase);
|
||||
testdbReadDatabase("dbStaticTest.db", NULL, NULL);
|
||||
dbPath(pdbbase,"." OSI_PATH_LIST_SEPARATOR "..");
|
||||
if(!(ldir = dbOpenFile(pdbbase, "dbStaticTest.db", &fp))) {
|
||||
testAbort("Unable to read dbStaticTest.db");
|
||||
}
|
||||
if(dbReadDatabaseFP(&pdbbase, fp, NULL, NULL)) {
|
||||
testAbort("Unable to load %s%sdbStaticTest.db",
|
||||
ldir, OSI_PATH_LIST_SEPARATOR);
|
||||
}
|
||||
|
||||
testEntry("testrec.VAL");
|
||||
testEntry("testalias.VAL");
|
||||
|
||||
Reference in New Issue
Block a user