Merge pull request #316 from The-OpenROAD-Project-staging/sta_update_test_infra_to_update_sta_OR

fix warnings
This commit is contained in:
Matt Liberty 2026-03-25 15:43:56 +00:00 committed by GitHub
commit ea5531ec19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 11 additions and 13 deletions

View File

@ -1993,8 +1993,6 @@ TEST_F(LinearModelTest, Table3ReportValue) {
TEST_F(LinearModelTest, TableModelReport) {
TablePtr tbl = std::make_shared<Table>(42.0f);
TableModel model(tbl, nullptr, ScaleFactorType::cell, RiseFall::rise());
const Units *units = lib_->units();
Report *report_obj = nullptr;
// report needs Report*; test order/axes instead
EXPECT_EQ(model.order(), 0);
EXPECT_EQ(model.axis1(), nullptr);
@ -3285,8 +3283,9 @@ TEST(TestCellTest, FootprintDefault) {
TestCell cell(&lib, "CELL1", "test.lib");
const char *fp = cell.footprint();
// Empty string or nullptr for default
if (fp)
if (fp) {
EXPECT_EQ(fp, "");
}
}
TEST(TestCellTest, SetFootprint) {
@ -3300,8 +3299,9 @@ TEST(TestCellTest, UserFunctionClassDefault) {
LibertyLibrary lib("test_lib", "test.lib");
TestCell cell(&lib, "CELL1", "test.lib");
const char *ufc = cell.userFunctionClass();
if (ufc)
if (ufc) {
EXPECT_EQ(ufc, "");
}
}
TEST(TestCellTest, SetUserFunctionClass) {

View File

@ -1141,7 +1141,6 @@ TEST(ConcreteNetworkTest, FindCellViaNetwork) {
TEST(ConcreteNetworkTest, FindAnyCell) {
ConcreteNetwork network;
Library *lib1 = network.makeLibrary("lib1", "lib1.lib");
Library *lib2 = network.makeLibrary("lib2", "lib2.lib");
network.makeCell(lib1, "INV_X1", true, "lib1.lib");
Cell *found = network.findAnyCell("INV_X1");
EXPECT_NE(found, nullptr);

View File

@ -1304,7 +1304,6 @@ TEST_F(StaParasiticsTest, ParasiticNodeResistorMap) {
// Test findNode (deprecated) - delegates to findParasiticNode
TEST_F(StaParasiticsTest, FindNodeDeprecated) {
ASSERT_NO_THROW(( [&](){
Parasitics *parasitics = sta_->findParasitics("default");
ConcretePiElmore pe(1e-12f, 100.0f, 2e-12f);
// findNode on non-network parasitic should work but return nullptr
// since it's not a parasitic network
@ -1317,7 +1316,6 @@ TEST_F(StaParasiticsTest, FindNodeDeprecated) {
// Test unannotatedLoads through parasitics API with PiElmore
TEST_F(StaParasiticsTest, UnannotatedLoadsPiElmore) {
ASSERT_NO_THROW(( [&](){
Parasitics *parasitics = sta_->findParasitics("default");
ConcretePiElmore pe(1e-12f, 100.0f, 2e-12f);
// With no network loads, should just return what parasitics->loads returns
// which needs a connected pin. With nullptr pin, this will likely crash

View File

@ -3542,8 +3542,6 @@ TEST_F(SdcInitTest, DisabledPortsSetAll) {
// PortExtCap: operations (needs Port* constructor)
TEST_F(SdcInitTest, PortExtCapSetGet) {
// Need a port to construct PortExtCap
Network *network = sta_->cmdNetwork();
// PortExtCap default constructor
PortExtCap pec;
pec.setPinCap(nullptr, 0.1f, RiseFall::rise(), MinMax::max());

View File

@ -1302,8 +1302,12 @@ TEST_F(SpiceSmokeTest, RiseFallRangeValues) {
auto range = RiseFall::range();
int idx = 0;
for (auto rf : range) {
if (idx == 0) EXPECT_EQ(rf, RiseFall::rise());
if (idx == 1) EXPECT_EQ(rf, RiseFall::fall());
if (idx == 0) {
EXPECT_EQ(rf, RiseFall::rise());
}
if (idx == 1) {
EXPECT_EQ(rf, RiseFall::fall());
}
idx++;
}
EXPECT_EQ(idx, 2);
@ -1554,7 +1558,6 @@ TEST_F(SpiceDesignTest, LibertyCellTimingArcs) {
// Verify pin connectivity for SPICE net writing
TEST_F(SpiceDesignTest, PinConnectivity) {
Network *network = sta_->cmdNetwork();
Instance *top = network->topInstance();
// The internal net n1 connects and1:ZN to buf1:A
Pin *and1_zn = network->findPin("and1/ZN");

View File

@ -316,7 +316,7 @@ TEST_F(VerilogTest, EscapedWithBackslash) {
std::string name = "\\a\\b ";
std::string result = instanceVerilogToSta(&name);
EXPECT_FALSE(result.empty());
// The backslash inside should be escaped as \\
// The backslash inside should be escaped as double-backslash
EXPECT_NE(result.find("\\\\"), std::string::npos);
}