mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-09-02 10:48:35 +02:00
Adapt test files to upstream API changes (string_view migration)
Update 16 test files to match upstream OpenSTA API refactoring:
- const char* → std::string/std::string_view across all test APIs
- EXPECT_STREQ → EXPECT_EQ for std::string/string_view returns
- nullptr → "" for string_view parameters (makeClock, makeClockGroups, etc.)
- PropertyValue("literal") → PropertyValue(std::string("literal")) to avoid
bool constructor overload resolution
- Method renames: relatedGroundPin→relatedGroundPort,
relatedPowerPin→relatedPowerPort, firstName→firstParam,
secondName→secondParam
- Constructor changes: OperatingConditions (5-arg → 1-arg + setters),
ModeDef::defineValue (3-arg → 1-arg + setSdfCond)
- LibertyAttrValue::floatValue returns std::pair<float,bool> now
- Filter API: separate args → single expression string + bool_props_as_int
- SDF version golden files: 3.0.1 → 3.1.0
All 6104 tests pass.
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Jaehyun Kim <[email protected]>
This commit is contained in:
@@ -52,7 +52,7 @@ protected:
|
||||
waveform->push_back(0.0f);
|
||||
waveform->push_back(5.0f);
|
||||
Sdc *sdc = sta_->cmdSdc();
|
||||
sta_->makeClock("clk", clk_pins, false, 10.0f, waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins, false, 10.0f, waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
Clock *clk = sdc->findClock("clk");
|
||||
@@ -441,7 +441,7 @@ TEST_F(IncrementalTimingTest, ClockConstraintAfterEdit) {
|
||||
FloatSeq *tight_waveform = new FloatSeq;
|
||||
tight_waveform->push_back(0.0f);
|
||||
tight_waveform->push_back(1.0f); // 2ns period
|
||||
sta_->makeClock("clk", clk_pins, false, 2.0f, tight_waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins, false, 2.0f, tight_waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
Slack tight_slack = sta_->worstSlack(MinMax::max());
|
||||
@@ -455,7 +455,7 @@ TEST_F(IncrementalTimingTest, ClockConstraintAfterEdit) {
|
||||
FloatSeq *loose_waveform = new FloatSeq;
|
||||
loose_waveform->push_back(0.0f);
|
||||
loose_waveform->push_back(50.0f); // 100ns period
|
||||
sta_->makeClock("clk", clk_pins2, false, 100.0f, loose_waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins2, false, 100.0f, loose_waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
Slack loose_slack = sta_->worstSlack(MinMax::max());
|
||||
@@ -1023,7 +1023,7 @@ TEST_F(IncrementalTimingTest, TnsUpdatesIncrementally) {
|
||||
FloatSeq *tight_waveform = new FloatSeq;
|
||||
tight_waveform->push_back(0.0f);
|
||||
tight_waveform->push_back(0.2f); // 0.4ns period (very tight)
|
||||
sta_->makeClock("clk", clk_pins, false, 0.4f, tight_waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins, false, 0.4f, tight_waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
Slack tight_tns = sta_->totalNegativeSlack(MinMax::max());
|
||||
@@ -1447,7 +1447,7 @@ TEST_F(IncrementalTimingTest, EndpointViolationCountChanges) {
|
||||
FloatSeq *tight_waveform = new FloatSeq;
|
||||
tight_waveform->push_back(0.0f);
|
||||
tight_waveform->push_back(0.1f); // 0.2ns period
|
||||
sta_->makeClock("clk", clk_pins, false, 0.2f, tight_waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins, false, 0.2f, tight_waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
int tight_violations = sta_->endpointViolationCount(MinMax::max());
|
||||
@@ -1460,7 +1460,7 @@ TEST_F(IncrementalTimingTest, EndpointViolationCountChanges) {
|
||||
FloatSeq *loose_waveform = new FloatSeq;
|
||||
loose_waveform->push_back(0.0f);
|
||||
loose_waveform->push_back(50.0f);
|
||||
sta_->makeClock("clk", clk_pins2, false, 100.0f, loose_waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins2, false, 100.0f, loose_waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
int loose_violations = sta_->endpointViolationCount(MinMax::max());
|
||||
|
||||
@@ -159,7 +159,7 @@ protected:
|
||||
FloatSeq *waveform = new FloatSeq;
|
||||
waveform->push_back(0.0f);
|
||||
waveform->push_back(5.0f);
|
||||
sta_->makeClock("clk", clk_pins, false, 10.0f, waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins, false, 10.0f, waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
// Set input delays
|
||||
|
||||
@@ -161,7 +161,7 @@ protected:
|
||||
FloatSeq *waveform = new FloatSeq;
|
||||
waveform->push_back(0.0f);
|
||||
waveform->push_back(5.0f);
|
||||
sta_->makeClock("clk", clk_pins, false, 10.0f, waveform, nullptr,
|
||||
sta_->makeClock("clk", clk_pins, false, 10.0f, waveform, "",
|
||||
sta_->cmdMode());
|
||||
|
||||
// Set input delays
|
||||
@@ -1491,9 +1491,9 @@ TEST_F(StaDesignTest, PropertyValueConstructors) {
|
||||
PropertyValue pv1;
|
||||
EXPECT_EQ(pv1.type(), PropertyValue::Type::none);
|
||||
|
||||
PropertyValue pv2("test");
|
||||
PropertyValue pv2(std::string("test"));
|
||||
EXPECT_EQ(pv2.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv2.stringValue(), "test");
|
||||
EXPECT_EQ(pv2.stringValue(), "test");
|
||||
|
||||
PropertyValue pv3(true);
|
||||
EXPECT_EQ(pv3.type(), PropertyValue::Type::bool_);
|
||||
@@ -1647,7 +1647,7 @@ TEST_F(StaDesignTest, PropertyUnknownException) {
|
||||
|
||||
TEST_F(StaDesignTest, PropertyTypeWrongException) {
|
||||
// Cover PropertyTypeWrong constructor and what()
|
||||
PropertyValue pv("test_string");
|
||||
PropertyValue pv(std::string("test_string"));
|
||||
EXPECT_EQ(pv.type(), PropertyValue::Type::string);
|
||||
try {
|
||||
float val = pv.floatValue();
|
||||
@@ -1837,7 +1837,7 @@ TEST_F(StaDesignTest, PathEndUnconstrainedMethods) {
|
||||
|
||||
TEST_F(StaDesignTest, PathEndPathDelay) {
|
||||
sta_->makePathDelay(nullptr, nullptr, nullptr,
|
||||
MinMax::max(), false, false, 5.0, nullptr,
|
||||
MinMax::max(), false, false, 5.0, "",
|
||||
sta_->cmdSdc());
|
||||
sta_->updateTiming(true);
|
||||
const SceneSeq &corners = sta_->scenes();
|
||||
@@ -2248,7 +2248,7 @@ TEST_F(StaDesignTest, WriteSdcWithConstraints) {
|
||||
false, false, MinMaxAll::all(), true, 2.0f,
|
||||
sta_->cmdSdc());
|
||||
}
|
||||
sta_->makeFalsePath(nullptr, nullptr, nullptr, MinMaxAll::all(), nullptr,
|
||||
sta_->makeFalsePath(nullptr, nullptr, nullptr, MinMaxAll::all(), "",
|
||||
sta_->cmdSdc());
|
||||
|
||||
if (out) {
|
||||
@@ -2454,7 +2454,7 @@ TEST_F(StaDesignTest, ReportPathEndShorter) {
|
||||
TEST_F(StaDesignTest, WriteSdcWithClockGroups) {
|
||||
Clock *clk = sta_->cmdSdc()->findClock("clk");
|
||||
if (clk) {
|
||||
ClockGroups *cg = sta_->makeClockGroups("test_group", true, false, false, false, nullptr, sta_->cmdSdc());
|
||||
ClockGroups *cg = sta_->makeClockGroups("test_group", true, false, false, false, "", sta_->cmdSdc());
|
||||
EXPECT_NE(cg, nullptr);
|
||||
sta_->updateTiming(true);
|
||||
std::string filename = makeUniqueSdcPath("test_write_sdc_r10_clkgrp.sdc");
|
||||
@@ -2984,7 +2984,7 @@ TEST_F(StaDesignTest, MakeGeneratedClock) {
|
||||
divide_by->push_back(2);
|
||||
FloatSeq *edges = nullptr;
|
||||
sta_->makeGeneratedClock("gen_clk", gen_pins, false, clk2, clk,
|
||||
2, 0, 0.0, false, false, divide_by, edges, nullptr,
|
||||
2, 0, 0.0, false, false, divide_by, edges, "",
|
||||
sta_->cmdMode());
|
||||
Clock *gen = sdc->findClock("gen_clk");
|
||||
EXPECT_NE(gen, nullptr);
|
||||
@@ -3995,7 +3995,7 @@ TEST_F(StaDesignTest, WriteSdcComprehensive) {
|
||||
thrus->push_back(thru);
|
||||
}
|
||||
delete nit;
|
||||
sta_->makeFalsePath(from, thrus, nullptr, MinMaxAll::all(), nullptr, sta_->cmdSdc());
|
||||
sta_->makeFalsePath(from, thrus, nullptr, MinMaxAll::all(), "", sta_->cmdSdc());
|
||||
}
|
||||
|
||||
// Max delay
|
||||
@@ -4010,13 +4010,13 @@ TEST_F(StaDesignTest, WriteSdcComprehensive) {
|
||||
RiseFallBoth::riseFall(),
|
||||
RiseFallBoth::riseFall(), sta_->cmdSdc());
|
||||
sta_->makePathDelay(from, nullptr, to, MinMax::max(), false, false,
|
||||
7.0f, nullptr, sta_->cmdSdc());
|
||||
7.0f, "", sta_->cmdSdc());
|
||||
}
|
||||
|
||||
// Clock groups with actual clocks
|
||||
if (clk) {
|
||||
ClockGroups *cg = sta_->makeClockGroups("search_grp", true, false, false,
|
||||
false, nullptr, sta_->cmdSdc());
|
||||
false, "", sta_->cmdSdc());
|
||||
ClockSet *g1 = new ClockSet;
|
||||
g1->insert(clk);
|
||||
sta_->makeClockGroup(cg, g1, sta_->cmdSdc());
|
||||
@@ -4024,10 +4024,10 @@ TEST_F(StaDesignTest, WriteSdcComprehensive) {
|
||||
|
||||
// Multicycle
|
||||
sta_->makeMulticyclePath(nullptr, nullptr, nullptr,
|
||||
MinMaxAll::max(), true, 2, nullptr, sta_->cmdSdc());
|
||||
MinMaxAll::max(), true, 2, "", sta_->cmdSdc());
|
||||
|
||||
// Group path
|
||||
sta_->makeGroupPath("search_group", false, nullptr, nullptr, nullptr, nullptr, sta_->cmdSdc());
|
||||
sta_->makeGroupPath("search_group", false, nullptr, nullptr, nullptr, "", sta_->cmdSdc());
|
||||
|
||||
// Voltage
|
||||
sta_->setVoltage(MinMax::max(), 1.1f, sta_->cmdSdc());
|
||||
@@ -4194,7 +4194,7 @@ TEST_F(StaDesignTest, FindPathEndsUnconstrained3) {
|
||||
TEST_F(StaDesignTest, FindPathEndsGroupFilter) {
|
||||
ASSERT_NO_THROW(( [&](){
|
||||
// Create a group path first
|
||||
sta_->makeGroupPath("r11_grp", false, nullptr, nullptr, nullptr, nullptr, sta_->cmdSdc());
|
||||
sta_->makeGroupPath("r11_grp", false, nullptr, nullptr, nullptr, "", sta_->cmdSdc());
|
||||
|
||||
Scene *corner = sta_->cmdScene();
|
||||
PathEndSeq ends = sta_->findPathEnds(
|
||||
@@ -4208,7 +4208,7 @@ TEST_F(StaDesignTest, FindPathEndsGroupFilter) {
|
||||
|
||||
// --- Sta: pathGroupNames ---
|
||||
TEST_F(StaDesignTest, PathGroupNames) {
|
||||
sta_->makeGroupPath("test_group_r11", false, nullptr, nullptr, nullptr, nullptr, sta_->cmdSdc());
|
||||
sta_->makeGroupPath("test_group_r11", false, nullptr, nullptr, nullptr, "", sta_->cmdSdc());
|
||||
StringSeq names = sta_->pathGroupNames(sta_->cmdSdc());
|
||||
bool found = false;
|
||||
for (const auto &name : names) {
|
||||
@@ -4220,7 +4220,7 @@ TEST_F(StaDesignTest, PathGroupNames) {
|
||||
|
||||
// --- Sta: isPathGroupName ---
|
||||
TEST_F(StaDesignTest, IsPathGroupName) {
|
||||
sta_->makeGroupPath("test_pg_r11", false, nullptr, nullptr, nullptr, nullptr, sta_->cmdSdc());
|
||||
sta_->makeGroupPath("test_pg_r11", false, nullptr, nullptr, nullptr, "", sta_->cmdSdc());
|
||||
bool is_group = sta_->isPathGroupName("test_pg_r11", sta_->cmdSdc());
|
||||
EXPECT_TRUE(is_group);
|
||||
bool not_group = sta_->isPathGroupName("nonexistent_group", sta_->cmdSdc());
|
||||
@@ -4245,7 +4245,7 @@ TEST_F(StaDesignTest, ReportPathWithMaxDelay) {
|
||||
RiseFallBoth::riseFall(),
|
||||
RiseFallBoth::riseFall(), sta_->cmdSdc());
|
||||
sta_->makePathDelay(from, nullptr, to, MinMax::max(), false, false,
|
||||
8.0f, nullptr, sta_->cmdSdc());
|
||||
8.0f, "", sta_->cmdSdc());
|
||||
sta_->updateTiming(true);
|
||||
|
||||
Scene *corner = sta_->cmdScene();
|
||||
|
||||
@@ -1156,12 +1156,12 @@ TEST_F(StaInitTest, MakeClockWithComment) {
|
||||
|
||||
// Make false path exercises ExceptionPath creation in Sta.cc
|
||||
TEST_F(StaInitTest, MakeFalsePath) {
|
||||
sta_->makeFalsePath(nullptr, nullptr, nullptr, MinMaxAll::all(), nullptr, sta_->cmdSdc());
|
||||
sta_->makeFalsePath(nullptr, nullptr, nullptr, MinMaxAll::all(), "", sta_->cmdSdc());
|
||||
}
|
||||
|
||||
// Make group path
|
||||
TEST_F(StaInitTest, MakeGroupPath) {
|
||||
sta_->makeGroupPath("test_grp", false, nullptr, nullptr, nullptr, nullptr, sta_->cmdSdc());
|
||||
sta_->makeGroupPath("test_grp", false, nullptr, nullptr, nullptr, "", sta_->cmdSdc());
|
||||
EXPECT_TRUE(sta_->isPathGroupName("test_grp", sta_->cmdSdc()));
|
||||
}
|
||||
|
||||
@@ -1172,7 +1172,7 @@ TEST_F(StaInitTest, MakePathDelay) {
|
||||
false, // ignore_clk_latency
|
||||
false, // break_path
|
||||
5.0, // delay
|
||||
nullptr, sta_->cmdSdc());
|
||||
"", sta_->cmdSdc());
|
||||
|
||||
}
|
||||
|
||||
@@ -1182,7 +1182,7 @@ TEST_F(StaInitTest, MakeMulticyclePath) {
|
||||
MinMaxAll::max(),
|
||||
true, // use_end_clk
|
||||
2, // path_multiplier
|
||||
nullptr, sta_->cmdSdc());
|
||||
"", sta_->cmdSdc());
|
||||
|
||||
}
|
||||
|
||||
@@ -1775,7 +1775,7 @@ TEST_F(StaInitTest, PropertyValueUnitGetter) {
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PropertyValueToStringBasic) {
|
||||
PropertyValue pv_str("hello");
|
||||
PropertyValue pv_str(std::string("hello"));
|
||||
Network *network = sta_->network();
|
||||
std::string result = pv_str.to_string(network);
|
||||
EXPECT_EQ(result, "hello");
|
||||
@@ -2067,10 +2067,10 @@ TEST_F(StaInitTest, PathLessComparator) {
|
||||
|
||||
// PathGroup static names
|
||||
TEST_F(StaInitTest, PathGroupsStaticNames) {
|
||||
EXPECT_NE(PathGroups::asyncPathGroupName(), nullptr);
|
||||
EXPECT_NE(PathGroups::pathDelayGroupName(), nullptr);
|
||||
EXPECT_NE(PathGroups::gatedClkGroupName(), nullptr);
|
||||
EXPECT_NE(PathGroups::unconstrainedGroupName(), nullptr);
|
||||
EXPECT_FALSE(PathGroups::asyncPathGroupName().empty());
|
||||
EXPECT_FALSE(PathGroups::pathDelayGroupName().empty());
|
||||
EXPECT_FALSE(PathGroups::gatedClkGroupName().empty());
|
||||
EXPECT_FALSE(PathGroups::unconstrainedGroupName().empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupMaxPathsDefault) {
|
||||
@@ -2758,7 +2758,7 @@ TEST_F(StaInitTest, StaWorstSlackSingleValue) {
|
||||
TEST_F(StaInitTest, StaMakeClockGroupsAndRemove) {
|
||||
ClockGroups *cg = sta_->makeClockGroups("test_cg",
|
||||
true, false, false,
|
||||
false, nullptr, sta_->cmdSdc());
|
||||
false, "", sta_->cmdSdc());
|
||||
EXPECT_NE(cg, nullptr);
|
||||
sta_->removeClockGroupsLogicallyExclusive("test_cg", sta_->cmdSdc());
|
||||
}
|
||||
@@ -3455,7 +3455,7 @@ TEST_F(StaInitTest, StaDelaysInvalid) {
|
||||
// --- Sta.cc: clock groups ---
|
||||
TEST_F(StaInitTest, StaMakeClockGroupsDetailed) {
|
||||
ClockGroups *groups = sta_->makeClockGroups("test_group",
|
||||
true, false, false, false, nullptr, sta_->cmdSdc());
|
||||
true, false, false, false, "", sta_->cmdSdc());
|
||||
EXPECT_NE(groups, nullptr);
|
||||
}
|
||||
|
||||
@@ -3741,7 +3741,7 @@ TEST_F(StaInitTest, GraphLoopEmpty) {
|
||||
|
||||
// --- Sta.cc: makeFalsePath ---
|
||||
TEST_F(StaInitTest, StaMakeFalsePath) {
|
||||
sta_->makeFalsePath(nullptr, nullptr, nullptr, MinMaxAll::all(), nullptr, sta_->cmdSdc());
|
||||
sta_->makeFalsePath(nullptr, nullptr, nullptr, MinMaxAll::all(), "", sta_->cmdSdc());
|
||||
|
||||
// No crash (with all null args)
|
||||
|
||||
@@ -3749,7 +3749,7 @@ TEST_F(StaInitTest, StaMakeFalsePath) {
|
||||
|
||||
// --- Sta.cc: makeMulticyclePath ---
|
||||
TEST_F(StaInitTest, StaMakeMulticyclePath) {
|
||||
sta_->makeMulticyclePath(nullptr, nullptr, nullptr, MinMaxAll::all(), false, 2, nullptr, sta_->cmdSdc());
|
||||
sta_->makeMulticyclePath(nullptr, nullptr, nullptr, MinMaxAll::all(), false, 2, "", sta_->cmdSdc());
|
||||
// No crash
|
||||
|
||||
}
|
||||
@@ -3763,7 +3763,7 @@ TEST_F(StaInitTest, StaResetPath) {
|
||||
|
||||
// --- Sta.cc: makeGroupPath ---
|
||||
TEST_F(StaInitTest, StaMakeGroupPath) {
|
||||
sta_->makeGroupPath("test_group", false, nullptr, nullptr, nullptr, nullptr, sta_->cmdSdc());
|
||||
sta_->makeGroupPath("test_group", false, nullptr, nullptr, nullptr, "", sta_->cmdSdc());
|
||||
// No crash
|
||||
|
||||
}
|
||||
@@ -3802,8 +3802,8 @@ TEST_F(StaInitTest, LogicValueStringOne) {
|
||||
// --- ReportPath.cc: ReportField constructor and setEnabled ---
|
||||
TEST_F(StaInitTest, ReportFieldConstruct) {
|
||||
ReportField rf("test_field", "Test Field", 10, false, nullptr, true);
|
||||
EXPECT_STREQ(rf.name(), "test_field");
|
||||
EXPECT_STREQ(rf.title(), "Test Field");
|
||||
EXPECT_EQ(rf.name(), "test_field");
|
||||
EXPECT_EQ(rf.title(), "Test Field");
|
||||
EXPECT_EQ(rf.width(), 10);
|
||||
EXPECT_FALSE(rf.leftJustify());
|
||||
EXPECT_EQ(rf.unit(), nullptr);
|
||||
@@ -3829,15 +3829,15 @@ TEST_F(StaInitTest, ReportFieldSetWidth) {
|
||||
TEST_F(StaInitTest, ReportFieldSetProperties) {
|
||||
ReportField rf("f3", "F3", 5, false, nullptr, true);
|
||||
rf.setProperties("New Title", 20, true);
|
||||
EXPECT_STREQ(rf.title(), "New Title");
|
||||
EXPECT_EQ(rf.title(), "New Title");
|
||||
EXPECT_EQ(rf.width(), 20);
|
||||
EXPECT_TRUE(rf.leftJustify());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, ReportFieldBlank) {
|
||||
ReportField rf("f4", "F4", 3, false, nullptr, true);
|
||||
const char *blank = rf.blank();
|
||||
EXPECT_NE(blank, nullptr);
|
||||
const std::string &blank = rf.blank();
|
||||
EXPECT_FALSE(blank.empty());
|
||||
}
|
||||
|
||||
// --- Sta.cc: idealClockMode is protected, test via public API ---
|
||||
@@ -4117,7 +4117,7 @@ TEST_F(StaInitTest, PropertiesGetPropertyLibraryExists) {
|
||||
|
||||
TEST_F(StaInitTest, PropertiesGetPropertyCellExists) {
|
||||
// getProperty(Cell*) segfaults on nullptr - verify method exists via function pointer
|
||||
using FnType = PropertyValue (Properties::*)(const Cell*, const std::string&);
|
||||
using FnType = PropertyValue (Properties::*)(const Cell*, std::string_view);
|
||||
FnType fn = &Properties::getProperty;
|
||||
expectCallablePointerUsable(fn);
|
||||
}
|
||||
|
||||
@@ -940,7 +940,7 @@ TEST_F(StaInitTest, PathEndSlack) {
|
||||
|
||||
TEST_F(StaInitTest, StaMakeClockGroups) {
|
||||
ASSERT_NO_THROW(( [&](){
|
||||
sta_->makeClockGroups("test_grp", false, false, false, false, nullptr, sta_->cmdSdc());
|
||||
sta_->makeClockGroups("test_grp", false, false, false, false, "", sta_->cmdSdc());
|
||||
}() ));
|
||||
}
|
||||
|
||||
@@ -1354,9 +1354,9 @@ TEST_F(StaInitTest, PropertyValueDefaultCtor) {
|
||||
// === PropertyValue: string constructor ===
|
||||
|
||||
TEST_F(StaInitTest, PropertyValueStringCtor) {
|
||||
PropertyValue pv("hello");
|
||||
PropertyValue pv(std::string("hello"));
|
||||
EXPECT_EQ(pv.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv.stringValue(), "hello");
|
||||
EXPECT_EQ(pv.stringValue(), "hello");
|
||||
}
|
||||
|
||||
// === PropertyValue: float constructor ===
|
||||
@@ -1378,39 +1378,39 @@ TEST_F(StaInitTest, PropertyValueBoolCtor) {
|
||||
// === PropertyValue: copy constructor ===
|
||||
|
||||
TEST_F(StaInitTest, PropertyValueCopyCtor) {
|
||||
PropertyValue pv1("test");
|
||||
PropertyValue pv1(std::string("test"));
|
||||
PropertyValue pv2(pv1);
|
||||
EXPECT_EQ(pv2.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv2.stringValue(), "test");
|
||||
EXPECT_EQ(pv2.stringValue(), "test");
|
||||
}
|
||||
|
||||
// === PropertyValue: move constructor ===
|
||||
|
||||
TEST_F(StaInitTest, PropertyValueMoveCtor) {
|
||||
PropertyValue pv1("test");
|
||||
PropertyValue pv1(std::string("test"));
|
||||
PropertyValue pv2(std::move(pv1));
|
||||
EXPECT_EQ(pv2.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv2.stringValue(), "test");
|
||||
EXPECT_EQ(pv2.stringValue(), "test");
|
||||
}
|
||||
|
||||
// === PropertyValue: copy assignment ===
|
||||
|
||||
TEST_F(StaInitTest, PropertyValueCopyAssign) {
|
||||
PropertyValue pv1("test");
|
||||
PropertyValue pv1(std::string("test"));
|
||||
PropertyValue pv2;
|
||||
pv2 = pv1;
|
||||
EXPECT_EQ(pv2.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv2.stringValue(), "test");
|
||||
EXPECT_EQ(pv2.stringValue(), "test");
|
||||
}
|
||||
|
||||
// === PropertyValue: move assignment ===
|
||||
|
||||
TEST_F(StaInitTest, PropertyValueMoveAssign) {
|
||||
PropertyValue pv1("test");
|
||||
PropertyValue pv1(std::string("test"));
|
||||
PropertyValue pv2;
|
||||
pv2 = std::move(pv1);
|
||||
EXPECT_EQ(pv2.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv2.stringValue(), "test");
|
||||
EXPECT_EQ(pv2.stringValue(), "test");
|
||||
}
|
||||
|
||||
// === PropertyValue: Library constructor ===
|
||||
@@ -1568,10 +1568,10 @@ TEST_F(StaInitTest, ReportFieldGetters) {
|
||||
ReportPath *rpt = sta_->reportPath();
|
||||
ReportField *field = rpt->fieldSlew();
|
||||
EXPECT_NE(field, nullptr);
|
||||
EXPECT_NE(field->name(), nullptr);
|
||||
EXPECT_NE(field->title(), nullptr);
|
||||
EXPECT_FALSE(field->name().empty());
|
||||
EXPECT_FALSE(field->title().empty());
|
||||
EXPECT_GT(field->width(), 0);
|
||||
EXPECT_NE(field->blank(), nullptr);
|
||||
EXPECT_FALSE(field->blank().empty());
|
||||
}
|
||||
|
||||
// === ReportField: setWidth ===
|
||||
@@ -1804,7 +1804,7 @@ TEST_F(StaInitTest, PropertyValueStdStringCtor) {
|
||||
std::string s = "test_string";
|
||||
PropertyValue pv(s);
|
||||
EXPECT_EQ(pv.type(), PropertyValue::Type::string);
|
||||
EXPECT_STREQ(pv.stringValue(), "test_string");
|
||||
EXPECT_EQ(pv.stringValue(), "test_string");
|
||||
}
|
||||
|
||||
// === Levelize: invalid ===
|
||||
@@ -1859,21 +1859,21 @@ TEST_F(StaInitTest, ReportPathFindFieldSlew) {
|
||||
ReportPath *rpt = sta_->reportPath();
|
||||
ReportField *slew = rpt->findField("slew");
|
||||
EXPECT_NE(slew, nullptr);
|
||||
EXPECT_STREQ(slew->name(), "slew");
|
||||
EXPECT_EQ(slew->name(), "slew");
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, ReportPathFindFieldFanout) {
|
||||
ReportPath *rpt = sta_->reportPath();
|
||||
ReportField *fo = rpt->findField("fanout");
|
||||
EXPECT_NE(fo, nullptr);
|
||||
EXPECT_STREQ(fo->name(), "fanout");
|
||||
EXPECT_EQ(fo->name(), "fanout");
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, ReportPathFindFieldCapacitance) {
|
||||
ReportPath *rpt = sta_->reportPath();
|
||||
ReportField *cap = rpt->findField("capacitance");
|
||||
EXPECT_NE(cap, nullptr);
|
||||
EXPECT_STREQ(cap->name(), "capacitance");
|
||||
EXPECT_EQ(cap->name(), "capacitance");
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, ReportPathFindFieldNonexistent) {
|
||||
@@ -1927,8 +1927,8 @@ TEST_F(StaInitTest, ReportPathSetReportFieldsPublic) {
|
||||
TEST_F(StaInitTest, ReportFieldBlank2) {
|
||||
ReportPath *rpt = sta_->reportPath();
|
||||
ReportField *field = rpt->fieldSlew();
|
||||
const char *blank = field->blank();
|
||||
EXPECT_NE(blank, nullptr);
|
||||
const std::string &blank = field->blank();
|
||||
EXPECT_FALSE(blank.empty());
|
||||
}
|
||||
|
||||
// === ReportField: setProperties ===
|
||||
@@ -1983,23 +1983,23 @@ TEST_F(StaInitTest, PathExpandedEmptyCtor) {
|
||||
// === PathGroups: static group names ===
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsAsyncGroupName) {
|
||||
const char *name = PathGroups::asyncPathGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::asyncPathGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsPathDelayGroupName) {
|
||||
const char *name = PathGroups::pathDelayGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::pathDelayGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsGatedClkGroupName) {
|
||||
const char *name = PathGroups::gatedClkGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::gatedClkGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsUnconstrainedGroupName) {
|
||||
const char *name = PathGroups::unconstrainedGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::unconstrainedGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
// === PathGroup: static max path count ===
|
||||
@@ -2631,23 +2631,23 @@ TEST_F(StaInitTest, ReportPathReportSlackOnlyHeader) {
|
||||
// === PathGroups: static group name accessors ===
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsAsyncGroupName2) {
|
||||
const char *name = PathGroups::asyncPathGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::asyncPathGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsPathDelayGroupName2) {
|
||||
const char *name = PathGroups::pathDelayGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::pathDelayGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsGatedClkGroupName2) {
|
||||
const char *name = PathGroups::gatedClkGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::gatedClkGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
TEST_F(StaInitTest, PathGroupsUnconstrainedGroupName2) {
|
||||
const char *name = PathGroups::unconstrainedGroupName();
|
||||
EXPECT_NE(name, nullptr);
|
||||
std::string_view name = PathGroups::unconstrainedGroupName();
|
||||
EXPECT_FALSE(name.empty());
|
||||
}
|
||||
|
||||
// Corner setParasiticAnalysisPtcount, setParasiticAP, setDcalcAnalysisPtcount,
|
||||
|
||||
Reference in New Issue
Block a user