@@ -149,6 +149,22 @@ TEST_F(ThreadBackTest, canHandle_someThreadDone_whileOtherRunning)
149
149
}
150
150
}
151
151
152
+ #define WAIT_NOTIFY
153
+ // ***********************************************************************************************
154
+ TEST_F (ThreadBackTest, GOLD_entryFn_notify_insteadof_timeout)
155
+ {
156
+ auto start = high_resolution_clock::now ();
157
+ ThreadBack::newThread (
158
+ [] { return true ; }, // entryFn
159
+ [](bool ) {} // backFn
160
+ );
161
+ timedwait (0 , 500'000'000 ); // long timer to ensure thread done beforehand
162
+ auto dur = duration_cast<std::chrono::milliseconds>(high_resolution_clock::now () - start);
163
+ EXPECT_LT (dur.count (), 500 ) << " REQ: entryFn end shall notify g_sem instead of timeout" ;
164
+
165
+ while (ThreadBack::hdlFinishedThreads () == 0 ); // clear all threads
166
+ }
167
+
152
168
#define ABNORMAL
153
169
// ***********************************************************************************************
154
170
TEST_F (ThreadBackTest, asyncFail_noException_toBackFnWithFalse)
@@ -167,20 +183,4 @@ TEST_F(ThreadBackTest, emptyThreadList_ok)
167
183
EXPECT_EQ (0u , nHandled);
168
184
}
169
185
170
- #define WAIT_NOTIFY
171
- // ***********************************************************************************************
172
- TEST_F (ThreadBackTest, wait_notify)
173
- {
174
- auto start = high_resolution_clock::now ();
175
- ThreadBack::newThread (
176
- [] { return true ; }, // entryFn
177
- [](bool ) {} // backFn
178
- );
179
- timedwait (0 , 500'000'000 ); // long timer to ensure thread done beforehand
180
- auto dur = duration_cast<std::chrono::milliseconds>(high_resolution_clock::now () - start);
181
- EXPECT_LT (dur.count (), 500 ) << " REQ: entryFn end shall notify g_sem instead of timeout" ;
182
-
183
- while (ThreadBack::hdlFinishedThreads () == 0 ); // clear all threads
184
- }
185
-
186
186
} // namespace
0 commit comments