test dbReadDatabaseFP()

This commit is contained in:
Michael Davidsaver
2022-03-03 09:18:38 -08:00
parent 6c5d56688d
commit 62092d4399
3 changed files with 17 additions and 2 deletions

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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");