Avoid unique internal fileline in selftest.

This commit is contained in:
Wilson Snyder 2019-06-28 21:43:37 -04:00
parent af5616c077
commit 6990db70fa
2 changed files with 8 additions and 7 deletions

View File

@ -70,8 +70,8 @@ protected:
//! millions). To save space, per-file information (e.g. filename, source
//! language is held in tables in the FileLineSingleton class.
class FileLine {
int m_lineno;
int m_filenameno;
int m_lineno; // `line corrected line number
int m_filenameno; // `line corrected filename number
FileLine* m_parent; // Parent line that included this line
std::bitset<V3ErrorCode::_ENUM_MAX> m_warnOn;

View File

@ -38,11 +38,12 @@ void test(const string& lhss, const string& op, const string& rhss, const string
char* r1 = strdup(rhss.c_str());
char* e1 = strdup(exps.c_str());
V3Number lhnum (new FileLine("ck", __LINE__), l1);
V3Number rhnum (new FileLine("ck", __LINE__), r1);
V3Number expnum (new FileLine("ck", __LINE__), e1);
FileLine fl = new FileLine(FileLine::internalDefineFinename(), 0);
V3Number gotnum (new FileLine("ck", __LINE__), expnum.width());
V3Number lhnum (fl, l1);
V3Number rhnum (fl, r1);
V3Number expnum (fl, e1);
V3Number gotnum (fl, expnum.width());
if (op=="redOr") gotnum.opRedOr (lhnum);
else if (op=="redAnd") gotnum.opRedAnd (lhnum);
@ -82,7 +83,7 @@ void test(const string& lhss, const string& op, const string& rhss, const string
<<" = "<<expnum<<endl
<<" =? "<<gotnum<<endl);
V3Number ok (new FileLine("ck", __LINE__), 1);
V3Number ok (fl, 1);
ok.opCaseEq(expnum, gotnum);
if (ok.toUInt()!=1) {
v3fatalSrc("%Error:Test FAILED");