update tests to compile okay with new upstream codes

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
This commit is contained in:
dsengupta0628 2026-04-20 13:35:44 +00:00
parent c523516092
commit 133e2d6f99
10 changed files with 61 additions and 152 deletions

View File

@ -2799,12 +2799,6 @@ TEST(TestCellTest, CellBusDcl) {
EXPECT_EQ(cell.findBusDcl("nonexistent"), nullptr);
}
TEST(TestCellTest, HasInternalPorts) {
LibertyLibrary lib("test_lib", "test.lib");
TestCell cell(&lib, "CELL1", "test.lib");
EXPECT_FALSE(cell.hasInternalPorts());
}
TEST(TestCellTest, SetAlwaysOn) {
LibertyLibrary lib("test_lib", "test.lib");
TestCell cell(&lib, "AON1", "test.lib");

View File

@ -1442,7 +1442,7 @@ TEST_F(StaLibertyTest, PortBundlePort) {
ASSERT_NE(buf, nullptr);
LibertyPort *port = buf->findLibertyPort("A");
ASSERT_NE(port, nullptr);
LibertyPort *bundle = port->bundlePort();
ConcretePort *bundle = port->bundlePort();
EXPECT_EQ(bundle, nullptr);
}
@ -2300,14 +2300,6 @@ TEST_F(StaLibertyTest, LibraryTableTemplates) {
// LibertyCell misc
////////////////////////////////////////////////////////////////
TEST_F(StaLibertyTest, CellHasInternalPorts) {
LibertyCell *buf = lib_->findLibertyCell("BUF_X1");
ASSERT_NE(buf, nullptr);
bool hip = buf->hasInternalPorts();
(void)hip;
// hip value depends on cell type
}
TEST_F(StaLibertyTest, CellClockGateLatch) {
LibertyCell *buf = lib_->findLibertyCell("BUF_X1");
ASSERT_NE(buf, nullptr);
@ -3347,11 +3339,4 @@ TEST_F(StaLibertyTest, CellAlwaysOn) {
// isDisabledConstraint has been moved from LibertyCell to Sdc.
TEST_F(StaLibertyTest, CellHasInternalPorts2) {
LibertyCell *buf = lib_->findLibertyCell("BUF_X1");
ASSERT_NE(buf, nullptr);
EXPECT_FALSE(buf->hasInternalPorts());
}
} // namespace sta

View File

@ -1298,12 +1298,6 @@ TEST(R6_CheckTableModelTest, CheckAxesInvalidAxis) {
// R6 tests: LibertyCell public properties
////////////////////////////////////////////////////////////////
TEST(R6_TestCellTest, HasInternalPortsDefault) {
LibertyLibrary lib("test_lib", "test.lib");
TestCell cell(&lib, "CELL1", "test.lib");
EXPECT_FALSE(cell.hasInternalPorts());
}
////////////////////////////////////////////////////////////////
// R6 tests: LibertyLibrary defaultIntrinsic rise/fall
////////////////////////////////////////////////////////////////
@ -2011,13 +2005,6 @@ TEST_F(StaLibertyTest, CellIsInverterNonInverter) {
EXPECT_FALSE(buf->isInverter());
}
// LibertyCell::hasInternalPorts
TEST_F(StaLibertyTest, CellHasInternalPorts3) {
LibertyCell *buf = lib_->findLibertyCell("BUF_X1");
ASSERT_NE(buf, nullptr);
// Simple buffer has no internal ports
EXPECT_FALSE(buf->hasInternalPorts());
}
// LibertyCell::isMacro
TEST_F(StaLibertyTest, CellIsMacro3) {

View File

@ -167,7 +167,7 @@ public:
class RecordingLibertyVisitor : public LibertyGroupVisitor {
public:
~RecordingLibertyVisitor() override
~RecordingLibertyVisitor()
{
for (const LibertyGroup *group : root_groups)
delete group;
@ -2212,18 +2212,6 @@ library(test_r9_64) {
}() ));
}
// R9_65: LibertyCell hasInternalPorts (read-only check)
TEST_F(StaLibertyTest, CellHasInternalPorts4) {
LibertyCell *dff = lib_->findLibertyCell("DFF_X1");
ASSERT_NE(dff, nullptr);
// DFF should have internal ports for state vars (IQ, IQN)
EXPECT_TRUE(dff->hasInternalPorts());
// A simple buffer should not
LibertyCell *buf = lib_->findLibertyCell("BUF_X1");
ASSERT_NE(buf, nullptr);
EXPECT_FALSE(buf->hasInternalPorts());
}
// R9_66: LibertyBuilder destructor (coverage)
TEST_F(StaLibertyTest, LibertyBuilderDestruct) {
ASSERT_NO_THROW(( [&](){

View File

@ -1107,27 +1107,6 @@ TEST_F(DeratingFactorsCellTest, IsOneValueDifferent) {
EXPECT_FALSE(is_one);
}
// DeratingFactorsNet tests
class DeratingFactorsNetTest : public ::testing::Test {};
TEST_F(DeratingFactorsNetTest, DefaultConstruction) {
DeratingFactorsNet dfn;
EXPECT_FALSE(dfn.hasValue());
}
TEST_F(DeratingFactorsNetTest, InheritsSetFactor) {
DeratingFactorsNet dfn;
dfn.setFactor(PathClkOrData::data, RiseFallBoth::riseFall(),
MinMax::max(), 1.05f);
EXPECT_TRUE(dfn.hasValue());
float factor;
bool exists;
dfn.factor(PathClkOrData::data, RiseFall::rise(), MinMax::max(),
factor, exists);
EXPECT_TRUE(exists);
EXPECT_FLOAT_EQ(factor, 1.05f);
}
////////////////////////////////////////////////////////////////
// ClockLatency tests
////////////////////////////////////////////////////////////////
@ -2453,7 +2432,7 @@ TEST_F(SdcInitTest, InputDriveSlews) {
TEST_F(SdcInitTest, InputDriveDriveCellsEqual) {
InputDrive drive;
// Set the same drive cell for all rise/fall min/max
float from_slews[2] = {0.1f, 0.2f};
DriveCellSlews from_slews = {0.1f, 0.2f};
drive.setDriveCell(nullptr, nullptr, nullptr, from_slews, nullptr,
RiseFallBoth::riseFall(), MinMaxAll::all());
EXPECT_TRUE(drive.driveCellsEqual());
@ -2461,32 +2440,33 @@ TEST_F(SdcInitTest, InputDriveDriveCellsEqual) {
// InputDriveCell tests
TEST_F(SdcInitTest, InputDriveCellAccessors) {
float from_slews[2] = {0.1f, 0.2f};
DriveCellSlews from_slews = {0.1f, 0.2f};
InputDriveCell dc(nullptr, nullptr, nullptr, from_slews, nullptr);
EXPECT_EQ(dc.library(), nullptr);
EXPECT_EQ(dc.cell(), nullptr);
EXPECT_EQ(dc.fromPort(), nullptr);
EXPECT_EQ(dc.toPort(), nullptr);
float *slews = dc.fromSlews();
EXPECT_NE(slews, nullptr);
const DriveCellSlews &slews = dc.fromSlews();
EXPECT_FLOAT_EQ(slews[0], 0.1f);
EXPECT_FLOAT_EQ(slews[1], 0.2f);
}
TEST_F(SdcInitTest, InputDriveCellSetters) {
float from_slews[2] = {0.1f, 0.2f};
DriveCellSlews from_slews = {0.1f, 0.2f};
InputDriveCell dc(nullptr, nullptr, nullptr, from_slews, nullptr);
dc.setLibrary(nullptr);
dc.setCell(nullptr);
dc.setFromPort(nullptr);
dc.setToPort(nullptr);
float new_slews[2] = {0.3f, 0.4f};
DriveCellSlews new_slews = {0.3f, 0.4f};
dc.setFromSlews(new_slews);
EXPECT_FLOAT_EQ(dc.fromSlews()[0], 0.3f);
EXPECT_FLOAT_EQ(dc.fromSlews()[1], 0.4f);
}
TEST_F(SdcInitTest, InputDriveCellEqual) {
float slews1[2] = {0.1f, 0.2f};
float slews2[2] = {0.1f, 0.2f};
DriveCellSlews slews1 = {0.1f, 0.2f};
DriveCellSlews slews2 = {0.1f, 0.2f};
InputDriveCell dc1(nullptr, nullptr, nullptr, slews1, nullptr);
InputDriveCell dc2(nullptr, nullptr, nullptr, slews2, nullptr);
EXPECT_TRUE(dc1.equal(&dc2));
@ -3432,9 +3412,9 @@ TEST_F(SdcInitTest, DeratingFactorsCellClear) {
}() ));
}
// DeratingFactorsNet: inherits DeratingFactors
TEST_F(SdcInitTest, DeratingFactorsNetOps) {
DeratingFactorsNet factors;
// DeratingFactors: inherits DeratingFactors
TEST_F(SdcInitTest, DeratingFactorsOps) {
DeratingFactors factors;
factors.setFactor(PathClkOrData::data,
RiseFallBoth::riseFall(), EarlyLate::late(), 1.1f);
EXPECT_TRUE(factors.hasValue());
@ -3582,7 +3562,7 @@ TEST_F(SdcInitTest, InputDriveSlewGetSet) {
// InputDrive: setDriveCell/driveCell/hasDriveCell
TEST_F(SdcInitTest, InputDriveCellGetSet) {
InputDrive drive;
float from_slews[2] = {0.1f, 0.2f};
DriveCellSlews from_slews = {0.1f, 0.2f};
drive.setDriveCell(nullptr, nullptr, nullptr, from_slews, nullptr,
RiseFallBoth::riseFall(), MinMaxAll::all());
EXPECT_TRUE(drive.hasDriveCell(RiseFall::rise(), MinMax::max()));
@ -3590,7 +3570,7 @@ TEST_F(SdcInitTest, InputDriveCellGetSet) {
EXPECT_NE(dc, nullptr);
const LibertyCell *cell;
const LibertyPort *from_port;
float *slews;
const DriveCellSlews *slews;
const LibertyPort *to_port;
drive.driveCell(RiseFall::rise(), MinMax::max(),
cell, from_port, slews, to_port);
@ -3874,9 +3854,9 @@ TEST_F(SdcInitTest, DeratingFactorsCellFactors) {
EXPECT_NE(f, nullptr);
}
// DeratingFactorsNet
TEST_F(SdcInitTest, DeratingFactorsNetConstruct) {
DeratingFactorsNet dfn;
// DeratingFactors
TEST_F(SdcInitTest, DeratingFactorsConstruct) {
DeratingFactors dfn;
EXPECT_FALSE(dfn.hasValue());
}

View File

@ -1487,7 +1487,7 @@ TEST_F(SdcDesignTest, WriteSdcWithDrivingCell) {
to_port = lp;
}
if (from_port && to_port) {
float from_slews[2] = {0.05f, 0.05f};
DriveCellSlews from_slews = {0.05f, 0.05f};
sta_->setDriveCell(lib, buf_cell, port,
from_port, from_slews, to_port,
RiseFallBoth::riseFall(), MinMaxAll::all(), sta_->cmdSdc());

View File

@ -1180,34 +1180,34 @@ TEST_F(SdcInitTest, LoopPathHash) {
TEST_F(SdcInitTest, FalsePathTypeString2) {
FalsePath fp(nullptr, nullptr, nullptr, MinMaxAll::all(), true, "");
const char *ts = fp.typeString();
EXPECT_NE(ts, nullptr);
std::string_view ts = fp.typeString();
EXPECT_FALSE(ts.empty());
}
TEST_F(SdcInitTest, PathDelayTypeString2) {
PathDelay pd(nullptr, nullptr, nullptr, MinMax::max(), false, false,
1.0e-9f, true, "");
const char *ts = pd.typeString();
EXPECT_NE(ts, nullptr);
std::string_view ts = pd.typeString();
EXPECT_FALSE(ts.empty());
}
TEST_F(SdcInitTest, MultiCyclePathTypeString2) {
MultiCyclePath mcp(nullptr, nullptr, nullptr, MinMaxAll::all(),
true, 2, true, "");
const char *ts = mcp.typeString();
EXPECT_NE(ts, nullptr);
std::string_view ts = mcp.typeString();
EXPECT_FALSE(ts.empty());
}
TEST_F(SdcInitTest, GroupPathTypeString2) {
GroupPath gp("g", false, nullptr, nullptr, nullptr, true, "");
const char *ts = gp.typeString();
EXPECT_NE(ts, nullptr);
std::string_view ts = gp.typeString();
EXPECT_FALSE(ts.empty());
}
TEST_F(SdcInitTest, FilterPathTypeString2) {
FilterPath flp(nullptr, nullptr, nullptr, true);
const char *ts = flp.typeString();
EXPECT_NE(ts, nullptr);
std::string_view ts = flp.typeString();
EXPECT_FALSE(ts.empty());
}
////////////////////////////////////////////////////////////////
@ -2016,25 +2016,6 @@ TEST_F(SdcInitTest, DeratingFactorsCellIsOneValue2) {
}
}
// DeratingFactorsNet
TEST_F(SdcInitTest, DeratingFactorsNetDefault) {
DeratingFactorsNet dfn;
EXPECT_FALSE(dfn.hasValue());
}
// DeratingFactorsNet set and get
TEST_F(SdcInitTest, DeratingFactorsNetSetGet) {
DeratingFactorsNet dfn;
dfn.setFactor(PathClkOrData::data, RiseFallBoth::riseFall(),
EarlyLate::late(), 1.03f);
float factor;
bool exists;
dfn.factor(PathClkOrData::data, RiseFall::fall(),
EarlyLate::late(), factor, exists);
EXPECT_TRUE(exists);
EXPECT_FLOAT_EQ(factor, 1.03f);
}
// ClockLatency construction
TEST_F(SdcInitTest, ClockLatencyConstruct2) {
ClockLatency lat(nullptr, nullptr);

View File

@ -4338,7 +4338,7 @@ TEST_F(StaDesignTest, WriteSdcDrivingCell) {
LibertyPort *from_port = buf_cell->findLibertyPort("A");
LibertyPort *to_port = buf_cell->findLibertyPort("Z");
if (from_port && to_port) {
float from_slews[2] = {0.03f, 0.03f};
DriveCellSlews from_slews = {0.03f, 0.03f};
sta_->setDriveCell(lib, buf_cell, port,
from_port, from_slews, to_port,
RiseFallBoth::riseFall(), MinMaxAll::all(), sta_->cmdSdc());

View File

@ -3834,12 +3834,6 @@ TEST_F(StaInitTest, PathEndDataClkPathDefault) {
EXPECT_EQ(pe.dataClkPath(), nullptr);
}
TEST_F(StaInitTest, PathEndSetupDefaultCycles) {
Path *p = new Path();
PathEndUnconstrained pe(p);
EXPECT_EQ(pe.setupDefaultCycles(), 1);
}
TEST_F(StaInitTest, PathEndPathDelayMarginIsExternal) {
Path *p = new Path();
PathEndUnconstrained pe(p);

View File

@ -354,9 +354,9 @@ TEST_F(StaInitTest, PropertiesDefineLibrary) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_lib_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Library*>::PropertyHandler(
[](const Library*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Library*>::PropertyHandler handler(
[](const Library*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -364,9 +364,9 @@ TEST_F(StaInitTest, PropertiesDefineLibertyLibrary) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_liblib_prop");
props.defineProperty(prop_name,
PropertyRegistry<const LibertyLibrary*>::PropertyHandler(
[](const LibertyLibrary*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const LibertyLibrary*>::PropertyHandler handler(
[](const LibertyLibrary*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -374,9 +374,9 @@ TEST_F(StaInitTest, PropertiesDefineCell) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_cell_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Cell*>::PropertyHandler(
[](const Cell*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Cell*>::PropertyHandler handler(
[](const Cell*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -384,9 +384,9 @@ TEST_F(StaInitTest, PropertiesDefineLibertyCell) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_libcell_prop");
props.defineProperty(prop_name,
PropertyRegistry<const LibertyCell*>::PropertyHandler(
[](const LibertyCell*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const LibertyCell*>::PropertyHandler handler(
[](const LibertyCell*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -394,9 +394,9 @@ TEST_F(StaInitTest, PropertiesDefinePort) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_port_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Port*>::PropertyHandler(
[](const Port*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Port*>::PropertyHandler handler(
[](const Port*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -404,9 +404,9 @@ TEST_F(StaInitTest, PropertiesDefineLibertyPort) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_libport_prop");
props.defineProperty(prop_name,
PropertyRegistry<const LibertyPort*>::PropertyHandler(
[](const LibertyPort*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const LibertyPort*>::PropertyHandler handler(
[](const LibertyPort*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -414,9 +414,9 @@ TEST_F(StaInitTest, PropertiesDefineInstance) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_inst_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Instance*>::PropertyHandler(
[](const Instance*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Instance*>::PropertyHandler handler(
[](const Instance*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -424,9 +424,9 @@ TEST_F(StaInitTest, PropertiesDefinePin) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_pin_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Pin*>::PropertyHandler(
[](const Pin*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Pin*>::PropertyHandler handler(
[](const Pin*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -434,9 +434,9 @@ TEST_F(StaInitTest, PropertiesDefineNet) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_net_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Net*>::PropertyHandler(
[](const Net*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Net*>::PropertyHandler handler(
[](const Net*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}
@ -444,9 +444,9 @@ TEST_F(StaInitTest, PropertiesDefineClock) {
ASSERT_NO_THROW(( [&](){
Properties props(sta_);
std::string prop_name("test_clk_prop");
props.defineProperty(prop_name,
PropertyRegistry<const Clock*>::PropertyHandler(
[](const Clock*, Sta*) -> PropertyValue { return PropertyValue(); }));
PropertyRegistry<const Clock*>::PropertyHandler handler(
[](const Clock*, Sta*) -> PropertyValue { return PropertyValue(); });
props.defineProperty(prop_name, handler);
}() ));
}