1- /* SPDX-License-Identifier: BSD-3-Clause */
1+ /* SPDX-License-Identifier: BSD-3-Clause
2+ * Copyright(c) 2025 Intel Corporation
3+ */
24
35#include " test_fixture.hpp"
46
@@ -46,7 +48,7 @@ void NoCtxTest::SetUp() {
4648void NoCtxTest::TearDown () {
4749 st30pHandlers.clear ();
4850 st20pHandlers.clear ();
49- frameTestStrategys .clear ();
51+ frameTestStrategies .clear ();
5052
5153 if (ctx) {
5254 if (ctx->handle ) {
@@ -93,15 +95,11 @@ void NoCtxTest::sleepUntilFailure(int sleep_duration) {
9395NoCtxTest::St20pHandlerBundle NoCtxTest::createSt20pHandlerBundle (
9496 bool createTx, bool createRx,
9597 std::function<FrameTestStrategy*(St20pHandler*)> strategyFactory,
96- std::function<void(St20pHandler*)> configure,
97- std::shared_ptr<StrategySharedState> sharedState) {
98+ std::function<void(St20pHandler*)> configure) {
9899 if (!ctx) {
99100 throw std::runtime_error (" createSt20pHandlerBundle expects initialized ctx" );
100101 }
101102
102- auto bundleSharedState =
103- sharedState ? sharedState : std::make_shared<StrategySharedState>();
104-
105103 auto handlerOwned = std::make_unique<St20pHandler>(ctx);
106104 auto * handler = handlerOwned.get ();
107105 if (configure) {
@@ -114,7 +112,6 @@ NoCtxTest::St20pHandlerBundle NoCtxTest::createSt20pHandlerBundle(
114112 strategyOwned.reset (strategyFactory (handler));
115113 strategy = strategyOwned.get ();
116114 handler->setFrameTestStrategy (strategy);
117- strategy->setSharedState (bundleSharedState);
118115 }
119116
120117 if (createRx) {
@@ -125,7 +122,6 @@ NoCtxTest::St20pHandlerBundle NoCtxTest::createSt20pHandlerBundle(
125122 }
126123
127124 auto bundle = registerSt20pResources (std::move (handlerOwned), std::move (strategyOwned));
128- bundle.sharedState = bundleSharedState;
129125 return bundle;
130126}
131127
@@ -138,7 +134,7 @@ NoCtxTest::St20pHandlerBundle NoCtxTest::registerSt20pResources(
138134 }
139135 if (strategy) {
140136 bundle.strategy = strategy.get ();
141- frameTestStrategys .emplace_back (std::move (strategy));
137+ frameTestStrategies .emplace_back (std::move (strategy));
142138 }
143139 return bundle;
144140}
@@ -165,33 +161,3 @@ bool NoCtxTest::waitForSession(Session& session, std::chrono::milliseconds timeo
165161 }
166162 return session.isRunning ();
167163}
168-
169- bool NoCtxTest::startRxThenTx (St20pHandlerBundle& rxBundle, St20pHandlerBundle& txBundle,
170- std::chrono::milliseconds warmup) {
171- if (!rxBundle.handler || !txBundle.handler ) {
172- return false ;
173- }
174-
175- rxBundle.handler ->startSessionRx ();
176- if (!waitForSession (rxBundle.handler ->session , warmup)) {
177- return false ;
178- }
179-
180- txBundle.handler ->startSessionTx ();
181- return waitForSession (txBundle.handler ->session , warmup);
182- }
183-
184- void NoCtxTest::stopTxThenRx (St20pHandlerBundle& txBundle, St20pHandlerBundle& rxBundle,
185- std::chrono::milliseconds rxDelay) {
186- if (txBundle.handler ) {
187- txBundle.handler ->session .stop ();
188- }
189-
190- if (rxDelay.count () > 0 ) {
191- std::this_thread::sleep_for (rxDelay);
192- }
193-
194- if (rxBundle.handler ) {
195- rxBundle.handler ->session .stop ();
196- }
197- }
0 commit comments