Change indfield settings in new dbInitEntryFrom*()
Can get indfield value from dbAddr->pflddes->indRecordType. Make FromRecord set indfield=0 like dbFindRecord() does. Adjust dbStaticTest to match.
This commit is contained in:
@@ -694,7 +694,7 @@ void dbInitEntryFromAddr(struct dbAddr *paddr, DBENTRY *pdbentry)
|
||||
pdbentry->precnode = ppvt->recnode;
|
||||
pdbentry->pflddes = paddr->pfldDes;
|
||||
pdbentry->pfield = paddr->pfield;
|
||||
pdbentry->indfield = -1; /* invalid */
|
||||
pdbentry->indfield = paddr->pfldDes->indRecordType;
|
||||
}
|
||||
|
||||
void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry)
|
||||
@@ -706,7 +706,6 @@ void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry)
|
||||
pdbentry->pdbbase = pdbbase;
|
||||
pdbentry->precordType = prec->rdes;
|
||||
pdbentry->precnode = ppvt->recnode;
|
||||
pdbentry->indfield = -1; /* invalid */
|
||||
}
|
||||
|
||||
long dbValueSize(short dbr_type)
|
||||
|
||||
@@ -63,13 +63,10 @@ static void testAddr2Entry(const char *pv)
|
||||
testOk1(entry.pflddes==entry2.pflddes);
|
||||
testOk1(entry.precnode==entry2.precnode);
|
||||
testOk1(entry.pfield==entry2.pfield);
|
||||
testOk1(entry2.indfield==-1);
|
||||
testOk1(entry.indfield==entry2.indfield);
|
||||
testOk1(!entry2.pinfonode);
|
||||
testOk1(!entry2.message);
|
||||
|
||||
/* no way to look this up, so not set */
|
||||
entry.indfield = -1;
|
||||
|
||||
testOk1(memcmp(&entry, &entry2, sizeof(entry))==0);
|
||||
|
||||
dbFinishEntry(&entry);
|
||||
@@ -103,13 +100,10 @@ static void testRec2Entry(const char *recname)
|
||||
testOk1(entry.pflddes==entry2.pflddes);
|
||||
testOk1(entry.precnode==entry2.precnode);
|
||||
testOk1(entry.pfield==entry2.pfield);
|
||||
testOk1(entry2.indfield==-1);
|
||||
testOk1(entry.indfield==entry2.indfield);
|
||||
testOk1(!entry2.pinfonode);
|
||||
testOk1(!entry2.message);
|
||||
|
||||
/* no way to look this up, so not set */
|
||||
entry.indfield = -1;
|
||||
|
||||
testOk1(memcmp(&entry, &entry2, sizeof(entry))==0);
|
||||
|
||||
dbFinishEntry(&entry);
|
||||
|
||||
Reference in New Issue
Block a user