test: Refactoring. Standardize Google Test naming conventions by removing `R#_` prefixes, improve temporary file creation with `mkstemp`, etc

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
This commit is contained in:
Jaehyun Kim 2026-02-13 20:36:42 +09:00
parent d6c09372ba
commit b77779f7a6
14 changed files with 3250 additions and 3262 deletions

File diff suppressed because it is too large Load Diff

View File

@ -480,7 +480,7 @@ TEST(VertexStandaloneTest, SlewsDefault)
// Test Edge::arcDelayAnnotateBit - static method
// Covers: Edge::arcDelayAnnotateBit
TEST(EdgeStandaloneTest, R5_ArcDelayAnnotateBit)
TEST(EdgeStandaloneTest, ArcDelayAnnotateBit)
{
// arcDelayAnnotateBit returns a bitmask for a given index
// The function is static and protected, but accessible indirectly
@ -494,7 +494,7 @@ TEST(EdgeStandaloneTest, R5_ArcDelayAnnotateBit)
// Test Edge init (protected but covered via Graph::makeEdge)
// Covers: Edge::init
TEST(EdgeStandaloneTest, R5_EdgeInitViaTimingArcSet)
TEST(EdgeStandaloneTest, EdgeInitViaTimingArcSet)
{
Edge e;
// setTimingArcSet exercises part of what init does
@ -504,7 +504,7 @@ TEST(EdgeStandaloneTest, R5_EdgeInitViaTimingArcSet)
// Test Vertex setSlews
// Covers: Vertex::setSlews
TEST(VertexStandaloneTest, R5_SetSlews)
TEST(VertexStandaloneTest, SetSlews)
{
Vertex v;
EXPECT_EQ(v.slews(), nullptr);
@ -522,7 +522,7 @@ TEST(VertexStandaloneTest, R5_SetSlews)
// Test Vertex setPaths
// Covers: Vertex::setPaths (public method on Vertex)
TEST(VertexStandaloneTest, R5_SetPaths)
TEST(VertexStandaloneTest, SetPaths)
{
Vertex v;
EXPECT_EQ(v.paths(), nullptr);
@ -532,7 +532,7 @@ TEST(VertexStandaloneTest, R5_SetPaths)
}
// Test Edge timing sense combinations
TEST(EdgeStandaloneTest, R5_SimTimingSenseCombinations)
TEST(EdgeStandaloneTest, SimTimingSenseCombinations)
{
Edge e;
e.setSimTimingSense(TimingSense::positive_unate);
@ -546,7 +546,7 @@ TEST(EdgeStandaloneTest, R5_SimTimingSenseCombinations)
}
// Test multiple BFS queue indices
TEST(VertexStandaloneTest, R5_BfsMultipleQueues)
TEST(VertexStandaloneTest, BfsMultipleQueues)
{
Vertex v;
// Test multiple BFS queue indices
@ -563,7 +563,7 @@ TEST(VertexStandaloneTest, R5_BfsMultipleQueues)
}
// Test Edge from/to vertex IDs
TEST(EdgeStandaloneTest, R5_FromToIds)
TEST(EdgeStandaloneTest, FromToIds)
{
Edge e;
// Default-constructed edge has from/to of 0
@ -574,7 +574,7 @@ TEST(EdgeStandaloneTest, R5_FromToIds)
}
// Test Vertex level setting with various values
TEST(VertexStandaloneTest, R5_LevelBoundaryValues)
TEST(VertexStandaloneTest, LevelBoundaryValues)
{
Vertex v;
v.setLevel(0);
@ -598,7 +598,7 @@ TEST(VertexStandaloneTest, R5_LevelBoundaryValues)
// Test Edge arcDelayAnnotateBit via removeDelayAnnotated path
// Covers: Edge::arcDelayAnnotateBit
TEST(EdgeStandaloneTest, R6_ArcDelayAnnotateBitPath)
TEST(EdgeStandaloneTest, ArcDelayAnnotateBitPath)
{
Edge e;
// Set some delay annotations then remove them
@ -610,7 +610,7 @@ TEST(EdgeStandaloneTest, R6_ArcDelayAnnotateBitPath)
// Test Edge setTimingArcSet with nullptr
// Covers: Edge::init (partial) via setTimingArcSet
TEST(EdgeStandaloneTest, R6_SetTimingArcSetNull)
TEST(EdgeStandaloneTest, SetTimingArcSetNull)
{
Edge e;
e.setTimingArcSet(nullptr);
@ -619,7 +619,7 @@ TEST(EdgeStandaloneTest, R6_SetTimingArcSetNull)
// Test Vertex setSlews indirectly - slews_ is protected
// Covers: Vertex::setSlews path
TEST(VertexStandaloneTest, R6_VertexSlewsProtected)
TEST(VertexStandaloneTest, VertexSlewsProtected)
{
Vertex v;
// Initially slews_ is nullptr
@ -631,7 +631,7 @@ TEST(VertexStandaloneTest, R6_VertexSlewsProtected)
// Test Edge from/to IDs are zero for default-constructed edge
// Covers: Edge::from, Edge::to
TEST(EdgeStandaloneTest, R6_DefaultFromToZero)
TEST(EdgeStandaloneTest, DefaultFromToZero)
{
Edge e;
EXPECT_EQ(e.from(), static_cast<VertexId>(0));
@ -640,7 +640,7 @@ TEST(EdgeStandaloneTest, R6_DefaultFromToZero)
// Test Vertex isRoot and level interaction
// Covers: Vertex::isRoot, Vertex::level, Vertex::setLevel
TEST(VertexStandaloneTest, R6_IsRootLevelInteraction)
TEST(VertexStandaloneTest, IsRootLevelInteraction)
{
Vertex v;
// Level 0 = root
@ -656,7 +656,7 @@ TEST(VertexStandaloneTest, R6_IsRootLevelInteraction)
// Test Vertex all BFS indices
// Covers: Vertex::bfsInQueue, Vertex::setBfsInQueue
TEST(VertexStandaloneTest, R6_BfsAllIndices)
TEST(VertexStandaloneTest, BfsAllIndices)
{
Vertex v;
// Set all BFS indices to true
@ -682,7 +682,7 @@ TEST(VertexStandaloneTest, R6_BfsAllIndices)
// Test Vertex SimValue with all LogicValues
// Covers: Vertex::setSimValue, Vertex::simValue, Vertex::isConstant
TEST(VertexStandaloneTest, R6_SimValueAllStates)
TEST(VertexStandaloneTest, SimValueAllStates)
{
Vertex v;
v.setSimValue(LogicValue::zero);
@ -700,7 +700,7 @@ TEST(VertexStandaloneTest, R6_SimValueAllStates)
// Test Edge simTimingSense all values
// Covers: Edge::setSimTimingSense, Edge::simTimingSense
TEST(EdgeStandaloneTest, R6_SimTimingSenseAllValues)
TEST(EdgeStandaloneTest, SimTimingSenseAllValues)
{
Edge e;
e.setSimTimingSense(TimingSense::unknown);
@ -717,7 +717,7 @@ TEST(EdgeStandaloneTest, R6_SimTimingSenseAllValues)
// Test Vertex slewAnnotated with all rf/mm combinations
// Covers: Vertex::setSlewAnnotated, Vertex::slewAnnotated
TEST(VertexStandaloneTest, R6_SlewAnnotatedAllCombinations)
TEST(VertexStandaloneTest, SlewAnnotatedAllCombinations)
{
Vertex v;
// Set all 4 combinations
@ -740,7 +740,7 @@ TEST(VertexStandaloneTest, R6_SlewAnnotatedAllCombinations)
// Test Vertex tagGroupIndex max value
// Covers: Vertex::tagGroupIndex, Vertex::setTagGroupIndex
TEST(VertexStandaloneTest, R6_TagGroupIndexMax)
TEST(VertexStandaloneTest, TagGroupIndexMax)
{
Vertex v;
EXPECT_EQ(v.tagGroupIndex(), tag_group_index_max);
@ -752,7 +752,7 @@ TEST(VertexStandaloneTest, R6_TagGroupIndexMax)
// Test Edge setArcDelays and access
// Covers: Edge::setArcDelays, Edge::arcDelays
TEST(EdgeStandaloneTest, R6_ArcDelaysSetAndAccess)
TEST(EdgeStandaloneTest, ArcDelaysSetAndAccess)
{
Edge e;
EXPECT_EQ(e.arcDelays(), nullptr);
@ -768,7 +768,7 @@ TEST(EdgeStandaloneTest, R6_ArcDelaysSetAndAccess)
// Test Vertex objectIdx with large value
// Covers: Vertex::setObjectIdx, Vertex::objectIdx
TEST(VertexStandaloneTest, R6_ObjectIdxLargeValue)
TEST(VertexStandaloneTest, ObjectIdxLargeValue)
{
Vertex v;
v.setObjectIdx(0xFFFF);
@ -779,7 +779,7 @@ TEST(VertexStandaloneTest, R6_ObjectIdxLargeValue)
// Test Edge objectIdx with large value
// Covers: Edge::setObjectIdx, Edge::objectIdx
TEST(EdgeStandaloneTest, R6_ObjectIdxLargeValue)
TEST(EdgeStandaloneTest, ObjectIdxLargeValue)
{
Edge e;
// Edge objectIdx may be a narrow bitfield; test with small values
@ -791,7 +791,7 @@ TEST(EdgeStandaloneTest, R6_ObjectIdxLargeValue)
// Test Vertex multiple flag combinations
// Covers: Vertex setter/getter interactions
TEST(VertexStandaloneTest, R6_MultipleFlagCombinations)
TEST(VertexStandaloneTest, MultipleFlagCombinations)
{
Vertex v;
// Set multiple flags and verify they don't interfere
@ -835,7 +835,7 @@ TEST(VertexStandaloneTest, R6_MultipleFlagCombinations)
// Test Edge multiple flag combinations
// Covers: Edge setter/getter interactions
TEST(EdgeStandaloneTest, R6_MultipleFlagCombinations)
TEST(EdgeStandaloneTest, MultipleFlagCombinations)
{
Edge e;
e.setIsBidirectInstPath(true);
@ -865,7 +865,7 @@ TEST(EdgeStandaloneTest, R6_MultipleFlagCombinations)
// Test delayLess with MinMax
// Covers: delayLessEqual 4-arg variant
TEST_F(DelayFloatTest, R6_DelayLessEqualMinMaxVariant)
TEST_F(DelayFloatTest, DelayLessEqualMinMaxVariant)
{
// With max: standard less-equal
EXPECT_TRUE(delayLessEqual(1.0f, 2.0f, MinMax::max(), nullptr));
@ -884,7 +884,7 @@ TEST_F(DelayFloatTest, R6_DelayLessEqualMinMaxVariant)
// Test Edge::arcDelayAnnotateBit via removeDelayAnnotated
// Covers: Edge::arcDelayAnnotateBit(unsigned long)
TEST(EdgeStandaloneTest, R8_ArcDelayAnnotateBitExercise)
TEST(EdgeStandaloneTest, ArcDelayAnnotateBitExercise)
{
Edge e;
e.setDelayAnnotationIsIncremental(true);
@ -895,7 +895,7 @@ TEST(EdgeStandaloneTest, R8_ArcDelayAnnotateBitExercise)
// Test multiple Vertex flag combinations don't interfere
// Covers: Vertex flags interaction with multiple setters
TEST(VertexStandaloneTest, R8_MultipleFlagInteraction)
TEST(VertexStandaloneTest, MultipleFlagInteraction)
{
Vertex v;
v.setHasChecks(true);
@ -925,7 +925,7 @@ TEST(VertexStandaloneTest, R8_MultipleFlagInteraction)
// Test Edge multiple flag combinations
// Covers: Edge flags interaction
TEST(EdgeStandaloneTest, R8_MultipleFlagInteraction)
TEST(EdgeStandaloneTest, MultipleFlagInteraction)
{
Edge e;
e.setIsBidirectInstPath(true);
@ -1022,7 +1022,7 @@ protected:
// Covers: Graph::makePinVertices, Graph::makePinInstanceEdges,
// Graph::makeWireEdgesThruPin, Vertex::name,
// VertexInEdgeIterator, FindNetDrvrLoadCounts
TEST_F(GraphDesignTest, R8_GraphVerticesAndEdges) {
TEST_F(GraphDesignTest, GraphVerticesAndEdges) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1051,7 +1051,7 @@ TEST_F(GraphDesignTest, R8_GraphVerticesAndEdges) {
// Test Vertex name with a real graph
// Covers: Vertex::name(const Network*) const
TEST_F(GraphDesignTest, R8_VertexName) {
TEST_F(GraphDesignTest, VertexName) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1076,7 +1076,7 @@ TEST_F(GraphDesignTest, R8_VertexName) {
// Test Graph edges traversal
// Covers: VertexOutEdgeIterator
TEST_F(GraphDesignTest, R8_EdgeTraversal) {
TEST_F(GraphDesignTest, EdgeTraversal) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1102,7 +1102,7 @@ TEST_F(GraphDesignTest, R8_EdgeTraversal) {
// Test VertexInEdgeIterator
// Covers: VertexInEdgeIterator::VertexInEdgeIterator
TEST_F(GraphDesignTest, R8_VertexInEdgeIterator) {
TEST_F(GraphDesignTest, VertexInEdgeIterator) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2285,7 +2285,7 @@ TEST_F(DesignParasiticsTest, DeleteParasiticsAllNets) {
// Test NetIdPairLess comparator construction
// Covers: NetIdPairLess::NetIdPairLess(const Network*)
TEST_F(DesignParasiticsTest, R5_NetIdPairLessConstruct) {
TEST_F(DesignParasiticsTest, NetIdPairLessConstruct) {
ASSERT_TRUE(design_loaded_);
const Network *network = sta_->network();
// Construct the comparator - this covers the constructor
@ -2317,7 +2317,7 @@ TEST_F(DesignParasiticsTest, R5_NetIdPairLessConstruct) {
// Test ConcreteParasitic virtual destructor via delete (D0 variant)
// Covers: ConcreteParasitic::~ConcreteParasiticD0Ev
TEST_F(DesignParasiticsTest, R5_ConcreteParasiticDeleteViaPtr) {
TEST_F(DesignParasiticsTest, ConcreteParasiticDeleteViaPtr) {
ASSERT_TRUE(design_loaded_);
ConcreteParasitic *p = new ConcretePiElmore(1e-12f, 100.0f, 2e-12f);
// Deleting via base pointer exercises the D0 destructor variant
@ -2326,7 +2326,7 @@ TEST_F(DesignParasiticsTest, R5_ConcreteParasiticDeleteViaPtr) {
// Test ConcreteParasiticDevice construction with id, value, nodes
// Covers: ConcreteParasiticDevice::ConcreteParasiticDevice(size_t, float, node*, node*)
TEST_F(DesignParasiticsTest, R5_ConcreteParasiticDeviceConstruct) {
TEST_F(DesignParasiticsTest, ConcreteParasiticDeviceConstruct) {
ASSERT_TRUE(design_loaded_);
ConcreteParasiticNode node1(static_cast<const Net*>(nullptr), 1, false);
ConcreteParasiticNode node2(static_cast<const Net*>(nullptr), 2, false);
@ -2340,7 +2340,7 @@ TEST_F(DesignParasiticsTest, R5_ConcreteParasiticDeviceConstruct) {
// Test ConcreteParasiticDevice base class constructor
// Covers: ConcreteParasiticDevice::ConcreteParasiticDevice(size_t, float, Node*, Node*)
TEST_F(StaParasiticsTest, R6_ConcreteParasiticDeviceConstruction) {
TEST_F(StaParasiticsTest, ConcreteParasiticDeviceConstruction) {
ConcreteParasiticNode node1(static_cast<const Net*>(nullptr), 1, false);
ConcreteParasiticNode node2(static_cast<const Net*>(nullptr), 2, false);
// ConcreteParasiticDevice is the base of Resistor/Capacitor
@ -2354,7 +2354,7 @@ TEST_F(StaParasiticsTest, R6_ConcreteParasiticDeviceConstruction) {
// Test ConcreteParasitic D0 destructor via delete through base pointer
// Covers: ConcreteParasitic::~ConcreteParasitic() D0
TEST_F(StaParasiticsTest, R6_ConcreteParasiticD0Destructor) {
TEST_F(StaParasiticsTest, ConcreteParasiticD0Destructor) {
ConcreteParasitic *p = new ConcretePiElmore(1e-12f, 100.0f, 2e-12f);
EXPECT_TRUE(p->isPiElmore());
delete p;
@ -2363,7 +2363,7 @@ TEST_F(StaParasiticsTest, R6_ConcreteParasiticD0Destructor) {
// Test ConcreteParasitic D0 destructor for PoleResidue
// Covers: ConcreteParasitic::~ConcreteParasitic() D0 via ConcretePoleResidue
TEST_F(StaParasiticsTest, R6_ConcretePoleResidueD0Destructor) {
TEST_F(StaParasiticsTest, ConcretePoleResidueD0Destructor) {
ConcreteParasitic *p = new ConcretePoleResidue();
EXPECT_TRUE(p->isPoleResidue());
delete p;
@ -2371,7 +2371,7 @@ TEST_F(StaParasiticsTest, R6_ConcretePoleResidueD0Destructor) {
// Test ConcreteParasitic D0 destructor for PiPoleResidue
// Covers: ConcreteParasitic::~ConcreteParasitic() D0 via ConcretePiPoleResidue
TEST_F(StaParasiticsTest, R6_ConcretePiPoleResidueD0Destructor) {
TEST_F(StaParasiticsTest, ConcretePiPoleResidueD0Destructor) {
ConcreteParasitic *p = new ConcretePiPoleResidue(1e-12f, 100.0f, 2e-12f);
EXPECT_TRUE(p->isPiPoleResidue());
delete p;
@ -2379,7 +2379,7 @@ TEST_F(StaParasiticsTest, R6_ConcretePiPoleResidueD0Destructor) {
// Test ConcreteParasiticNetwork creation and methods
// Covers: ConcreteParasiticNetwork::nodes, resistors, capacitors, capacitance
TEST_F(StaParasiticsTest, R6_ParasiticNetworkCreation) {
TEST_F(StaParasiticsTest, ParasiticNetworkCreation) {
const Network *network = sta_->network();
ConcreteParasiticNetwork pnet(nullptr, false, network);
EXPECT_TRUE(pnet.isParasiticNetwork());
@ -2393,7 +2393,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticNetworkCreation) {
// Test ConcreteParasiticNetwork with includesPinCaps flag
// Covers: ConcreteParasiticNetwork constructor with includes_pin_caps=true
TEST_F(StaParasiticsTest, R6_ParasiticNetworkIncludesPinCaps) {
TEST_F(StaParasiticsTest, ParasiticNetworkIncludesPinCaps2) {
const Network *network = sta_->network();
ConcreteParasiticNetwork pnet(nullptr, true, network);
EXPECT_TRUE(pnet.includesPinCaps());
@ -2401,7 +2401,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticNetworkIncludesPinCaps) {
// Test ConcreteParasiticNetwork findParasiticNode returns nullptr for missing
// Covers: ConcreteParasiticNetwork::findParasiticNode
TEST_F(StaParasiticsTest, R6_ParasiticNetworkFindNodeMissing) {
TEST_F(StaParasiticsTest, ParasiticNetworkFindNodeMissing) {
const Network *network = sta_->network();
ConcreteParasiticNetwork pnet(nullptr, false, network);
ConcreteParasiticNode *node = pnet.findParasiticNode(static_cast<const Pin*>(nullptr));
@ -2410,7 +2410,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticNetworkFindNodeMissing) {
// Test ConcreteParasiticNetwork addResistor with standalone nodes
// Covers: ConcreteParasiticNetwork::addResistor
TEST_F(StaParasiticsTest, R6_ParasiticNetworkAddResistorStandalone) {
TEST_F(StaParasiticsTest, ParasiticNetworkAddResistorStandalone) {
const Network *network = sta_->network();
ConcreteParasiticNetwork pnet(nullptr, false, network);
ConcreteParasiticNode node1(static_cast<const Net*>(nullptr), 1, false);
@ -2422,7 +2422,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticNetworkAddResistorStandalone) {
// Test ConcreteParasiticNetwork addCapacitor with standalone nodes
// Covers: ConcreteParasiticNetwork::addCapacitor
TEST_F(StaParasiticsTest, R6_ParasiticNetworkAddCapacitorStandalone) {
TEST_F(StaParasiticsTest, ParasiticNetworkAddCapacitorStandalone) {
const Network *network = sta_->network();
ConcreteParasiticNetwork pnet(nullptr, false, network);
ConcreteParasiticNode node1(static_cast<const Net*>(nullptr), 1, false);
@ -2434,7 +2434,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticNetworkAddCapacitorStandalone) {
// Test parasiticAnalysisPtIndex with a real corner
// Covers: ConcreteParasitics::parasiticAnalysisPtIndex
TEST_F(StaParasiticsTest, R6_ParasiticAnalysisPtIndexWithCorner) {
TEST_F(StaParasiticsTest, ParasiticAnalysisPtIndexWithCorner) {
Parasitics *parasitics = sta_->parasitics();
Corner *corner = sta_->cmdCorner();
ASSERT_NE(corner, nullptr);
@ -2448,7 +2448,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticAnalysisPtIndexWithCorner) {
// Test ConcreteParasiticNetwork resistors/capacitors empty by default
// Covers: ConcreteParasiticNetwork::resistors, ConcreteParasiticNetwork::capacitors
TEST_F(StaParasiticsTest, R6_ParasiticNetworkEmptyLists) {
TEST_F(StaParasiticsTest, ParasiticNetworkEmptyLists) {
const Network *network = sta_->network();
ConcreteParasiticNetwork pnet(nullptr, false, network);
EXPECT_TRUE(pnet.resistors().empty());
@ -2457,7 +2457,7 @@ TEST_F(StaParasiticsTest, R6_ParasiticNetworkEmptyLists) {
// Test ConcretePiElmore with zero values
// Covers: ConcretePiElmore constructor, accessors
TEST_F(StaParasiticsTest, R6_PiElmoreZeroValues) {
TEST_F(StaParasiticsTest, PiElmoreZeroValues) {
ConcretePiElmore pe(0.0f, 0.0f, 0.0f);
EXPECT_TRUE(pe.isPiElmore());
EXPECT_FALSE(pe.isPoleResidue());
@ -2466,7 +2466,7 @@ TEST_F(StaParasiticsTest, R6_PiElmoreZeroValues) {
// Test parasiticAnalysisPtIndex indirectly by reading SPEF for specific rf
// Covers: ConcreteParasitics::parasiticAnalysisPtIndex
TEST_F(DesignParasiticsTest, R5_ParasiticAnalysisPtIndex) {
TEST_F(DesignParasiticsTest, ParasiticAnalysisPtIndex) {
ASSERT_TRUE(design_loaded_);
Corner *corner = sta_->cmdCorner();
// Read SPEF with reduction to exercise analysis pt indexing
@ -2484,7 +2484,7 @@ TEST_F(DesignParasiticsTest, R5_ParasiticAnalysisPtIndex) {
// Test ReportParasiticAnnotation report
// Covers: ReportParasiticAnnotation::report
TEST_F(DesignParasiticsTest, R5_ReportParasiticAnnotation) {
TEST_F(DesignParasiticsTest, ReportParasiticAnnotation2) {
ASSERT_TRUE(design_loaded_);
// Ensure the graph is built first
@ -2505,7 +2505,7 @@ TEST_F(DesignParasiticsTest, R5_ReportParasiticAnnotation) {
// Test ConcreteParasiticDevice constructor directly
// Covers: ConcreteParasiticDevice::ConcreteParasiticDevice(size_t, float, node*, node*)
TEST_F(ConcreteParasiticDeviceTest, R8_DirectDeviceConstruction) {
TEST_F(ConcreteParasiticDeviceTest, DirectDeviceConstruction) {
ConcreteParasiticNode node1(static_cast<const Net*>(nullptr), 1, false);
ConcreteParasiticNode node2(static_cast<const Net*>(nullptr), 2, false);
// Construct via ConcreteParasiticCapacitor (which calls base ConcreteParasiticDevice ctor)
@ -2518,7 +2518,7 @@ TEST_F(ConcreteParasiticDeviceTest, R8_DirectDeviceConstruction) {
// Test ConcreteParasiticDevice via resistor with large id
// Covers: ConcreteParasiticDevice::ConcreteParasiticDevice
TEST_F(ConcreteParasiticDeviceTest, R8_LargeIdDevice) {
TEST_F(ConcreteParasiticDeviceTest, LargeIdDevice) {
ConcreteParasiticNode n1(static_cast<const Net*>(nullptr), 100, false);
ConcreteParasiticNode n2(static_cast<const Net*>(nullptr), 200, false);
ConcreteParasiticResistor res(999999, 1.5e3f, &n1, &n2);
@ -2528,7 +2528,7 @@ TEST_F(ConcreteParasiticDeviceTest, R8_LargeIdDevice) {
// Test ConcreteParasitic destructor via delete on base pointer
// Covers: ConcreteParasitic::~ConcreteParasitic()
TEST_F(ConcretePiElmoreTest, R8_DestructorViaBasePointer) {
TEST_F(ConcretePiElmoreTest, DestructorViaBasePointer) {
ConcreteParasitic *p = new ConcretePiElmore(1e-12f, 50.0f, 2e-12f);
EXPECT_TRUE(p->isPiElmore());
delete p; // calls ConcreteParasitic::~ConcreteParasitic()
@ -2536,7 +2536,7 @@ TEST_F(ConcretePiElmoreTest, R8_DestructorViaBasePointer) {
// Test ConcreteParasitic destructor via ConcretePoleResidue
// Covers: ConcreteParasitic::~ConcreteParasitic()
TEST_F(ConcretePoleResidueTest, R8_DestructorViaBasePointer) {
TEST_F(ConcretePoleResidueTest, DestructorViaBasePointer) {
ConcreteParasitic *p = new ConcretePoleResidue();
EXPECT_TRUE(p->isPoleResidue());
delete p;
@ -2544,7 +2544,7 @@ TEST_F(ConcretePoleResidueTest, R8_DestructorViaBasePointer) {
// Test ConcreteParasitic destructor via ConcretePiPoleResidue
// Covers: ConcreteParasitic::~ConcreteParasitic()
TEST_F(ConcretePiPoleResidueTest, R8_DestructorViaBasePointer) {
TEST_F(ConcretePiPoleResidueTest, DestructorViaBasePointer) {
ConcreteParasitic *p = new ConcretePiPoleResidue(1e-12f, 100.0f, 2e-12f);
EXPECT_TRUE(p->isPiPoleResidue());
delete p;
@ -2552,7 +2552,7 @@ TEST_F(ConcretePiPoleResidueTest, R8_DestructorViaBasePointer) {
// Test reading SPEF with max only to exercise parasiticAnalysisPtIndex
// Covers: ConcreteParasitics::parasiticAnalysisPtIndex
TEST_F(DesignParasiticsTest, R8_ParasiticAnalysisPtIndexMaxOnly) {
TEST_F(DesignParasiticsTest, ParasiticAnalysisPtIndexMaxOnly) {
ASSERT_TRUE(design_loaded_);
Corner *corner = sta_->cmdCorner();
bool success = sta_->readSpef(
@ -2567,7 +2567,7 @@ TEST_F(DesignParasiticsTest, R8_ParasiticAnalysisPtIndexMaxOnly) {
// Test reading SPEF and querying to exercise ReportParasiticAnnotation::report
// Covers: ReportParasiticAnnotation::report
TEST_F(DesignParasiticsTest, R8_ReportAnnotationAfterSpef) {
TEST_F(DesignParasiticsTest, ReportAnnotationAfterSpef) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
Corner *corner = sta_->cmdCorner();
@ -2582,7 +2582,7 @@ TEST_F(DesignParasiticsTest, R8_ReportAnnotationAfterSpef) {
// ReduceToPi::isVisited, ReduceToPi::leave, ReduceToPi::setDownstreamCap,
// ReduceToPi::downstreamCap, ReduceToPi::isLoopResistor,
// ReduceToPi::markLoopResistor
TEST_F(DesignParasiticsTest, R8_ReduceToPiElmoreWithNetwork) {
TEST_F(DesignParasiticsTest, ReduceToPiElmoreWithNetwork) {
ASSERT_TRUE(design_loaded_);
Corner *corner = sta_->cmdCorner();

View File

@ -314,6 +314,13 @@ VcdParse::getToken()
////////////////////////////////////////////////////////////////
VcdValue::VcdValue() :
time_(0),
value_('\0'),
bus_value_(0)
{
}
char
VcdValue::value(int value_bit) const
{

View File

@ -463,12 +463,10 @@ TEST_F(PwrActivityTest, SetDutyBoundary) {
// VcdValue coverage tests
////////////////////////////////////////////////////////////////
// VcdValue tests - use zero-initialized memory since constructor is not defined
// VcdValue has only POD members (int64_t, char, uint64_t) so memset is safe
// VcdValue tests
} // namespace sta
#include <cstring>
#include "power/VcdParse.hh"
namespace sta {
@ -476,31 +474,23 @@ namespace sta {
class VcdValueTest : public ::testing::Test {};
TEST_F(VcdValueTest, SetValueAndAccess) {
// Zero-initialize to work around missing default constructor
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
val->setValue(100, '1');
EXPECT_EQ(val->time(), 100);
EXPECT_EQ(val->value(), '1');
VcdValue val;
val.setValue(100, '1');
EXPECT_EQ(val.time(), 100);
EXPECT_EQ(val.value(), '1');
}
TEST_F(VcdValueTest, ValueBitAccess) {
// Zero-initialize
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
VcdValue val;
// When value_ is non-null char, value(int) returns value_ regardless of bit
val->setValue(200, 'X');
EXPECT_EQ(val->value(0), 'X');
EXPECT_EQ(val->value(3), 'X');
val.setValue(200, 'X');
EXPECT_EQ(val.value(0), 'X');
EXPECT_EQ(val.value(3), 'X');
}
// Test PwrActivity check() is called during construction
// Covers: PwrActivity::check
TEST_F(PwrActivityTest, R5_CheckCalledDuringConstruction) {
TEST_F(PwrActivityTest, CheckCalledDuringConstruction) {
// check() clips density values smaller than min_density
PwrActivity act1(1e-11f, 0.5f, PwrActivityOrigin::user);
EXPECT_FLOAT_EQ(act1.density(), 0.0f); // clipped by check()
@ -514,14 +504,14 @@ TEST_F(PwrActivityTest, R5_CheckCalledDuringConstruction) {
// Test PwrActivity check() via set()
// Covers: PwrActivity::check
TEST_F(PwrActivityTest, R5_CheckCalledDuringSet) {
TEST_F(PwrActivityTest, CheckCalledDuringSet) {
PwrActivity act;
act.set(1e-11f, 0.5f, PwrActivityOrigin::propagated);
EXPECT_FLOAT_EQ(act.density(), 0.0f); // clipped by check()
}
// Test PwrActivity setDensity does not call check()
TEST_F(PwrActivityTest, R5_SetDensityDirect) {
TEST_F(PwrActivityTest, SetDensityDirect) {
PwrActivity act;
act.setDensity(1e-11f);
// setDensity does NOT call check(), so the value is stored as-is
@ -529,77 +519,67 @@ TEST_F(PwrActivityTest, R5_SetDensityDirect) {
}
// Test VcdValue with zero value
TEST_F(VcdValueTest, R5_ValueZero) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, ValueZero) {
VcdValue val;
val->setValue(0, '0');
EXPECT_EQ(val->time(), 0);
EXPECT_EQ(val->value(), '0');
val.setValue(0, '0');
EXPECT_EQ(val.time(), 0);
EXPECT_EQ(val.value(), '0');
}
// Test VcdValue with Z value
TEST_F(VcdValueTest, R5_ValueZ) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, ValueZ) {
VcdValue val;
val->setValue(500, 'Z');
EXPECT_EQ(val->time(), 500);
EXPECT_EQ(val->value(), 'Z');
EXPECT_EQ(val->value(0), 'Z');
val.setValue(500, 'Z');
EXPECT_EQ(val.time(), 500);
EXPECT_EQ(val.value(), 'Z');
EXPECT_EQ(val.value(0), 'Z');
}
// Test VcdValue busValue
TEST_F(VcdValueTest, R5_BusValue) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, BusValue) {
VcdValue val;
// When value_ is '\0', busValue is used
val->setValue(100, '\0');
EXPECT_EQ(val->value(), '\0');
val.setValue(100, '\0');
EXPECT_EQ(val.value(), '\0');
// busValue will be 0 since we zero-initialized
EXPECT_EQ(val->busValue(), 0u);
EXPECT_EQ(val.busValue(), 0u);
}
// Test VcdValue large time values
TEST_F(VcdValueTest, R5_LargeTime) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, LargeTime) {
VcdValue val;
VcdTime large_time = 1000000000LL;
val->setValue(large_time, '1');
EXPECT_EQ(val->time(), large_time);
EXPECT_EQ(val->value(), '1');
val.setValue(large_time, '1');
EXPECT_EQ(val.time(), large_time);
EXPECT_EQ(val.value(), '1');
}
// Test VcdValue overwrite
TEST_F(VcdValueTest, R5_OverwriteValue) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, OverwriteValue) {
VcdValue val;
val->setValue(100, '0');
EXPECT_EQ(val->value(), '0');
val.setValue(100, '0');
EXPECT_EQ(val.value(), '0');
val->setValue(200, '1');
EXPECT_EQ(val->time(), 200);
EXPECT_EQ(val->value(), '1');
val.setValue(200, '1');
EXPECT_EQ(val.time(), 200);
EXPECT_EQ(val.value(), '1');
}
// Test PwrActivity check() is called and clips negative small density
// Covers: PwrActivity::check
TEST_F(PwrActivityTest, R6_CheckClipsNegativeSmallDensity) {
TEST_F(PwrActivityTest, CheckClipsNegativeSmallDensity) {
PwrActivity act(-5e-12f, 0.5f, PwrActivityOrigin::propagated);
EXPECT_FLOAT_EQ(act.density(), 0.0f); // clipped by check()
}
// Test PwrActivity check() boundary at threshold
// Covers: PwrActivity::check with values near threshold
TEST_F(PwrActivityTest, R6_CheckAtThreshold) {
TEST_F(PwrActivityTest, CheckAtThreshold) {
// 1E-10 is exactly the threshold - should NOT be clipped
PwrActivity act1(1e-10f, 0.5f, PwrActivityOrigin::user);
EXPECT_FLOAT_EQ(act1.density(), 1e-10f);
@ -611,7 +591,7 @@ TEST_F(PwrActivityTest, R6_CheckAtThreshold) {
// Test PwrActivity check() via set() with negative small
// Covers: PwrActivity::check via set
TEST_F(PwrActivityTest, R6_CheckViaSetNegative) {
TEST_F(PwrActivityTest, CheckViaSetNegative) {
PwrActivity act;
act.set(-5e-12f, 0.3f, PwrActivityOrigin::vcd);
EXPECT_FLOAT_EQ(act.density(), 0.0f);
@ -620,14 +600,14 @@ TEST_F(PwrActivityTest, R6_CheckViaSetNegative) {
// Test PwrActivity check() does NOT clip normal density
// Covers: PwrActivity::check positive path
TEST_F(PwrActivityTest, R6_CheckDoesNotClipNormal) {
TEST_F(PwrActivityTest, CheckDoesNotClipNormal) {
PwrActivity act(1e-5f, 0.5f, PwrActivityOrigin::clock);
EXPECT_FLOAT_EQ(act.density(), 1e-5f);
}
// Test PwrActivity with zero density and zero duty
// Covers: PwrActivity construction edge case
TEST_F(PwrActivityTest, R6_ZeroDensityZeroDuty) {
TEST_F(PwrActivityTest, ZeroDensityZeroDuty) {
PwrActivity act(0.0f, 0.0f, PwrActivityOrigin::user);
EXPECT_FLOAT_EQ(act.density(), 0.0f);
EXPECT_FLOAT_EQ(act.duty(), 0.0f);
@ -636,7 +616,7 @@ TEST_F(PwrActivityTest, R6_ZeroDensityZeroDuty) {
// Test PwrActivity multiple init/set cycles
// Covers: PwrActivity::init and set cycle
TEST_F(PwrActivityTest, R6_MultipleInitSetCycles) {
TEST_F(PwrActivityTest, MultipleInitSetCycles) {
PwrActivity act;
for (int i = 0; i < 10; i++) {
act.set(static_cast<float>(i * 100), 0.5f, PwrActivityOrigin::propagated);
@ -648,7 +628,7 @@ TEST_F(PwrActivityTest, R6_MultipleInitSetCycles) {
// Test PowerResult with very small values
// Covers: PowerResult accumulation precision
TEST_F(PowerResultTest, R6_VerySmallValues) {
TEST_F(PowerResultTest, VerySmallValues) {
PowerResult result;
result.incrInternal(1e-20f);
result.incrSwitching(2e-20f);
@ -658,7 +638,7 @@ TEST_F(PowerResultTest, R6_VerySmallValues) {
// Test PowerResult clear then incr multiple times
// Covers: PowerResult clear/incr pattern
TEST_F(PowerResultTest, R6_ClearIncrPattern) {
TEST_F(PowerResultTest, ClearIncrPattern) {
PowerResult result;
for (int i = 0; i < 5; i++) {
result.clear();
@ -670,7 +650,7 @@ TEST_F(PowerResultTest, R6_ClearIncrPattern) {
// Test PowerResult incr from two populated results
// Covers: PowerResult::incr accumulation
TEST_F(PowerResultTest, R6_IncrMultipleSources) {
TEST_F(PowerResultTest, IncrMultipleSources) {
PowerResult target;
for (int i = 0; i < 3; i++) {
PowerResult source;
@ -687,49 +667,43 @@ TEST_F(PowerResultTest, R6_IncrMultipleSources) {
// Test VcdValue busValue with zero-initialized memory
// Covers: VcdValue::busValue
TEST_F(VcdValueTest, R6_BusValueZeroInit) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, BusValueZeroInit) {
VcdValue val;
// Zero-initialized: busValue should be 0
EXPECT_EQ(val->busValue(), 0u);
EXPECT_EQ(val.busValue(), 0u);
// value_ is '\0', so value(bit) should look at bus_value_
EXPECT_EQ(val->value(0), '0');
EXPECT_EQ(val.value(0), '0');
}
// Test VcdValue value(bit) when value_ is set (non-null char)
// Covers: VcdValue::value(int bit) when value_ is non-null
TEST_F(VcdValueTest, R6_ValueBitWithScalarValue) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
TEST_F(VcdValueTest, ValueBitWithScalarValue) {
VcdValue val;
// When value_ is non-null, value(bit) returns value_ regardless of bit
val->setValue(100, '1');
EXPECT_EQ(val->value(0), '1');
EXPECT_EQ(val->value(5), '1');
EXPECT_EQ(val->value(31), '1');
val.setValue(100, '1');
EXPECT_EQ(val.value(0), '1');
EXPECT_EQ(val.value(5), '1');
EXPECT_EQ(val.value(31), '1');
}
// Test VcdValue setValue multiple times
// Covers: VcdValue::setValue overwrite behavior
TEST_F(VcdValueTest, R6_SetValueMultipleTimes) {
alignas(VcdValue) char buf[sizeof(VcdValue)];
std::memset(buf, 0, sizeof(VcdValue));
VcdValue *val = reinterpret_cast<VcdValue *>(buf);
val->setValue(100, '0');
EXPECT_EQ(val->time(), 100);
EXPECT_EQ(val->value(), '0');
val->setValue(200, '1');
EXPECT_EQ(val->time(), 200);
EXPECT_EQ(val->value(), '1');
val->setValue(300, 'X');
EXPECT_EQ(val->time(), 300);
EXPECT_EQ(val->value(), 'X');
TEST_F(VcdValueTest, SetValueMultipleTimes) {
VcdValue val;
val.setValue(100, '0');
EXPECT_EQ(val.time(), 100);
EXPECT_EQ(val.value(), '0');
val.setValue(200, '1');
EXPECT_EQ(val.time(), 200);
EXPECT_EQ(val.value(), '1');
val.setValue(300, 'X');
EXPECT_EQ(val.time(), 300);
EXPECT_EQ(val.value(), 'X');
}
// Test PwrActivity density boundary with negative threshold
// Covers: PwrActivity::check with negative values near threshold
TEST_F(PwrActivityTest, R6_NegativeNearThreshold) {
TEST_F(PwrActivityTest, NegativeNearThreshold) {
PwrActivity act1(-1e-10f, 0.5f, PwrActivityOrigin::user);
EXPECT_FLOAT_EQ(act1.density(), -1e-10f);
PwrActivity act2(-9e-11f, 0.5f, PwrActivityOrigin::user);
@ -738,7 +712,7 @@ TEST_F(PwrActivityTest, R6_NegativeNearThreshold) {
// Test PwrActivity originName for all origins
// Covers: PwrActivity::originName exhaustive
TEST_F(PwrActivityTest, R6_OriginNameExhaustive) {
TEST_F(PwrActivityTest, OriginNameExhaustive) {
EXPECT_STREQ(PwrActivity(0, 0, PwrActivityOrigin::unknown).originName(), "unknown");
EXPECT_STREQ(PwrActivity(0, 0, PwrActivityOrigin::global).originName(), "global");
EXPECT_STREQ(PwrActivity(0, 0, PwrActivityOrigin::input).originName(), "input");
@ -757,7 +731,7 @@ TEST_F(PwrActivityTest, R6_OriginNameExhaustive) {
// Test PwrActivity::check - density below threshold is clipped to 0
// Covers: PwrActivity::check
TEST_F(PwrActivityTest, R8_CheckClipsBelowThreshold) {
TEST_F(PwrActivityTest, CheckClipsBelowThreshold) {
// Density between -1e-10 and 1e-10 (exclusive) should be clipped
PwrActivity act1(5e-11f, 0.5f, PwrActivityOrigin::user);
EXPECT_FLOAT_EQ(act1.density(), 0.0f);
@ -775,7 +749,7 @@ TEST_F(PwrActivityTest, R8_CheckClipsBelowThreshold) {
// Test PwrActivity check via set method
// Covers: PwrActivity::check
TEST_F(PwrActivityTest, R8_CheckViaSet) {
TEST_F(PwrActivityTest, CheckViaSet) {
PwrActivity act;
act.set(1e-12f, 0.5f, PwrActivityOrigin::propagated);
EXPECT_FLOAT_EQ(act.density(), 0.0f); // below threshold, clipped to 0
@ -785,7 +759,7 @@ TEST_F(PwrActivityTest, R8_CheckViaSet) {
// Test PwrActivity setDensity does NOT call check() (no clipping)
// Covers: PwrActivity::setDensity
TEST_F(PwrActivityTest, R8_CheckViaSetDensity) {
TEST_F(PwrActivityTest, CheckViaSetDensity) {
PwrActivity act;
// setDensity does NOT call check(), so even tiny values are stored as-is
act.setDensity(1e-12f);
@ -876,7 +850,7 @@ protected:
// ActivitySrchPred::ActivitySrchPred,
// PropActivityVisitor::copy, PropActivityVisitor::init,
// SeqPinHash::SeqPinHash, SeqPinEqual::operator()
TEST_F(PowerDesignTest, R8_PowerCalculation) {
TEST_F(PowerDesignTest, PowerCalculation) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -893,7 +867,7 @@ TEST_F(PowerDesignTest, R8_PowerCalculation) {
// Test Power for individual instances
// Covers: Power::powerInside, Power::findInstClk, Power::findLinkPort
TEST_F(PowerDesignTest, R8_PowerPerInstance) {
TEST_F(PowerDesignTest, PowerPerInstance) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -916,7 +890,7 @@ TEST_F(PowerDesignTest, R8_PowerPerInstance) {
// Test Sta::activity for pins (exercises Power::activity, hasActivity)
// Covers: Power::hasActivity, Power::activity
TEST_F(PowerDesignTest, R8_PinActivityQuery) {
TEST_F(PowerDesignTest, PinActivityQuery) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();

File diff suppressed because it is too large Load Diff

View File

@ -414,7 +414,7 @@ TEST_F(SdfSmokeTest, MinMaxAllAsMinMax) {
// Test SDF edge names for transitions
// Covers: SdfWriter::sdfEdge - exercises transition to SDF edge string mapping
TEST_F(SdfSmokeTest, R5_TransitionAsInitFinalString) {
TEST_F(SdfSmokeTest, TransitionAsInitFinalString) {
// SDF uses init/final transition string representation
EXPECT_NE(Transition::rise()->asInitFinalString(), nullptr);
EXPECT_NE(Transition::fall()->asInitFinalString(), nullptr);
@ -429,7 +429,7 @@ TEST_F(SdfSmokeTest, R5_TransitionAsInitFinalString) {
}
// Test Transition asRiseFall for SDF edge transitions
TEST_F(SdfSmokeTest, R5_TransitionAsRiseFallAll) {
TEST_F(SdfSmokeTest, TransitionAsRiseFallAll) {
// Rise transitions map to rise
EXPECT_EQ(Transition::rise()->asRiseFall(), RiseFall::rise());
// Fall transitions map to fall
@ -445,7 +445,7 @@ TEST_F(SdfSmokeTest, R5_TransitionAsRiseFallAll) {
}
// Test MinMaxAll matches method
TEST_F(SdfSmokeTest, R5_MinMaxAllMatches) {
TEST_F(SdfSmokeTest, MinMaxAllMatches2) {
EXPECT_TRUE(MinMaxAll::min()->matches(MinMax::min()));
EXPECT_FALSE(MinMaxAll::min()->matches(MinMax::max()));
EXPECT_TRUE(MinMaxAll::max()->matches(MinMax::max()));
@ -455,7 +455,7 @@ TEST_F(SdfSmokeTest, R5_MinMaxAllMatches) {
}
// Test MinMaxAll matches MinMaxAll
TEST_F(SdfSmokeTest, R5_MinMaxAllMatchesAll) {
TEST_F(SdfSmokeTest, MinMaxAllMatchesAll) {
EXPECT_TRUE(MinMaxAll::all()->matches(MinMaxAll::min()));
EXPECT_TRUE(MinMaxAll::all()->matches(MinMaxAll::max()));
EXPECT_TRUE(MinMaxAll::all()->matches(MinMaxAll::all()));
@ -464,20 +464,20 @@ TEST_F(SdfSmokeTest, R5_MinMaxAllMatchesAll) {
}
// Test MinMax find by name
TEST_F(SdfSmokeTest, R5_MinMaxFindByName) {
TEST_F(SdfSmokeTest, MinMaxFindByName) {
EXPECT_EQ(MinMax::find("min"), MinMax::min());
EXPECT_EQ(MinMax::find("max"), MinMax::max());
EXPECT_EQ(MinMax::find("nonexistent"), nullptr);
}
// Test MinMax find by index
TEST_F(SdfSmokeTest, R5_MinMaxFindByIndex) {
TEST_F(SdfSmokeTest, MinMaxFindByIndex) {
EXPECT_EQ(MinMax::find(MinMax::minIndex()), MinMax::min());
EXPECT_EQ(MinMax::find(MinMax::maxIndex()), MinMax::max());
}
// Test MinMaxAll find by name
TEST_F(SdfSmokeTest, R5_MinMaxAllFindByName) {
TEST_F(SdfSmokeTest, MinMaxAllFindByName) {
EXPECT_EQ(MinMaxAll::find("min"), MinMaxAll::min());
EXPECT_EQ(MinMaxAll::find("max"), MinMaxAll::max());
EXPECT_EQ(MinMaxAll::find("all"), MinMaxAll::all());
@ -485,13 +485,13 @@ TEST_F(SdfSmokeTest, R5_MinMaxAllFindByName) {
}
// Test MinMax opposite
TEST_F(SdfSmokeTest, R5_MinMaxOpposite) {
TEST_F(SdfSmokeTest, MinMaxOpposite2) {
EXPECT_EQ(MinMax::min()->opposite(), MinMax::max());
EXPECT_EQ(MinMax::max()->opposite(), MinMax::min());
}
// Test MinMax minMax function
TEST_F(SdfSmokeTest, R5_MinMaxMinMaxFunc) {
TEST_F(SdfSmokeTest, MinMaxMinMaxFunc2) {
EXPECT_FLOAT_EQ(MinMax::min()->minMax(3.0f, 5.0f), 3.0f);
EXPECT_FLOAT_EQ(MinMax::min()->minMax(5.0f, 3.0f), 3.0f);
EXPECT_FLOAT_EQ(MinMax::max()->minMax(3.0f, 5.0f), 5.0f);
@ -499,20 +499,20 @@ TEST_F(SdfSmokeTest, R5_MinMaxMinMaxFunc) {
}
// Test MinMax to_string
TEST_F(SdfSmokeTest, R5_MinMaxToString) {
TEST_F(SdfSmokeTest, MinMaxToString) {
EXPECT_EQ(MinMax::min()->to_string(), "min");
EXPECT_EQ(MinMax::max()->to_string(), "max");
}
// Test MinMaxAll to_string
TEST_F(SdfSmokeTest, R5_MinMaxAllToString) {
TEST_F(SdfSmokeTest, MinMaxAllToString) {
EXPECT_EQ(MinMaxAll::min()->to_string(), "min");
EXPECT_EQ(MinMaxAll::max()->to_string(), "max");
EXPECT_EQ(MinMaxAll::all()->to_string(), "all");
}
// Test MinMax initValueInt
TEST_F(SdfSmokeTest, R5_MinMaxInitValueInt) {
TEST_F(SdfSmokeTest, MinMaxInitValueInt) {
// min's init value is a large positive integer
EXPECT_GT(MinMax::min()->initValueInt(), 0);
// max's init value is a large negative integer
@ -520,7 +520,7 @@ TEST_F(SdfSmokeTest, R5_MinMaxInitValueInt) {
}
// Test MinMaxAll rangeIndex
TEST_F(SdfSmokeTest, R5_MinMaxAllRangeIndex) {
TEST_F(SdfSmokeTest, MinMaxAllRangeIndex) {
auto &min_range_idx = MinMaxAll::min()->rangeIndex();
EXPECT_EQ(min_range_idx.size(), 1u);
EXPECT_EQ(min_range_idx[0], MinMax::minIndex());
@ -535,7 +535,7 @@ TEST_F(SdfSmokeTest, R5_MinMaxAllRangeIndex) {
// Test MinMax constructor coverage (exercises internal MinMax ctor)
// Covers: MinMax::MinMax(const char*, int, float, int, compare_fn)
TEST_F(SdfSmokeTest, R6_MinMaxConstructorCoverage) {
TEST_F(SdfSmokeTest, MinMaxConstructorCoverage) {
// The MinMax constructor is private; we verify it was called via singletons
const MinMax *mn = MinMax::min();
EXPECT_STREQ(mn->to_string().c_str(), "min");
@ -557,14 +557,14 @@ TEST_F(SdfSmokeTest, R6_MinMaxConstructorCoverage) {
// Test MinMax minMax with equal values
// Covers: MinMax::minMax edge case
TEST_F(SdfSmokeTest, R6_MinMaxMinMaxEqualValues) {
TEST_F(SdfSmokeTest, MinMaxMinMaxEqualValues) {
EXPECT_FLOAT_EQ(MinMax::min()->minMax(5.0f, 5.0f), 5.0f);
EXPECT_FLOAT_EQ(MinMax::max()->minMax(5.0f, 5.0f), 5.0f);
}
// Test MinMaxAll index values
// Covers: MinMaxAll constructor internals
TEST_F(SdfSmokeTest, R6_MinMaxAllIndices) {
TEST_F(SdfSmokeTest, MinMaxAllIndices) {
EXPECT_EQ(MinMaxAll::min()->index(), 0);
EXPECT_EQ(MinMaxAll::max()->index(), 1);
EXPECT_EQ(MinMaxAll::all()->index(), 2);
@ -572,14 +572,14 @@ TEST_F(SdfSmokeTest, R6_MinMaxAllIndices) {
// Test MinMax find with nullptr
// Covers: MinMax::find edge case
TEST_F(SdfSmokeTest, R6_MinMaxFindNull) {
TEST_F(SdfSmokeTest, MinMaxFindNull) {
const MinMax *result = MinMax::find("invalid_string");
EXPECT_EQ(result, nullptr);
}
// Test RiseFall asRiseFallBoth
// Covers: RiseFall::asRiseFallBoth
TEST_F(SdfSmokeTest, R6_RiseFallAsRiseFallBoth) {
TEST_F(SdfSmokeTest, RiseFallAsRiseFallBoth2) {
const RiseFallBoth *rfb = RiseFall::rise()->asRiseFallBoth();
EXPECT_EQ(rfb, RiseFallBoth::rise());
rfb = RiseFall::fall()->asRiseFallBoth();
@ -588,7 +588,7 @@ TEST_F(SdfSmokeTest, R6_RiseFallAsRiseFallBoth) {
// Test Transition::riseFall matches all transitions
// Covers: Transition::matches for riseFall wildcard
TEST_F(SdfSmokeTest, R6_TransitionRiseFallMatchesAll) {
TEST_F(SdfSmokeTest, TransitionRiseFallMatchesAll) {
EXPECT_TRUE(Transition::riseFall()->matches(Transition::rise()));
EXPECT_TRUE(Transition::riseFall()->matches(Transition::fall()));
EXPECT_TRUE(Transition::riseFall()->matches(Transition::tr0Z()));
@ -605,21 +605,21 @@ TEST_F(SdfSmokeTest, R6_TransitionRiseFallMatchesAll) {
// Test Transition::find with empty/unknown string
// Covers: Transition::find edge case
TEST_F(SdfSmokeTest, R6_TransitionFindUnknown) {
TEST_F(SdfSmokeTest, TransitionFindUnknown) {
const Transition *t = Transition::find("nonexistent");
EXPECT_EQ(t, nullptr);
}
// Test RiseFall::find with unknown string
// Covers: RiseFall::find edge case
TEST_F(SdfSmokeTest, R6_RiseFallFindUnknown) {
TEST_F(SdfSmokeTest, RiseFallFindUnknown) {
const RiseFall *rf = RiseFall::find("unknown");
EXPECT_EQ(rf, nullptr);
}
// Test Transition::maxIndex value
// Covers: Transition::maxIndex
TEST_F(SdfSmokeTest, R6_TransitionMaxIndex) {
TEST_F(SdfSmokeTest, TransitionMaxIndex) {
// Transition::maxIndex() returns the max valid index
EXPECT_GE(Transition::maxIndex(), 1);
// All transitions should have index <= maxIndex
@ -629,21 +629,21 @@ TEST_F(SdfSmokeTest, R6_TransitionMaxIndex) {
// Test RiseFall to_string
// Covers: RiseFall::to_string
TEST_F(SdfSmokeTest, R6_RiseFallToString) {
TEST_F(SdfSmokeTest, RiseFallToString) {
EXPECT_EQ(RiseFall::rise()->to_string(), "^");
EXPECT_EQ(RiseFall::fall()->to_string(), "v");
}
// Test MinMax compare with equal values
// Covers: MinMax::compare edge case
TEST_F(SdfSmokeTest, R6_MinMaxCompareEqual) {
TEST_F(SdfSmokeTest, MinMaxCompareEqual) {
EXPECT_FALSE(MinMax::min()->compare(5.0f, 5.0f));
EXPECT_FALSE(MinMax::max()->compare(5.0f, 5.0f));
}
// Test MinMax compare with negative values
// Covers: MinMax::compare with negatives
TEST_F(SdfSmokeTest, R6_MinMaxCompareNegative) {
TEST_F(SdfSmokeTest, MinMaxCompareNegative) {
EXPECT_TRUE(MinMax::min()->compare(-2.0f, -1.0f));
EXPECT_FALSE(MinMax::min()->compare(-1.0f, -2.0f));
EXPECT_TRUE(MinMax::max()->compare(-1.0f, -2.0f));
@ -652,7 +652,7 @@ TEST_F(SdfSmokeTest, R6_MinMaxCompareNegative) {
// Test MinMax compare with zero
// Covers: MinMax::compare with zero
TEST_F(SdfSmokeTest, R6_MinMaxCompareZero) {
TEST_F(SdfSmokeTest, MinMaxCompareZero) {
EXPECT_TRUE(MinMax::min()->compare(0.0f, 1.0f));
EXPECT_FALSE(MinMax::min()->compare(0.0f, 0.0f));
EXPECT_TRUE(MinMax::max()->compare(1.0f, 0.0f));
@ -661,7 +661,7 @@ TEST_F(SdfSmokeTest, R6_MinMaxCompareZero) {
// Test MinMaxAll range sizes
// Covers: MinMaxAll::range
TEST_F(SdfSmokeTest, R6_MinMaxAllRangeSizes) {
TEST_F(SdfSmokeTest, MinMaxAllRangeSizes) {
EXPECT_EQ(MinMaxAll::min()->range().size(), 1u);
EXPECT_EQ(MinMaxAll::max()->range().size(), 1u);
EXPECT_EQ(MinMaxAll::all()->range().size(), 2u);
@ -669,7 +669,7 @@ TEST_F(SdfSmokeTest, R6_MinMaxAllRangeSizes) {
// Test Transition sdfTripleIndex uniqueness
// Covers: Transition::sdfTripleIndex
TEST_F(SdfSmokeTest, R6_TransitionSdfTripleIndexUnique) {
TEST_F(SdfSmokeTest, TransitionSdfTripleIndexUnique) {
std::set<int> indices;
indices.insert(Transition::rise()->sdfTripleIndex());
indices.insert(Transition::fall()->sdfTripleIndex());
@ -688,7 +688,7 @@ TEST_F(SdfSmokeTest, R6_TransitionSdfTripleIndexUnique) {
// Test RiseFall range iteration
// Covers: RiseFall::range
TEST_F(SdfSmokeTest, R6_RiseFallRangeIteration) {
TEST_F(SdfSmokeTest, RiseFallRangeIteration) {
int count = 0;
for (auto rf : RiseFall::range()) {
EXPECT_NE(rf, nullptr);
@ -699,7 +699,7 @@ TEST_F(SdfSmokeTest, R6_RiseFallRangeIteration) {
// Test MinMax range
// Covers: MinMax::range
TEST_F(SdfSmokeTest, R6_MinMaxRangeIteration) {
TEST_F(SdfSmokeTest, MinMaxRangeIteration) {
int count = 0;
for (auto mm : MinMax::range()) {
EXPECT_NE(mm, nullptr);
@ -710,14 +710,14 @@ TEST_F(SdfSmokeTest, R6_MinMaxRangeIteration) {
// Test RiseFallBoth find with nullptr
// Covers: RiseFallBoth::find edge case
TEST_F(SdfSmokeTest, R6_RiseFallBothFindNull) {
TEST_F(SdfSmokeTest, RiseFallBothFindNull) {
const RiseFallBoth *result = RiseFallBoth::find("nonexistent");
EXPECT_EQ(result, nullptr);
}
// Test Transition asRiseFallBoth for non-rise/fall transitions
// Covers: Transition::asRiseFallBoth edge cases
TEST_F(SdfSmokeTest, R6_TransitionAsRiseFallBothTristate) {
TEST_F(SdfSmokeTest, TransitionAsRiseFallBothTristate) {
// Tristate transitions should still return valid RiseFallBoth
const RiseFallBoth *rfb_0z = Transition::tr0Z()->asRiseFallBoth();
EXPECT_NE(rfb_0z, nullptr);
@ -725,7 +725,7 @@ TEST_F(SdfSmokeTest, R6_TransitionAsRiseFallBothTristate) {
// Test Transition to_string for riseFall wildcard
// Covers: Transition::to_string for riseFall
TEST_F(SdfSmokeTest, R6_TransitionRiseFallToString) {
TEST_F(SdfSmokeTest, TransitionRiseFallToString) {
EXPECT_FALSE(Transition::riseFall()->to_string().empty());
}
@ -816,7 +816,7 @@ protected:
// Covers: SdfWriter::~SdfWriter, SdfWriter::writeTrailer,
// SdfWriter::writeInstTrailer, SdfWriter::writeTimingCheckHeader,
// SdfWriter::writeTimingCheckTrailer, SdfWriter::sdfEdge
TEST_F(SdfDesignTest, R8_WriteSdfExercisesWriter) {
TEST_F(SdfDesignTest, WriteSdfExercisesWriter) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -843,7 +843,7 @@ TEST_F(SdfDesignTest, R8_WriteSdfExercisesWriter) {
// Test writeSdf with gzip
// Covers: SdfWriter methods through gzip path
TEST_F(SdfDesignTest, R8_WriteSdfGzip) {
TEST_F(SdfDesignTest, WriteSdfGzip) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -871,7 +871,7 @@ TEST_F(SdfDesignTest, R8_WriteSdfGzip) {
// Test writeSdf with dot divider
// Covers: SdfWriter path separator handling
TEST_F(SdfDesignTest, R9_WriteSdfDotDivider) {
TEST_F(SdfDesignTest, WriteSdfDotDivider) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -893,7 +893,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfDotDivider) {
// Test writeSdf without typ values
// Covers: SdfWriter min/max only path
TEST_F(SdfDesignTest, R9_WriteSdfNoTyp) {
TEST_F(SdfDesignTest, WriteSdfNoTyp) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -915,7 +915,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfNoTyp) {
// Test writeSdf with high precision
// Covers: SdfWriter digit formatting
TEST_F(SdfDesignTest, R9_WriteSdfHighPrecision) {
TEST_F(SdfDesignTest, WriteSdfHighPrecision) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -937,7 +937,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfHighPrecision) {
// Test writeSdf with no_timestamp
// Covers: SdfWriter header control
TEST_F(SdfDesignTest, R9_WriteSdfNoTimestamp) {
TEST_F(SdfDesignTest, WriteSdfNoTimestamp) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -959,7 +959,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfNoTimestamp) {
// Test writeSdf with no_timescale
// Covers: SdfWriter timescale control
TEST_F(SdfDesignTest, R9_WriteSdfNoTimescale) {
TEST_F(SdfDesignTest, WriteSdfNoTimescale) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -981,7 +981,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfNoTimescale) {
// Test writeSdf and readSdf round-trip
// Covers: readSdf, SdfReader constructor, SdfScanner, SdfPortSpec, SdfTriple
TEST_F(SdfDesignTest, R9_WriteThenReadSdf) {
TEST_F(SdfDesignTest, WriteThenReadSdf) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1002,7 +1002,7 @@ TEST_F(SdfDesignTest, R9_WriteThenReadSdf) {
// Test readSdf with unescaped_dividers option
// Covers: SdfReader unescaped divider path
TEST_F(SdfDesignTest, R9_ReadSdfUnescapedDividers) {
TEST_F(SdfDesignTest, ReadSdfUnescapedDividers) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1022,7 +1022,7 @@ TEST_F(SdfDesignTest, R9_ReadSdfUnescapedDividers) {
// Test readSdf with incremental_only option
// Covers: SdfReader incremental_only path
TEST_F(SdfDesignTest, R9_ReadSdfIncrementalOnly) {
TEST_F(SdfDesignTest, ReadSdfIncrementalOnly) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1042,7 +1042,7 @@ TEST_F(SdfDesignTest, R9_ReadSdfIncrementalOnly) {
// Test readSdf with cond_use min
// Covers: SdfReader cond_use min path
TEST_F(SdfDesignTest, R9_ReadSdfCondUseMin) {
TEST_F(SdfDesignTest, ReadSdfCondUseMin) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1062,7 +1062,7 @@ TEST_F(SdfDesignTest, R9_ReadSdfCondUseMin) {
// Test readSdf with cond_use max
// Covers: SdfReader cond_use max path
TEST_F(SdfDesignTest, R9_ReadSdfCondUseMax) {
TEST_F(SdfDesignTest, ReadSdfCondUseMax) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1082,7 +1082,7 @@ TEST_F(SdfDesignTest, R9_ReadSdfCondUseMax) {
// Test writeSdf then read with both unescaped and incremental
// Covers: combined SdfReader option paths
TEST_F(SdfDesignTest, R9_ReadSdfCombinedOptions) {
TEST_F(SdfDesignTest, ReadSdfCombinedOptions) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1102,7 +1102,7 @@ TEST_F(SdfDesignTest, R9_ReadSdfCombinedOptions) {
// Test writeSdf with low precision (1 digit)
// Covers: SdfWriter digit formatting edge case
TEST_F(SdfDesignTest, R9_WriteSdfLowPrecision) {
TEST_F(SdfDesignTest, WriteSdfLowPrecision) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1124,7 +1124,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfLowPrecision) {
// Test writeSdf gzip then readSdf
// Covers: SdfReader gzip input path
TEST_F(SdfDesignTest, R9_WriteSdfGzipThenRead) {
TEST_F(SdfDesignTest, WriteSdfGzipThenRead) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1144,7 +1144,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfGzipThenRead) {
// Test writeSdf with no_timestamp and no_timescale
// Covers: SdfWriter combined header options
TEST_F(SdfDesignTest, R9_WriteSdfNoTimestampNoTimescale) {
TEST_F(SdfDesignTest, WriteSdfNoTimestampNoTimescale) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1166,7 +1166,7 @@ TEST_F(SdfDesignTest, R9_WriteSdfNoTimestampNoTimescale) {
// Test readSdf with nonexistent file throws FileNotReadable
// Covers: SdfReader error handling path
TEST_F(SdfDesignTest, R9_ReadSdfNonexistent) {
TEST_F(SdfDesignTest, ReadSdfNonexistent) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1180,7 +1180,7 @@ TEST_F(SdfDesignTest, R9_ReadSdfNonexistent) {
}
// R9_ SdfSmokeTest - Transition properties for SDF
TEST_F(SdfSmokeTest, R9_TransitionRiseProperties) {
TEST_F(SdfSmokeTest, TransitionRiseProperties) {
const Transition *t = Transition::rise();
EXPECT_NE(t, nullptr);
EXPECT_EQ(t->asRiseFall(), RiseFall::rise());
@ -1189,7 +1189,7 @@ TEST_F(SdfSmokeTest, R9_TransitionRiseProperties) {
EXPECT_NE(t->asInitFinalString(), nullptr);
}
TEST_F(SdfSmokeTest, R9_TransitionFallProperties) {
TEST_F(SdfSmokeTest, TransitionFallProperties) {
const Transition *t = Transition::fall();
EXPECT_NE(t, nullptr);
EXPECT_EQ(t->asRiseFall(), RiseFall::fall());
@ -1198,7 +1198,7 @@ TEST_F(SdfSmokeTest, R9_TransitionFallProperties) {
EXPECT_NE(t->asInitFinalString(), nullptr);
}
TEST_F(SdfSmokeTest, R9_TransitionTristateProperties) {
TEST_F(SdfSmokeTest, TransitionTristateProperties) {
// 0Z
const Transition *t0z = Transition::tr0Z();
EXPECT_NE(t0z, nullptr);
@ -1221,7 +1221,7 @@ TEST_F(SdfSmokeTest, R9_TransitionTristateProperties) {
EXPECT_NE(tz0->asRiseFallBoth(), nullptr);
}
TEST_F(SdfSmokeTest, R9_TransitionUnknownProperties) {
TEST_F(SdfSmokeTest, TransitionUnknownProperties) {
// 0X
const Transition *t0x = Transition::tr0X();
EXPECT_NE(t0x, nullptr);
@ -1243,7 +1243,7 @@ TEST_F(SdfSmokeTest, R9_TransitionUnknownProperties) {
EXPECT_NE(tx0->asRiseFallBoth(), nullptr);
}
TEST_F(SdfSmokeTest, R9_TransitionHighZUnknown) {
TEST_F(SdfSmokeTest, TransitionHighZUnknown) {
// XZ
const Transition *txz = Transition::trXZ();
EXPECT_NE(txz, nullptr);
@ -1255,7 +1255,7 @@ TEST_F(SdfSmokeTest, R9_TransitionHighZUnknown) {
EXPECT_FALSE(tzx->to_string().empty());
}
TEST_F(SdfSmokeTest, R9_RiseFallBothRiseFallMatches) {
TEST_F(SdfSmokeTest, RiseFallBothRiseFallMatches) {
EXPECT_TRUE(RiseFallBoth::riseFall()->matches(RiseFall::rise()));
EXPECT_TRUE(RiseFallBoth::riseFall()->matches(RiseFall::fall()));
EXPECT_TRUE(RiseFallBoth::rise()->matches(RiseFall::rise()));
@ -1264,7 +1264,7 @@ TEST_F(SdfSmokeTest, R9_RiseFallBothRiseFallMatches) {
EXPECT_TRUE(RiseFallBoth::fall()->matches(RiseFall::fall()));
}
TEST_F(SdfSmokeTest, R9_MinMaxAllRange) {
TEST_F(SdfSmokeTest, MinMaxAllRange2) {
// Verify MinMaxAll::all() range contains both min and max
int count = 0;
for (auto mm : MinMaxAll::all()->range()) {
@ -1274,7 +1274,7 @@ TEST_F(SdfSmokeTest, R9_MinMaxAllRange) {
EXPECT_EQ(count, 2);
}
TEST_F(SdfSmokeTest, R9_MinMaxInitValue) {
TEST_F(SdfSmokeTest, MinMaxInitValue2) {
// min init value is large positive (for finding minimum)
float min_init = MinMax::min()->initValue();
EXPECT_GT(min_init, 0.0f);
@ -1284,7 +1284,7 @@ TEST_F(SdfSmokeTest, R9_MinMaxInitValue) {
EXPECT_LT(max_init, 0.0f);
}
TEST_F(SdfSmokeTest, R9_MinMaxCompareExtremes) {
TEST_F(SdfSmokeTest, MinMaxCompareExtremes) {
// Very large values
EXPECT_TRUE(MinMax::min()->compare(1e10f, 1e20f));
EXPECT_FALSE(MinMax::min()->compare(1e20f, 1e10f));
@ -1296,7 +1296,7 @@ TEST_F(SdfSmokeTest, R9_MinMaxCompareExtremes) {
EXPECT_TRUE(MinMax::max()->compare(1e-10f, 1e-20f));
}
TEST_F(SdfSmokeTest, R9_RiseFallToStringAndFind) {
TEST_F(SdfSmokeTest, RiseFallToStringAndFind) {
EXPECT_EQ(RiseFall::rise()->to_string(), "^");
EXPECT_EQ(RiseFall::fall()->to_string(), "v");
EXPECT_EQ(RiseFall::find("^"), RiseFall::rise());
@ -1305,44 +1305,44 @@ TEST_F(SdfSmokeTest, R9_RiseFallToStringAndFind) {
EXPECT_EQ(RiseFall::find("fall"), RiseFall::fall());
}
TEST_F(SdfSmokeTest, R9_TransitionFindByName) {
TEST_F(SdfSmokeTest, TransitionFindByName) {
EXPECT_EQ(Transition::find("^"), Transition::rise());
EXPECT_EQ(Transition::find("v"), Transition::fall());
EXPECT_EQ(Transition::find("nonexistent"), nullptr);
}
TEST_F(SdfSmokeTest, R9_MinMaxAllAsMinMax) {
TEST_F(SdfSmokeTest, MinMaxAllAsMinMax2) {
EXPECT_EQ(MinMaxAll::min()->asMinMax(), MinMax::min());
EXPECT_EQ(MinMaxAll::max()->asMinMax(), MinMax::max());
}
TEST_F(SdfSmokeTest, R9_RiseFallOpposite) {
TEST_F(SdfSmokeTest, RiseFallOpposite2) {
EXPECT_EQ(RiseFall::rise()->opposite(), RiseFall::fall());
EXPECT_EQ(RiseFall::fall()->opposite(), RiseFall::rise());
}
TEST_F(SdfSmokeTest, R9_TransitionMatchesSelf) {
TEST_F(SdfSmokeTest, TransitionMatchesSelf2) {
EXPECT_TRUE(Transition::rise()->matches(Transition::rise()));
EXPECT_TRUE(Transition::fall()->matches(Transition::fall()));
EXPECT_FALSE(Transition::rise()->matches(Transition::fall()));
EXPECT_FALSE(Transition::fall()->matches(Transition::rise()));
}
TEST_F(SdfSmokeTest, R9_TransitionMatchesRiseFallWildcard) {
TEST_F(SdfSmokeTest, TransitionMatchesRiseFallWildcard) {
EXPECT_TRUE(Transition::riseFall()->matches(Transition::rise()));
EXPECT_TRUE(Transition::riseFall()->matches(Transition::fall()));
EXPECT_TRUE(Transition::riseFall()->matches(Transition::tr0Z()));
EXPECT_TRUE(Transition::riseFall()->matches(Transition::trXZ()));
}
TEST_F(SdfSmokeTest, R9_MinMaxMinMaxFunc) {
TEST_F(SdfSmokeTest, MinMaxMinMaxFunc3) {
EXPECT_FLOAT_EQ(MinMax::min()->minMax(10.0f, 20.0f), 10.0f);
EXPECT_FLOAT_EQ(MinMax::max()->minMax(10.0f, 20.0f), 20.0f);
EXPECT_FLOAT_EQ(MinMax::min()->minMax(-5.0f, 5.0f), -5.0f);
EXPECT_FLOAT_EQ(MinMax::max()->minMax(-5.0f, 5.0f), 5.0f);
}
TEST_F(SdfSmokeTest, R9_RiseFallBothFind) {
TEST_F(SdfSmokeTest, RiseFallBothFind) {
EXPECT_EQ(RiseFallBoth::find("rise"), RiseFallBoth::rise());
EXPECT_EQ(RiseFallBoth::find("fall"), RiseFallBoth::fall());
EXPECT_EQ(RiseFallBoth::find("rise_fall"), RiseFallBoth::riseFall());
@ -1355,7 +1355,7 @@ TEST_F(SdfSmokeTest, R9_RiseFallBothFind) {
// R11_1: Write SDF then read it with a path argument
// Covers: SdfReader with path set, SdfTriple construction paths
TEST_F(SdfDesignTest, R11_ReadSdfWithPath) {
TEST_F(SdfDesignTest, ReadSdfWithPath) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1376,7 +1376,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfWithPath) {
// R11_2: Read a hand-crafted SDF with specific constructs to exercise
// SdfReader::makeTriple(), makeTriple(float), SdfPortSpec, SdfTriple::hasValue
TEST_F(SdfDesignTest, R11_ReadHandCraftedSdf) {
TEST_F(SdfDesignTest, ReadHandCraftedSdf) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1417,7 +1417,7 @@ TEST_F(SdfDesignTest, R11_ReadHandCraftedSdf) {
// R11_3: Read SDF with edge-specific IOPATH (posedge, negedge)
// Covers: SdfPortSpec with transitions, sdfEdge paths
TEST_F(SdfDesignTest, R11_ReadSdfEdgeIopath) {
TEST_F(SdfDesignTest, ReadSdfEdgeIopath) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1454,7 +1454,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfEdgeIopath) {
// R11_4: Read SDF with SETUPHOLD combined check
// Covers: SdfReader::timingCheckSetupHold path
TEST_F(SdfDesignTest, R11_ReadSdfSetupHold) {
TEST_F(SdfDesignTest, ReadSdfSetupHold) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1488,7 +1488,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfSetupHold) {
// R11_5: Read SDF with RECREM combined check
// Covers: SdfReader::timingCheckRecRem path
TEST_F(SdfDesignTest, R11_ReadSdfRecRem) {
TEST_F(SdfDesignTest, ReadSdfRecRem) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1522,7 +1522,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfRecRem) {
// R11_6: Read SDF with WIDTH check
// Covers: SdfReader::timingCheckWidth path
TEST_F(SdfDesignTest, R11_ReadSdfWidth) {
TEST_F(SdfDesignTest, ReadSdfWidth) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1556,7 +1556,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfWidth) {
// R11_7: Read SDF with PERIOD check
// Covers: SdfReader::timingCheckPeriod path
TEST_F(SdfDesignTest, R11_ReadSdfPeriod) {
TEST_F(SdfDesignTest, ReadSdfPeriod) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1591,7 +1591,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfPeriod) {
// R11_8: Read SDF with NOCHANGE check
// Covers: SdfReader::timingCheckNochange, notSupported
// NOCHANGE is not supported and throws, so we catch the exception
TEST_F(SdfDesignTest, R11_ReadSdfNochange) {
TEST_F(SdfDesignTest, ReadSdfNochange) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1628,7 +1628,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfNochange) {
// R11_9: Read SDF with INTERCONNECT delay
// Covers: SdfReader::interconnect path
TEST_F(SdfDesignTest, R11_ReadSdfInterconnect) {
TEST_F(SdfDesignTest, ReadSdfInterconnect) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();
@ -1664,7 +1664,7 @@ TEST_F(SdfDesignTest, R11_ReadSdfInterconnect) {
// R11_10: WriteSdf with include_typ=true and no_version=false to cover
// the writeHeader path with version
TEST_F(SdfDesignTest, R11_WriteSdfWithVersion) {
TEST_F(SdfDesignTest, WriteSdfWithVersion) {
ASSERT_TRUE(design_loaded_);
sta_->ensureGraph();

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
#include <gtest/gtest.h>
#include <fstream>
#include <cstdio>
#include <unistd.h>
#include "MinMax.hh"
#include "Transition.hh"
@ -33,7 +34,11 @@ TEST_F(SpiceSmokeTest, TransitionNames) {
class StreamPrintTest : public ::testing::Test {
protected:
void SetUp() override {
tmpfile_ = std::tmpnam(nullptr);
char tmpl[] = "/tmp/sta_spice_test_XXXXXX";
int fd = mkstemp(tmpl);
ASSERT_NE(fd, -1);
close(fd);
tmpfile_ = tmpl;
}
void TearDown() override {
std::remove(tmpfile_.c_str());
@ -97,7 +102,11 @@ TEST_F(StreamPrintTest, MultipleWrites) {
class XyceCsvTest : public ::testing::Test {
protected:
void SetUp() override {
tmpfile_ = std::tmpnam(nullptr);
char tmpl[] = "/tmp/sta_xyce_test_XXXXXX";
int fd = mkstemp(tmpl);
ASSERT_NE(fd, -1);
close(fd);
tmpfile_ = tmpl;
}
void TearDown() override {
std::remove(tmpfile_.c_str());
@ -465,7 +474,7 @@ TEST_F(SpiceSmokeTest, MinMaxCompare) {
}
// Test RiseFall find
TEST_F(SpiceSmokeTest, R5_RiseFallFind) {
TEST_F(SpiceSmokeTest, RiseFallFind) {
EXPECT_EQ(RiseFall::find("rise"), RiseFall::rise());
EXPECT_EQ(RiseFall::find("fall"), RiseFall::fall());
EXPECT_EQ(RiseFall::find("^"), RiseFall::rise());
@ -474,13 +483,13 @@ TEST_F(SpiceSmokeTest, R5_RiseFallFind) {
}
// Test Transition find used in spice
TEST_F(SpiceSmokeTest, R5_TransitionFind) {
TEST_F(SpiceSmokeTest, TransitionFind) {
EXPECT_EQ(Transition::find("^"), Transition::rise());
EXPECT_EQ(Transition::find("v"), Transition::fall());
}
// Test streamPrint with empty format
TEST_F(StreamPrintTest, R5_EmptyFormat) {
TEST_F(StreamPrintTest, EmptyFormat) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "%s", "");
@ -493,7 +502,7 @@ TEST_F(StreamPrintTest, R5_EmptyFormat) {
}
// Test streamPrint with integer formatting
TEST_F(StreamPrintTest, R5_IntegerFormatting) {
TEST_F(StreamPrintTest, IntegerFormatting) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "R%d %d %d %.2f\n", 1, 10, 20, 100.5);
@ -506,7 +515,7 @@ TEST_F(StreamPrintTest, R5_IntegerFormatting) {
}
// Test streamPrint with multiple lines
TEST_F(StreamPrintTest, R5_MultipleLines) {
TEST_F(StreamPrintTest, MultipleLines) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "line1\n");
@ -525,7 +534,7 @@ TEST_F(StreamPrintTest, R5_MultipleLines) {
}
// Test streamPrint with special characters
TEST_F(StreamPrintTest, R5_SpecialChars) {
TEST_F(StreamPrintTest, SpecialChars) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "* SPICE deck for %s\n", "test_design");
@ -538,7 +547,7 @@ TEST_F(StreamPrintTest, R5_SpecialChars) {
}
// Test RiseFall index constants used by spice
TEST_F(SpiceSmokeTest, R5_RiseFallIndexConstants) {
TEST_F(SpiceSmokeTest, RiseFallIndexConstants) {
EXPECT_EQ(RiseFall::riseIndex(), 0);
EXPECT_EQ(RiseFall::fallIndex(), 1);
// index_count is a static constexpr, verify via range size
@ -546,7 +555,7 @@ TEST_F(SpiceSmokeTest, R5_RiseFallIndexConstants) {
}
// Test RiseFall range iteration used in spice
TEST_F(SpiceSmokeTest, R5_RiseFallRange) {
TEST_F(SpiceSmokeTest, RiseFallRange2) {
int count = 0;
for (auto rf : RiseFall::range()) {
EXPECT_NE(rf, nullptr);
@ -556,20 +565,20 @@ TEST_F(SpiceSmokeTest, R5_RiseFallRange) {
}
// Test RiseFallBoth range
TEST_F(SpiceSmokeTest, R5_RiseFallBothRange) {
TEST_F(SpiceSmokeTest, RiseFallBothRange) {
EXPECT_NE(RiseFallBoth::rise(), nullptr);
EXPECT_NE(RiseFallBoth::fall(), nullptr);
EXPECT_NE(RiseFallBoth::riseFall(), nullptr);
}
// Test Transition init strings used in WriteSpice
TEST_F(SpiceSmokeTest, R5_TransitionInitFinalStrings) {
TEST_F(SpiceSmokeTest, TransitionInitFinalStrings) {
EXPECT_NE(Transition::rise()->asInitFinalString(), nullptr);
EXPECT_NE(Transition::fall()->asInitFinalString(), nullptr);
}
// Test MinMax initValue used in spice
TEST_F(SpiceSmokeTest, R5_MinMaxInitValue) {
TEST_F(SpiceSmokeTest, MinMaxInitValue) {
float min_init = MinMax::min()->initValue();
float max_init = MinMax::max()->initValue();
EXPECT_GT(min_init, 0.0f);
@ -577,7 +586,7 @@ TEST_F(SpiceSmokeTest, R5_MinMaxInitValue) {
}
// Test MinMax opposite used in spice
TEST_F(SpiceSmokeTest, R5_MinMaxOpposite) {
TEST_F(SpiceSmokeTest, MinMaxOpposite) {
EXPECT_EQ(MinMax::min()->opposite(), MinMax::max());
EXPECT_EQ(MinMax::max()->opposite(), MinMax::min());
}
@ -588,7 +597,7 @@ TEST_F(SpiceSmokeTest, R5_MinMaxOpposite) {
// Test streamPrint with wide variety of format specifiers
// Covers: streamPrint with many format types
TEST_F(StreamPrintTest, R6_FormatSpecifiers) {
TEST_F(StreamPrintTest, FormatSpecifiers) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "%c %s %d %f %e %g\n", 'A', "test", 42, 3.14, 1.5e-12, 1.8);
@ -604,7 +613,7 @@ TEST_F(StreamPrintTest, R6_FormatSpecifiers) {
// Test streamPrint with SPICE node naming
// Covers: streamPrint for SPICE net naming patterns
TEST_F(StreamPrintTest, R6_SpiceNodeNaming) {
TEST_F(StreamPrintTest, SpiceNodeNaming) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "C%d %s %s %.4e\n", 1, "n_top/sub/net:1", "0", 1.5e-15);
@ -619,7 +628,7 @@ TEST_F(StreamPrintTest, R6_SpiceNodeNaming) {
// Test streamPrint with SPICE .include directive
// Covers: streamPrint for SPICE directives
TEST_F(StreamPrintTest, R6_SpiceIncludeDirective) {
TEST_F(StreamPrintTest, SpiceIncludeDirective) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".include \"%s\"\n", "/path/to/models.spice");
@ -634,7 +643,7 @@ TEST_F(StreamPrintTest, R6_SpiceIncludeDirective) {
// Test streamPrint SPICE voltage source
// Covers: streamPrint for voltage sources
TEST_F(StreamPrintTest, R6_SpiceVoltageSource) {
TEST_F(StreamPrintTest, SpiceVoltageSource) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "v%s %s 0 %.3f\n", "dd", "vdd", 1.800);
@ -648,7 +657,7 @@ TEST_F(StreamPrintTest, R6_SpiceVoltageSource) {
// Test streamPrint SPICE .tran with detailed parameters
// Covers: streamPrint for transient analysis
TEST_F(StreamPrintTest, R6_SpiceTransAnalysis) {
TEST_F(StreamPrintTest, SpiceTransAnalysis) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".tran %g %g %g %g\n", 1e-13, 5e-9, 0.0, 1e-12);
@ -662,7 +671,7 @@ TEST_F(StreamPrintTest, R6_SpiceTransAnalysis) {
// Test streamPrint SPICE PWL source
// Covers: streamPrint with PWL voltage source
TEST_F(StreamPrintTest, R6_SpicePWLSource) {
TEST_F(StreamPrintTest, SpicePWLSource) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "v_in in 0 PWL(\n");
@ -680,7 +689,7 @@ TEST_F(StreamPrintTest, R6_SpicePWLSource) {
// Test readXyceCsv with precision values
// Covers: readXyceCsv parsing
TEST_F(XyceCsvTest, R6_ReadPrecisionValues) {
TEST_F(XyceCsvTest, ReadPrecisionValues) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(out)\n";
@ -701,7 +710,7 @@ TEST_F(XyceCsvTest, R6_ReadPrecisionValues) {
// Test readXyceCsv with many signals
// Covers: readXyceCsv with wide data
TEST_F(XyceCsvTest, R6_ReadManySignals) {
TEST_F(XyceCsvTest, ReadManySignals) {
{
std::ofstream out(tmpfile_);
out << "TIME";
@ -727,7 +736,7 @@ TEST_F(XyceCsvTest, R6_ReadManySignals) {
// Test Transition asRiseFall returns correct mapping for all types
// Covers: Transition::asRiseFall for spice
TEST_F(SpiceSmokeTest, R6_TransitionAsRiseFallMapping) {
TEST_F(SpiceSmokeTest, TransitionAsRiseFallMapping) {
// Rise-type transitions
EXPECT_EQ(Transition::rise()->asRiseFall(), RiseFall::rise());
EXPECT_EQ(Transition::tr0Z()->asRiseFall(), RiseFall::rise());
@ -749,7 +758,7 @@ TEST_F(SpiceSmokeTest, R6_TransitionAsRiseFallMapping) {
// Test MinMax compare function exhaustively
// Covers: MinMax::compare
TEST_F(SpiceSmokeTest, R6_MinMaxCompareExhaustive) {
TEST_F(SpiceSmokeTest, MinMaxCompareExhaustive) {
// min: true when v1 < v2
EXPECT_TRUE(MinMax::min()->compare(-1.0f, 0.0f));
EXPECT_TRUE(MinMax::min()->compare(0.0f, 1.0f));
@ -765,7 +774,7 @@ TEST_F(SpiceSmokeTest, R6_MinMaxCompareExhaustive) {
// Test MinMax find by string name
// Covers: MinMax::find
TEST_F(SpiceSmokeTest, R6_MinMaxFindByName) {
TEST_F(SpiceSmokeTest, MinMaxFindByName) {
EXPECT_EQ(MinMax::find("min"), MinMax::min());
EXPECT_EQ(MinMax::find("max"), MinMax::max());
EXPECT_EQ(MinMax::find("unknown"), nullptr);
@ -773,14 +782,14 @@ TEST_F(SpiceSmokeTest, R6_MinMaxFindByName) {
// Test MinMax to_string
// Covers: MinMax::to_string
TEST_F(SpiceSmokeTest, R6_MinMaxToString) {
TEST_F(SpiceSmokeTest, MinMaxToString) {
EXPECT_EQ(MinMax::min()->to_string(), "min");
EXPECT_EQ(MinMax::max()->to_string(), "max");
}
// Test RiseFall shortName
// Covers: RiseFall::shortName
TEST_F(SpiceSmokeTest, R6_RiseFallShortName) {
TEST_F(SpiceSmokeTest, RiseFallShortName) {
EXPECT_STREQ(RiseFall::rise()->shortName(), "^");
EXPECT_STREQ(RiseFall::fall()->shortName(), "v");
}
@ -791,7 +800,7 @@ TEST_F(SpiceSmokeTest, R6_RiseFallShortName) {
// Test streamPrint with SPICE transistor format (used in writeParasiticNetwork)
// Covers: streamPrint paths used by WriteSpice
TEST_F(StreamPrintTest, R8_SpiceTransistorFormat) {
TEST_F(StreamPrintTest, SpiceTransistorFormat) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "M%d %s %s %s %s %s W=%.3e L=%.3e\n",
@ -809,7 +818,7 @@ TEST_F(StreamPrintTest, R8_SpiceTransistorFormat) {
// Test streamPrint with SPICE capacitor format (used in writeParasiticNetwork)
// Covers: streamPrint paths used by WriteSpice::writeParasiticNetwork
TEST_F(StreamPrintTest, R8_SpiceCapacitorFormat) {
TEST_F(StreamPrintTest, SpiceCapacitorFormat) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "C%d %s %s %.4e\n", 1, "net1:1", "0", 1.5e-15);
@ -826,7 +835,7 @@ TEST_F(StreamPrintTest, R8_SpiceCapacitorFormat) {
// Test streamPrint with SPICE voltage source (used in writeClkedStepSource)
// Covers: streamPrint paths used by WriteSpice::writeClkedStepSource
TEST_F(StreamPrintTest, R8_SpiceVoltageSource) {
TEST_F(StreamPrintTest, SpiceVoltageSource2) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "v%s %s 0 pwl(0 %.3f %.3e %.3f)\n",
@ -842,7 +851,7 @@ TEST_F(StreamPrintTest, R8_SpiceVoltageSource) {
// Test streamPrint with SPICE waveform format (used in writeWaveformVoltSource)
// Covers: streamPrint paths used by WriteSpice::writeWaveformVoltSource
TEST_F(StreamPrintTest, R8_SpiceWaveformFormat) {
TEST_F(StreamPrintTest, SpiceWaveformFormat) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "v%s %s 0 pwl(\n", "in", "in_node");
@ -861,7 +870,7 @@ TEST_F(StreamPrintTest, R8_SpiceWaveformFormat) {
// Test streamPrint with SPICE .measure format (used in spiceTrans context)
// Covers: streamPrint with RISE/FALL strings (used by WriteSpice::spiceTrans)
TEST_F(StreamPrintTest, R8_SpiceMeasureRiseFall) {
TEST_F(StreamPrintTest, SpiceMeasureRiseFall) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
// This mimics how spiceTrans returns RISE/FALL strings
@ -880,7 +889,7 @@ TEST_F(StreamPrintTest, R8_SpiceMeasureRiseFall) {
// Test Xyce CSV with special values
// Covers: readXyceCsv edge cases
TEST_F(XyceCsvTest, R8_ReadCsvWithZeroValues) {
TEST_F(XyceCsvTest, ReadCsvWithZeroValues) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(sig)\n";
@ -901,7 +910,7 @@ TEST_F(XyceCsvTest, R8_ReadCsvWithZeroValues) {
// Test Xyce CSV with large number of signals
// Covers: readXyceCsv with many columns
TEST_F(XyceCsvTest, R8_ReadCsvManySignals) {
TEST_F(XyceCsvTest, ReadCsvManySignals) {
{
std::ofstream out(tmpfile_);
out << "TIME";
@ -928,7 +937,7 @@ TEST_F(XyceCsvTest, R8_ReadCsvManySignals) {
////////////////////////////////////////////////////////////////
// streamPrint: SPICE subcircuit definition (used by WriteSpice)
TEST_F(StreamPrintTest, R9_SpiceSubcktDefinition) {
TEST_F(StreamPrintTest, SpiceSubcktDefinition) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".subckt %s %s %s %s %s\n",
@ -948,7 +957,7 @@ TEST_F(StreamPrintTest, R9_SpiceSubcktDefinition) {
}
// streamPrint: SPICE resistor network (used in writeParasiticNetwork)
TEST_F(StreamPrintTest, R9_SpiceResistorNetwork) {
TEST_F(StreamPrintTest, SpiceResistorNetwork) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
for (int i = 0; i < 10; i++) {
@ -964,7 +973,7 @@ TEST_F(StreamPrintTest, R9_SpiceResistorNetwork) {
}
// streamPrint: SPICE capacitor network (used in writeParasiticNetwork)
TEST_F(StreamPrintTest, R9_SpiceCapacitorNetwork) {
TEST_F(StreamPrintTest, SpiceCapacitorNetwork) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
for (int i = 0; i < 10; i++) {
@ -980,7 +989,7 @@ TEST_F(StreamPrintTest, R9_SpiceCapacitorNetwork) {
}
// streamPrint: SPICE .lib directive
TEST_F(StreamPrintTest, R9_SpiceLibDirective) {
TEST_F(StreamPrintTest, SpiceLibDirective) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".lib '%s' %s\n", "/path/to/models.lib", "tt");
@ -994,7 +1003,7 @@ TEST_F(StreamPrintTest, R9_SpiceLibDirective) {
}
// streamPrint: SPICE .option directive
TEST_F(StreamPrintTest, R9_SpiceOptionDirective) {
TEST_F(StreamPrintTest, SpiceOptionDirective) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".option %s=%g %s=%g\n", "reltol", 1e-6, "abstol", 1e-12);
@ -1008,7 +1017,7 @@ TEST_F(StreamPrintTest, R9_SpiceOptionDirective) {
}
// streamPrint: SPICE .print directive
TEST_F(StreamPrintTest, R9_SpicePrintDirective) {
TEST_F(StreamPrintTest, SpicePrintDirective) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".print tran v(%s) v(%s) v(%s)\n",
@ -1024,7 +1033,7 @@ TEST_F(StreamPrintTest, R9_SpicePrintDirective) {
}
// streamPrint: SPICE pulse source
TEST_F(StreamPrintTest, R9_SpicePulseSource) {
TEST_F(StreamPrintTest, SpicePulseSource) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "v%s %s 0 PULSE(%.3f %.3f %.3e %.3e %.3e %.3e %.3e)\n",
@ -1039,7 +1048,7 @@ TEST_F(StreamPrintTest, R9_SpicePulseSource) {
}
// streamPrint: SPICE mutual inductance
TEST_F(StreamPrintTest, R9_SpiceMutualInductance) {
TEST_F(StreamPrintTest, SpiceMutualInductance) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "L%d %s %s %.4e\n", 1, "n1", "n2", 1e-9);
@ -1055,7 +1064,7 @@ TEST_F(StreamPrintTest, R9_SpiceMutualInductance) {
}
// streamPrint: SPICE probe statement
TEST_F(StreamPrintTest, R9_SpiceProbeStatement) {
TEST_F(StreamPrintTest, SpiceProbeStatement) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".probe v(%s) v(%s) i(%s)\n",
@ -1069,7 +1078,7 @@ TEST_F(StreamPrintTest, R9_SpiceProbeStatement) {
}
// streamPrint: SPICE with escaped characters
TEST_F(StreamPrintTest, R9_SpiceEscapedChars) {
TEST_F(StreamPrintTest, SpiceEscapedChars) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "* Node: %s\n", "top/sub/inst:pin");
@ -1084,7 +1093,7 @@ TEST_F(StreamPrintTest, R9_SpiceEscapedChars) {
}
// streamPrint: SPICE full deck structure
TEST_F(StreamPrintTest, R9_SpiceFullDeck) {
TEST_F(StreamPrintTest, SpiceFullDeck) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, "* Full SPICE deck\n");
@ -1116,7 +1125,7 @@ TEST_F(StreamPrintTest, R9_SpiceFullDeck) {
}
// XyceCsv: with very small values
TEST_F(XyceCsvTest, R9_ReadCsvSmallValues) {
TEST_F(XyceCsvTest, ReadCsvSmallValues) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(sig1),V(sig2)\n";
@ -1134,7 +1143,7 @@ TEST_F(XyceCsvTest, R9_ReadCsvSmallValues) {
}
// XyceCsv: with very large values
TEST_F(XyceCsvTest, R9_ReadCsvLargeValues) {
TEST_F(XyceCsvTest, ReadCsvLargeValues) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(sig)\n";
@ -1152,7 +1161,7 @@ TEST_F(XyceCsvTest, R9_ReadCsvLargeValues) {
}
// XyceCsv: with 100 time steps
TEST_F(XyceCsvTest, R9_ReadCsv100TimeSteps) {
TEST_F(XyceCsvTest, ReadCsv100TimeSteps) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(out),V(in)\n";
@ -1174,7 +1183,7 @@ TEST_F(XyceCsvTest, R9_ReadCsv100TimeSteps) {
}
// XyceCsv: with signal names containing special characters
TEST_F(XyceCsvTest, R9_ReadCsvSpecialSignalNames) {
TEST_F(XyceCsvTest, ReadCsvSpecialSignalNames) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(top/sub/net:1),V(top/sub/net:2)\n";
@ -1193,7 +1202,7 @@ TEST_F(XyceCsvTest, R9_ReadCsvSpecialSignalNames) {
}
// XyceCsv: with current probes
TEST_F(XyceCsvTest, R9_ReadCsvCurrentProbes) {
TEST_F(XyceCsvTest, ReadCsvCurrentProbes) {
{
std::ofstream out(tmpfile_);
out << "TIME,I(v_supply),V(out)\n";
@ -1211,7 +1220,7 @@ TEST_F(XyceCsvTest, R9_ReadCsvCurrentProbes) {
}
// Transition properties relevant to SPICE
TEST_F(SpiceSmokeTest, R9_TransitionAsRiseFallBoth) {
TEST_F(SpiceSmokeTest, TransitionAsRiseFallBoth) {
// Rise-like transitions have valid asRiseFallBoth
EXPECT_NE(Transition::rise()->asRiseFallBoth(), nullptr);
EXPECT_NE(Transition::fall()->asRiseFallBoth(), nullptr);
@ -1219,25 +1228,25 @@ TEST_F(SpiceSmokeTest, R9_TransitionAsRiseFallBoth) {
EXPECT_NE(Transition::trZ1()->asRiseFallBoth(), nullptr);
}
TEST_F(SpiceSmokeTest, R9_TransitionIndex) {
TEST_F(SpiceSmokeTest, TransitionIndex) {
EXPECT_GE(Transition::rise()->index(), 0);
EXPECT_GE(Transition::fall()->index(), 0);
EXPECT_NE(Transition::rise()->index(), Transition::fall()->index());
}
TEST_F(SpiceSmokeTest, R9_RiseFallBothIndex) {
TEST_F(SpiceSmokeTest, RiseFallBothIndex) {
EXPECT_GE(RiseFallBoth::rise()->index(), 0);
EXPECT_GE(RiseFallBoth::fall()->index(), 0);
EXPECT_GE(RiseFallBoth::riseFall()->index(), 0);
}
TEST_F(SpiceSmokeTest, R9_RiseFallBothToString) {
TEST_F(SpiceSmokeTest, RiseFallBothToString) {
EXPECT_EQ(RiseFallBoth::rise()->to_string(), "^");
EXPECT_EQ(RiseFallBoth::fall()->to_string(), "v");
EXPECT_FALSE(RiseFallBoth::riseFall()->to_string().empty());
}
TEST_F(SpiceSmokeTest, R9_MinMaxAllForSpice) {
TEST_F(SpiceSmokeTest, MinMaxAllForSpice) {
// MinMaxAll range used in SPICE for iteration
int count = 0;
for (auto mm : MinMaxAll::all()->range()) {
@ -1247,12 +1256,12 @@ TEST_F(SpiceSmokeTest, R9_MinMaxAllForSpice) {
EXPECT_EQ(count, 2);
}
TEST_F(SpiceSmokeTest, R9_MinMaxAllAsMinMax) {
TEST_F(SpiceSmokeTest, MinMaxAllAsMinMax) {
EXPECT_EQ(MinMaxAll::min()->asMinMax(), MinMax::min());
EXPECT_EQ(MinMaxAll::max()->asMinMax(), MinMax::max());
}
TEST_F(SpiceSmokeTest, R9_TransitionRiseFallAsString) {
TEST_F(SpiceSmokeTest, TransitionRiseFallAsString) {
// Transition::to_string used in SPICE reporting
EXPECT_EQ(Transition::rise()->to_string(), "^");
EXPECT_EQ(Transition::fall()->to_string(), "v");
@ -1260,12 +1269,12 @@ TEST_F(SpiceSmokeTest, R9_TransitionRiseFallAsString) {
EXPECT_FALSE(Transition::riseFall()->to_string().empty());
}
TEST_F(SpiceSmokeTest, R9_RiseFallAsRiseFallBoth) {
TEST_F(SpiceSmokeTest, RiseFallAsRiseFallBoth) {
EXPECT_EQ(RiseFall::rise()->asRiseFallBoth(), RiseFallBoth::rise());
EXPECT_EQ(RiseFall::fall()->asRiseFallBoth(), RiseFallBoth::fall());
}
TEST_F(SpiceSmokeTest, R9_MinMaxCompareInfinity) {
TEST_F(SpiceSmokeTest, MinMaxCompareInfinity) {
float large = 1e30f;
float small = -1e30f;
EXPECT_TRUE(MinMax::min()->compare(small, large));
@ -1274,7 +1283,7 @@ TEST_F(SpiceSmokeTest, R9_MinMaxCompareInfinity) {
EXPECT_FALSE(MinMax::max()->compare(small, large));
}
TEST_F(SpiceSmokeTest, R9_RiseFallRangeValues) {
TEST_F(SpiceSmokeTest, RiseFallRangeValues) {
// Verify range produces rise then fall
auto range = RiseFall::range();
int idx = 0;
@ -1287,7 +1296,7 @@ TEST_F(SpiceSmokeTest, R9_RiseFallRangeValues) {
}
// XyceCsv: single row of data
TEST_F(XyceCsvTest, R9_ReadCsvSingleRow) {
TEST_F(XyceCsvTest, ReadCsvSingleRow) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(out)\n";
@ -1304,7 +1313,7 @@ TEST_F(XyceCsvTest, R9_ReadCsvSingleRow) {
}
// XyceCsv: with alternating sign values
TEST_F(XyceCsvTest, R9_ReadCsvAlternatingSign) {
TEST_F(XyceCsvTest, ReadCsvAlternatingSign) {
{
std::ofstream out(tmpfile_);
out << "TIME,V(out)\n";
@ -1323,7 +1332,7 @@ TEST_F(XyceCsvTest, R9_ReadCsvAlternatingSign) {
}
// streamPrint: SPICE .end directive
TEST_F(StreamPrintTest, R9_SpiceEndDirective) {
TEST_F(StreamPrintTest, SpiceEndDirective) {
std::ofstream out(tmpfile_);
ASSERT_TRUE(out.is_open());
streamPrint(out, ".end\n");
@ -1336,7 +1345,7 @@ TEST_F(StreamPrintTest, R9_SpiceEndDirective) {
}
// XyceCsv: many columns (50 signals)
TEST_F(XyceCsvTest, R9_ReadCsv50Signals) {
TEST_F(XyceCsvTest, ReadCsv50Signals) {
{
std::ofstream out(tmpfile_);
out << "TIME";

View File

@ -56,9 +56,7 @@ if { $rc == 0 } {
puts "PASS: write_path_spice completed successfully"
diff_files $test_name.spok [file join $spice_dir path_1.sp]
} else {
# Even partial execution gives us coverage of the C++ code
puts "INFO: write_path_spice returned error (expected with mock files): $msg"
puts "PASS: write_path_spice code path exercised"
puts "FAIL: write_path_spice returned error: $msg"
}
puts "ALL PASSED"

View File

@ -2499,7 +2499,7 @@ TEST(StringUtilCovTest, StringDeleteCheckRegular)
// Test Report redirectStringPrint with empty string
// Covers: Report::redirectStringPrint
TEST(ReportCovTest, R5_RedirectStringPrintEmpty)
TEST(ReportCovTest, RedirectStringPrintEmpty)
{
Report report;
report.redirectStringBegin();
@ -2509,7 +2509,7 @@ TEST(ReportCovTest, R5_RedirectStringPrintEmpty)
}
// Test Report redirectStringPrint with large string
TEST(ReportCovTest, R5_RedirectStringPrintLarge)
TEST(ReportCovTest, RedirectStringPrintLarge)
{
Report report;
report.redirectStringBegin();
@ -2520,7 +2520,7 @@ TEST(ReportCovTest, R5_RedirectStringPrintLarge)
}
// Test Report redirectStringPrint multiple times
TEST(ReportCovTest, R5_RedirectStringPrintMultiple)
TEST(ReportCovTest, RedirectStringPrintMultiple)
{
Report report;
report.redirectStringBegin();
@ -2533,7 +2533,7 @@ TEST(ReportCovTest, R5_RedirectStringPrintMultiple)
// Test Report printToBuffer with va_list
// Covers: Report::printToBuffer(const char*, va_list)
TEST(ReportCovTest, R5_PrintToBufferViaReportLine)
TEST(ReportCovTest, PrintToBufferViaReportLine)
{
Report report;
report.redirectStringBegin();
@ -2545,7 +2545,7 @@ TEST(ReportCovTest, R5_PrintToBufferViaReportLine)
}
// Test Report::reportLineString
TEST(ReportCovTest, R5_ReportLineString)
TEST(ReportCovTest, ReportLineString)
{
Report report;
report.redirectStringBegin();
@ -2556,7 +2556,7 @@ TEST(ReportCovTest, R5_ReportLineString)
}
// Test Report::reportLineString with std::string
TEST(ReportCovTest, R5_ReportLineStringStd)
TEST(ReportCovTest, ReportLineStringStd)
{
Report report;
report.redirectStringBegin();
@ -2568,7 +2568,7 @@ TEST(ReportCovTest, R5_ReportLineStringStd)
}
// Test Report::reportBlankLine
TEST(ReportCovTest, R5_ReportBlankLine)
TEST(ReportCovTest, ReportBlankLine)
{
Report report;
report.redirectStringBegin();
@ -2580,7 +2580,7 @@ TEST(ReportCovTest, R5_ReportBlankLine)
// Test ReportStd constructor
// Covers: ReportStd::ReportStd()
TEST(ReportStdCovTest, R5_ReportStdConstructor)
TEST(ReportStdCovTest, ReportStdConstructor)
{
Report *report = makeReportStd();
EXPECT_NE(report, nullptr);
@ -2591,7 +2591,7 @@ TEST(ReportStdCovTest, R5_ReportStdConstructor)
// Test ReportStd printErrorConsole via fileError
// Covers: ReportStd::printErrorConsole
TEST(ReportStdCovTest, R5_PrintErrorConsoleViaWarn)
TEST(ReportStdCovTest, PrintErrorConsoleViaWarn)
{
Report *report = makeReportStd();
// warn uses printErrorConsole path
@ -2600,7 +2600,7 @@ TEST(ReportStdCovTest, R5_PrintErrorConsoleViaWarn)
}
// Test Report suppress/unsuppress messages
TEST(ReportCovTest, R5_SuppressUnsuppress)
TEST(ReportCovTest, SuppressUnsuppress)
{
Report report;
EXPECT_FALSE(report.isSuppressed(100));
@ -2611,7 +2611,7 @@ TEST(ReportCovTest, R5_SuppressUnsuppress)
}
// Test Report suppressed warn is silent
TEST(ReportCovTest, R5_SuppressedWarn)
TEST(ReportCovTest, SuppressedWarn)
{
Report report;
report.suppressMsgId(200);
@ -2623,7 +2623,7 @@ TEST(ReportCovTest, R5_SuppressedWarn)
}
// Test Report logBegin/logEnd
TEST(ReportCovTest, R5_LogBeginEnd)
TEST(ReportCovTest, LogBeginEnd)
{
Report report;
const char *logfile = "/tmp/sta_test_log_r5.log";
@ -2641,7 +2641,7 @@ TEST(ReportCovTest, R5_LogBeginEnd)
}
// Test Report redirectFileBegin/redirectFileEnd
TEST(ReportCovTest, R5_RedirectFileBeginEnd)
TEST(ReportCovTest, RedirectFileBeginEnd)
{
Report report;
const char *tmpfile = "/tmp/sta_test_redirect_r5.txt";
@ -2659,7 +2659,7 @@ TEST(ReportCovTest, R5_RedirectFileBeginEnd)
}
// Test Report redirectFileAppendBegin
TEST(ReportCovTest, R5_RedirectFileAppendBegin)
TEST(ReportCovTest, RedirectFileAppendBegin)
{
Report report;
const char *tmpfile = "/tmp/sta_test_append_r5.txt";
@ -2687,7 +2687,7 @@ TEST(ReportCovTest, R5_RedirectFileAppendBegin)
// Test gzstreambuf basic operations
// Covers: gzstreambuf::~gzstreambufD0Ev (virtual destructor)
TEST(GzStreamTest, R5_GzStreamBufConstruction)
TEST(GzStreamTest, GzStreamBufConstruction)
{
// Test igzstream with a non-existent file
gzstream::igzstream stream;
@ -2695,7 +2695,7 @@ TEST(GzStreamTest, R5_GzStreamBufConstruction)
}
// Test gzstreambuf with actual gz file
TEST(GzStreamTest, R5_GzStreamWriteRead)
TEST(GzStreamTest, GzStreamWriteRead)
{
const char *tmpfile = "/tmp/sta_test_gz_r5.gz";
@ -2719,21 +2719,21 @@ TEST(GzStreamTest, R5_GzStreamWriteRead)
}
// Test Report error throws ExceptionMsg
TEST(ReportCovTest, R5_ErrorThrowsException)
TEST(ReportCovTest, ErrorThrowsException)
{
Report report;
EXPECT_THROW(report.error(1, "test error %s", "msg"), ExceptionMsg);
}
// Test Report fileError throws ExceptionMsg
TEST(ReportCovTest, R5_FileErrorThrowsException)
TEST(ReportCovTest, FileErrorThrowsException)
{
Report report;
EXPECT_THROW(report.fileError(1, "test.v", 10, "file error"), ExceptionMsg);
}
// Test Report verror throws ExceptionMsg
TEST(ReportCovTest, R5_VerrorThrowsException)
TEST(ReportCovTest, VerrorThrowsException)
{
Report report;
EXPECT_THROW(report.error(1, "verror test"), ExceptionMsg);
@ -2746,7 +2746,7 @@ TEST(ReportCovTest, R5_VerrorThrowsException)
// Test Report::critical calls exit (we can't test exit directly,
// but we can test that the function exists and the format works)
// Covers: Report::critical - we test via Report::error which shares formatting
TEST(ReportCovTest, R6_ReportErrorFormatting)
TEST(ReportCovTest, ReportErrorFormatting)
{
Report report;
try {
@ -2760,7 +2760,7 @@ TEST(ReportCovTest, R6_ReportErrorFormatting)
// Test Report::fileCritical via fileError (shares code path)
// Covers: Report::fileCritical formatting path
TEST(ReportCovTest, R6_ReportFileErrorFormatting)
TEST(ReportCovTest, ReportFileErrorFormatting)
{
Report report;
try {
@ -2776,7 +2776,7 @@ TEST(ReportCovTest, R6_ReportFileErrorFormatting)
// Test Report D0 destructor through base pointer
// Covers: Report::~Report() D0
TEST(ReportCovTest, R6_ReportD0Destructor)
TEST(ReportCovTest, ReportD0Destructor)
{
Report *report = new Report();
EXPECT_NE(report, nullptr);
@ -2786,7 +2786,7 @@ TEST(ReportCovTest, R6_ReportD0Destructor)
// Test ReportStd creation via makeReportStd
// Covers: ReportStd::ReportStd constructor, makeReportStd
TEST(ReportCovTest, R6_ReportStdCreation)
TEST(ReportCovTest, ReportStdCreation)
{
Report *report = makeReportStd();
ASSERT_NE(report, nullptr);
@ -2802,7 +2802,7 @@ TEST(ReportCovTest, R6_ReportStdCreation)
// Test ReportStd warn output
// Covers: ReportStd::printErrorConsole (indirectly via warn)
TEST(ReportCovTest, R6_ReportStdWarn)
TEST(ReportCovTest, ReportStdWarn)
{
Report *report = makeReportStd();
ASSERT_NE(report, nullptr);
@ -2817,7 +2817,7 @@ TEST(ReportCovTest, R6_ReportStdWarn)
// Test ReportStd error
// Covers: ReportStd error path
TEST(ReportCovTest, R6_ReportStdError)
TEST(ReportCovTest, ReportStdError)
{
Report *report = makeReportStd();
ASSERT_NE(report, nullptr);
@ -2827,7 +2827,7 @@ TEST(ReportCovTest, R6_ReportStdError)
// Test Report printToBuffer with long format (indirectly via reportLine)
// Covers: Report::printToBuffer buffer growth
TEST(ReportCovTest, R6_ReportPrintToBufferLong)
TEST(ReportCovTest, ReportPrintToBufferLong)
{
Report report;
report.redirectStringBegin();
@ -2841,7 +2841,7 @@ TEST(ReportCovTest, R6_ReportPrintToBufferLong)
// Test Report redirectStringPrint indirectly via redirectStringBegin/End
// Covers: Report::redirectStringPrint
TEST(ReportCovTest, R6_RedirectStringPrint)
TEST(ReportCovTest, RedirectStringPrint)
{
Report report;
report.redirectStringBegin();
@ -2853,7 +2853,7 @@ TEST(ReportCovTest, R6_RedirectStringPrint)
// Test Report multiple printString calls during redirect
// Covers: Report::redirectStringPrint concatenation
TEST(ReportCovTest, R6_RedirectStringPrintMultiple)
TEST(ReportCovTest, RedirectStringPrintMultiple2)
{
Report report;
report.redirectStringBegin();
@ -2866,7 +2866,7 @@ TEST(ReportCovTest, R6_RedirectStringPrintMultiple)
// Test gzstreambuf D0 destructor through gzstream objects
// Covers: gzstreambuf::~gzstreambuf() D0
TEST(GzStreamCovTest, R6_GzStreamBufD0Destructor)
TEST(GzStreamCovTest, GzStreamBufD0Destructor)
{
const char *tmpfile = "/tmp/test_gz_d0.gz";
{
@ -2888,7 +2888,7 @@ TEST(GzStreamCovTest, R6_GzStreamBufD0Destructor)
// Test Report suppress and unsuppress multiple IDs
// Covers: Report::suppressMsgId, unsuppressMsgId
TEST(ReportCovTest, R6_SuppressMultipleIds)
TEST(ReportCovTest, SuppressMultipleIds)
{
Report report;
report.suppressMsgId(1);
@ -2907,7 +2907,7 @@ TEST(ReportCovTest, R6_SuppressMultipleIds)
// Test Report warn with long message that exceeds buffer
// Covers: Report::printToBuffer buffer reallocation
TEST(ReportCovTest, R6_WarnLongMessage)
TEST(ReportCovTest, WarnLongMessage)
{
Report report;
report.redirectStringBegin();
@ -2921,7 +2921,7 @@ TEST(ReportCovTest, R6_WarnLongMessage)
// Test Report fileWarn with long message
// Covers: Report::printToBuffer via fileWarn
TEST(ReportCovTest, R6_FileWarnLongMessage)
TEST(ReportCovTest, FileWarnLongMessage2)
{
Report report;
report.redirectStringBegin();
@ -2936,7 +2936,7 @@ TEST(ReportCovTest, R6_FileWarnLongMessage)
// Test Report error with suppressed flag
// Covers: ExceptionMsg suppression
TEST(ReportCovTest, R6_ErrorSuppressed)
TEST(ReportCovTest, ErrorSuppressed)
{
Report report;
report.suppressMsgId(900);
@ -2950,7 +2950,7 @@ TEST(ReportCovTest, R6_ErrorSuppressed)
// Test Report error without suppression
// Covers: ExceptionMsg non-suppression
TEST(ReportCovTest, R6_ErrorNotSuppressed)
TEST(ReportCovTest, ErrorNotSuppressed)
{
Report report;
try {
@ -2975,7 +2975,7 @@ TEST(ReportCovTest, R6_ErrorNotSuppressed)
// Test Report::printToBuffer via reportLine
// Covers: Report::printToBuffer(const char*, va_list)
TEST(ReportCovTest, R8_PrintToBufferViaReportLine)
TEST(ReportCovTest, PrintToBufferViaReportLine2)
{
Report report;
report.redirectStringBegin();
@ -2989,7 +2989,7 @@ TEST(ReportCovTest, R8_PrintToBufferViaReportLine)
// Test Report::redirectStringPrint via redirectStringBegin/End
// Covers: Report::redirectStringPrint(const char*, size_t)
TEST(ReportCovTest, R8_RedirectStringPrint)
TEST(ReportCovTest, RedirectStringPrint2)
{
Report report;
report.redirectStringBegin();
@ -3005,7 +3005,7 @@ TEST(ReportCovTest, R8_RedirectStringPrint)
// Test Report::redirectStringPrint with long string
// Covers: Report::redirectStringPrint(const char*, size_t)
TEST(ReportCovTest, R8_RedirectStringPrintLong)
TEST(ReportCovTest, RedirectStringPrintLong)
{
Report report;
report.redirectStringBegin();
@ -3018,7 +3018,7 @@ TEST(ReportCovTest, R8_RedirectStringPrintLong)
// Test Report::printToBuffer with various format strings
// Covers: Report::printToBuffer(const char*, va_list)
TEST(ReportCovTest, R8_PrintToBufferFormats)
TEST(ReportCovTest, PrintToBufferFormats)
{
Report report;
report.redirectStringBegin();
@ -3035,7 +3035,7 @@ TEST(ReportCovTest, R8_PrintToBufferFormats)
// Test ReportStd constructor and printErrorConsole
// Covers: ReportStd::ReportStd(), ReportStd::printErrorConsole
TEST(ReportStdCovTest, R8_ReportStdConstructorAndPrint)
TEST(ReportStdCovTest, ReportStdConstructorAndPrint)
{
Report *report = makeReportStd();
ASSERT_NE(report, nullptr);
@ -3048,7 +3048,7 @@ TEST(ReportStdCovTest, R8_ReportStdConstructorAndPrint)
// Test ReportStd printErrorConsole through fileWarn
// Covers: ReportStd::printErrorConsole(const char*, size_t)
TEST(ReportStdCovTest, R8_PrintErrorConsoleViaFileWarn)
TEST(ReportStdCovTest, PrintErrorConsoleViaFileWarn)
{
Report *report = makeReportStd();
ASSERT_NE(report, nullptr);
@ -3058,7 +3058,7 @@ TEST(ReportStdCovTest, R8_PrintErrorConsoleViaFileWarn)
// Test Report::printToBuffer with empty format
// Covers: Report::printToBuffer
TEST(ReportCovTest, R8_PrintToBufferEmpty)
TEST(ReportCovTest, PrintToBufferEmpty)
{
Report report;
report.redirectStringBegin();
@ -3070,7 +3070,7 @@ TEST(ReportCovTest, R8_PrintToBufferEmpty)
// Test Report warn with redirect
// Covers: Report::printToBuffer, Report::redirectStringPrint
TEST(ReportCovTest, R8_WarnWithRedirect)
TEST(ReportCovTest, WarnWithRedirect)
{
Report report;
report.redirectStringBegin();
@ -3083,7 +3083,7 @@ TEST(ReportCovTest, R8_WarnWithRedirect)
// Test Report fileWarn with redirect
// Covers: Report::printToBuffer, Report::redirectStringPrint
TEST(ReportCovTest, R8_FileWarnWithRedirect)
TEST(ReportCovTest, FileWarnWithRedirect)
{
Report report;
report.redirectStringBegin();
@ -3096,7 +3096,7 @@ TEST(ReportCovTest, R8_FileWarnWithRedirect)
// Test gzstream write and read
// Covers: gzstreambuf (exercises gzstream I/O paths)
TEST(GzStreamTest, R8_WriteAndReadGz)
TEST(GzStreamTest, WriteAndReadGz)
{
const char *tmpfile = "/tmp/test_r8_gzstream.gz";
{

File diff suppressed because it is too large Load Diff