@@ -68,37 +68,6 @@ static void expectCallablePointerUsable(FnPtr fn) {
6868 EXPECT_EQ (fn_copy, fn);
6969}
7070
71- static std::string makeUniqueSdcPath (const char *tag)
72- {
73- static std::atomic<int > counter{0 };
74- char buf[256 ];
75- snprintf (buf, sizeof (buf), " %s_%d_%d.sdc" ,
76- tag, static_cast <int >(getpid ()), counter.fetch_add (1 ));
77- return std::string (buf);
78- }
79-
80- static void expectSdcFileReadable (const std::string &filename)
81- {
82- FILE *f = fopen (filename.c_str (), " r" );
83- ASSERT_NE (f, nullptr );
84-
85- std::string content;
86- char chunk[512 ];
87- size_t read_count = 0 ;
88- while ((read_count = fread (chunk, 1 , sizeof (chunk), f)) > 0 )
89- content.append (chunk, read_count);
90- fclose (f);
91-
92- EXPECT_FALSE (content.empty ());
93- EXPECT_GT (content.size (), 10u );
94- EXPECT_NE (content.find (' \n ' ), std::string::npos);
95- EXPECT_EQ (content.find (' \0 ' ), std::string::npos);
96- const bool has_set_cmd = content.find (" set_" ) != std::string::npos;
97- const bool has_create_clock = content.find (" create_clock" ) != std::string::npos;
98- EXPECT_TRUE (has_set_cmd || has_create_clock);
99- EXPECT_EQ (remove (filename.c_str ()), 0 );
100- }
101-
10271static void expectStaDesignCoreState (Sta *sta, bool design_loaded)
10372{
10473 ASSERT_NE (sta, nullptr );
@@ -107,12 +76,14 @@ static void expectStaDesignCoreState(Sta *sta, bool design_loaded)
10776 EXPECT_NE (sta->search (), nullptr );
10877 EXPECT_NE (sta->cmdSdc (), nullptr );
10978 EXPECT_FALSE (sta->scenes ().empty ());
110- if (!sta->scenes ().empty ())
79+ if (!sta->scenes ().empty ()) {
11180 EXPECT_GE (sta->scenes ().size (), 1 );
81+ }
11282 EXPECT_NE (sta->cmdScene (), nullptr );
11383 EXPECT_TRUE (design_loaded);
114- if (sta->network ())
84+ if (sta->network ()) {
11585 EXPECT_NE (sta->network ()->topInstance (), nullptr );
86+ }
11687}
11788
11889// ============================================================
@@ -232,6 +203,7 @@ TEST_F(StaDesignTest, VertexArrivalRfPathAP) {
232203 ASSERT_NE (v, nullptr );
233204 Scene *corner = sta_->cmdScene ();
234205 const size_t path_idx = corner->pathIndex (MinMax::max ());
206+ (void )path_idx;
235207 sta_->arrival (v, RiseFallBoth::rise (), sta_->scenes (), MinMax::max ());
236208}
237209
@@ -254,6 +226,7 @@ TEST_F(StaDesignTest, VertexRequiredRfPathAP) {
254226 ASSERT_NE (v, nullptr );
255227 Scene *corner = sta_->cmdScene ();
256228 const size_t path_idx = corner->pathIndex (MinMax::max ());
229+ (void )path_idx;
257230 sta_->required (v, RiseFallBoth::rise (), sta_->scenes (), MinMax::max ());
258231}
259232
@@ -270,6 +243,7 @@ TEST_F(StaDesignTest, VertexSlackRfPathAP) {
270243 ASSERT_NE (v, nullptr );
271244 Scene *corner = sta_->cmdScene ();
272245 const size_t path_idx = corner->pathIndex (MinMax::max ());
246+ (void )path_idx;
273247 sta_->slack (v, RiseFallBoth::rise (), sta_->scenes (), MinMax::max ());
274248}
275249
@@ -288,6 +262,7 @@ TEST_F(StaDesignTest, VertexSlewRfCornerMinMax) {
288262 Vertex *v = findVertex (" u1/Z" );
289263 ASSERT_NE (v, nullptr );
290264 Scene *corner = sta_->cmdScene ();
265+ (void )corner;
291266 sta_->slew (v, RiseFallBoth::rise (), sta_->scenes (), MinMax::max ());
292267}
293268
@@ -296,6 +271,7 @@ TEST_F(StaDesignTest, VertexSlewRfDcalcAP) {
296271 ASSERT_NE (v, nullptr );
297272 Scene *corner = sta_->cmdScene ();
298273 const DcalcAPIndex dcalc_idx = corner->dcalcAnalysisPtIndex (MinMax::max ());
274+ (void )dcalc_idx;
299275 sta_->slew (v, RiseFallBoth::rise (), sta_->scenes (), MinMax::max ());
300276}
301277
@@ -639,6 +615,7 @@ TEST_F(StaDesignTest, PvtGetSet) {
639615 sta_->setPvt (top, MinMaxAll::all (), 1 .0f , 1 .1f , 25 .0f , sta_->cmdSdc ());
640616
641617 p = sta_->pvt (top, MinMax::max (), sta_->cmdSdc ());
618+ (void )p;
642619
643620
644621 }() ));
@@ -803,6 +780,7 @@ TEST_F(StaDesignTest, SearchCopyState) {
803780TEST_F (StaDesignTest, SearchFindPathGroupByName) {
804781 ASSERT_NO_THROW (( [&](){
805782 Search *search = sta_->search ();
783+ (void )search;
806784 // First ensure path groups exist
807785 sta_->findPathEnds (
808786 nullptr , nullptr , nullptr ,
@@ -855,10 +833,11 @@ TEST_F(StaDesignTest, SearchDeletePathGroups) {
855833TEST_F (StaDesignTest, SearchVisitEndpoints) {
856834 ASSERT_NO_THROW (( [&](){
857835 Search *search = sta_->search ();
836+ (void )search;
858837 Network *network = sta_->cmdNetwork ();
859838 PinSet pins (network);
860839 VertexPinCollector collector (pins);
861- true /* Search::visitEndpoints removed */ ;
840+ ( void ) true /* Search::visitEndpoints removed */ ;
862841
863842 }() ));
864843}
@@ -868,10 +847,11 @@ TEST_F(StaDesignTest, SearchVisitEndpoints) {
868847TEST_F (StaDesignTest, SearchVisitStartpoints) {
869848 ASSERT_NO_THROW (( [&](){
870849 Search *search = sta_->search ();
850+ (void )search;
871851 Network *network = sta_->cmdNetwork ();
872852 PinSet pins (network);
873853 VertexPinCollector collector (pins);
874- true /* Search::visitStartpoints removed */ ;
854+ ( void ) true /* Search::visitStartpoints removed */ ;
875855
876856 }() ));
877857}
@@ -903,9 +883,10 @@ TEST_F(StaDesignTest, SearchClockDomainsVertex) {
903883TEST_F (StaDesignTest, SearchIsGenClkSrc) {
904884 ASSERT_NO_THROW (( [&](){
905885 Search *search = sta_->search ();
886+ (void )search;
906887 Vertex *v = findVertex (" r1/Q" );
907888 if (v) {
908- true /* Search::isGenClkSrc removed */ ;
889+ ( void ) true /* Search::isGenClkSrc removed */ ;
909890 }
910891
911892 }() ));
@@ -922,7 +903,8 @@ TEST_F(StaDesignTest, SearchPathGroups) {
922903 true , false , false , false , false , false );
923904 if (!ends.empty ()) {
924905 Search *search = sta_->search ();
925- true /* Search::pathGroups removed */ ;
906+ (void )search;
907+ (void )true /* Search::pathGroups removed */ ;
926908 }
927909
928910 }() ));
@@ -1118,6 +1100,7 @@ TEST_F(StaDesignTest, SetArcDelayAnnotated) {
11181100 if (!arcs.empty ()) {
11191101 Scene *corner = sta_->cmdScene ();
11201102 DcalcAPIndex dcalc_idx = corner->dcalcAnalysisPtIndex (MinMax::max ());
1103+ (void )dcalc_idx;
11211104 sta_->setArcDelayAnnotated (edge, arcs[0 ], corner, MinMax::max (), true );
11221105 sta_->setArcDelayAnnotated (edge, arcs[0 ], corner, MinMax::max (), false );
11231106 }
@@ -1175,6 +1158,7 @@ TEST_F(StaDesignTest, TotalNegativeSlackCorner) {
11751158
11761159TEST_F (StaDesignTest, Endpoints) {
11771160 VertexSet &eps = sta_->endpoints ();
1161+ (void )eps;
11781162 // endpoints() returns reference, always valid
11791163}
11801164
@@ -1362,6 +1346,7 @@ TEST_F(StaDesignTest, PathExpanded) {
13621346TEST_F (StaDesignTest, SearchEndpoints) {
13631347 Search *search = sta_->search ();
13641348 VertexSet &eps = search->endpoints ();
1349+ (void )eps;
13651350 // endpoints() returns reference, always valid
13661351}
13671352
@@ -1636,6 +1621,7 @@ TEST_F(StaDesignTest, ReadLibertyFile) {
16361621 Scene *corner = sta_->cmdScene ();
16371622 LibertyLibrary *lib = sta_->readLiberty (
16381623 " test/nangate45/Nangate45_slow.lib" , corner, MinMaxAll::min (), false );
1624+ (void )lib;
16391625 // May or may not succeed depending on file existence; just check no crash
16401626 }() ));
16411627}
@@ -2241,7 +2227,7 @@ TEST_F(StaDesignTest, SearchIsClockVertex) {
22412227 Search *search = sta_->search ();
22422228 Vertex *v = findVertex (" r1/CK" );
22432229 ASSERT_NE (v, nullptr );
2244- (search->clocks (v, sta_->cmdMode ()).size () > 0 );
2230+ (void )( search->clocks (v, sta_->cmdMode ()).size () > 0 );
22452231}
22462232
22472233// --- Search: clkPathArrival ---
@@ -2370,6 +2356,7 @@ TEST_F(StaDesignTest, ArcDelayAnnotated) {
23702356 if (arc_set && !arc_set->arcs ().empty ()) {
23712357 Scene *corner = sta_->cmdScene ();
23722358 DcalcAPIndex dcalc_idx = corner->dcalcAnalysisPtIndex (MinMax::max ());
2359+ (void )dcalc_idx;
23732360 sta_->arcDelayAnnotated (edge, arc_set->arcs ()[0 ], corner, MinMax::max ());
23742361 }
23752362 }
@@ -2406,9 +2393,10 @@ TEST_F(StaDesignTest, SearchRequiredInvalid) {
24062393
24072394TEST_F (StaDesignTest, SearchIsSegmentStart) {
24082395 Search *search = sta_->search ();
2396+ (void )search;
24092397 Pin *pin = findPin (" in1" );
24102398 ASSERT_NE (pin, nullptr );
2411- true /* Search::isSegmentStart removed */ ;
2399+ ( void ) true /* Search::isSegmentStart removed */ ;
24122400}
24132401
24142402// --- Search: isInputArrivalSrchStart ---
@@ -2661,6 +2649,7 @@ TEST_F(StaDesignTest, RemoveConstraints) {
26612649
26622650TEST_F (StaDesignTest, SearchFilter) {
26632651 Search *search = sta_->search ();
2652+ (void )search;
26642653 FilterPath *filter = nullptr /* Search::filter() removed */ ;
26652654 // filter should be null since we haven't set one
26662655 EXPECT_EQ (filter, nullptr );
@@ -2787,7 +2776,11 @@ TEST_F(StaDesignTest, MaxFanoutCheck) {
27872776 ASSERT_NO_THROW (( [&](){
27882777 sta_->checkFanoutPreamble ();
27892778 const Pin *pin = nullptr ;
2779+ (void )pin;
27902780 float fanout, slack, limit;
2781+ (void )fanout;
2782+ (void )slack;
2783+ (void )limit;
27912784 // maxFanoutCheck removed (renamed to maxFanoutMinSlackPin);
27922785
27932786 }() ));
@@ -4038,17 +4031,18 @@ TEST_F(StaDesignTest, SearchIsClock) {
40384031 Search *search = sta_->search ();
40394032 Vertex *v = findVertex (" r1/CK" );
40404033 if (v) {
4041- (search->clocks (v, sta_->cmdMode ()).size () > 0 );
4034+ (void )( search->clocks (v, sta_->cmdMode ()).size () > 0 );
40424035 }
40434036
40444037 }() ));
40454038}
40464039
40474040TEST_F (StaDesignTest, SearchIsGenClkSrc2) {
40484041 Search *search = sta_->search ();
4042+ (void )search;
40494043 Vertex *v = findVertex (" r1/Q" );
40504044 ASSERT_NE (v, nullptr );
4051- true /* Search::isGenClkSrc removed */ ;
4045+ ( void ) true /* Search::isGenClkSrc removed */ ;
40524046}
40534047
40544048TEST_F (StaDesignTest, SearchClocks) {
@@ -4107,12 +4101,14 @@ TEST_F(StaDesignTest, SearchIsEndpoint2) {
41074101TEST_F (StaDesignTest, SearchHavePathGroups) {
41084102 ASSERT_NO_THROW (( [&](){
41094103 Search *search = sta_->search ();
4110- true /* Search::havePathGroups removed */ ;
4104+ (void )search;
4105+ (void )true /* Search::havePathGroups removed */ ;
41114106 }() ));
41124107}
41134108
41144109TEST_F (StaDesignTest, SearchFindPathGroup) {
41154110 Search *search = sta_->search ();
4111+ (void )search;
41164112 Clock *clk = sta_->cmdSdc ()->findClock (" clk" );
41174113 ASSERT_NE (clk, nullptr );
41184114 // Search::findPathGroup removed
0 commit comments