MCPcopy Create free account
hub / github.com/arkhipenko/TaskScheduler / TEST_F

Function TEST_F

tests/test-scheduler-advanced-features.cpp:402–417  ·  view source on GitHub ↗

* @brief Test StatusRequest constructor and basic state management * * TESTS: StatusRequest(), setWaiting(), pending(), completed() * * PURPOSE: Verify that StatusRequest objects can be created and their * basic state management methods work correctly, providing foundation * for event-driven task coordination. * * STATUS REQUEST LIFECYCLE: * - Constructor: Creates StatusRequest in complet

Source from the content-addressed store, hash-verified

400 * synchronization and prevents race conditions.
401 */
402TEST_F(AdvancedSchedulerTest, StatusRequestBasicState) {
403 StatusRequest sr;
404
405 // Initial state should be completed
406 EXPECT_TRUE(sr.completed());
407 EXPECT_FALSE(sr.pending());
408 EXPECT_EQ(sr.getCount(), 0);
409 EXPECT_EQ(sr.getStatus(), 0);
410
411 // Set waiting for 3 signals
412 sr.setWaiting(3);
413 EXPECT_FALSE(sr.completed());
414 EXPECT_TRUE(sr.pending());
415 EXPECT_EQ(sr.getCount(), 3);
416 EXPECT_EQ(sr.getStatus(), 0); // Status reset by setWaiting
417}
418
419/**
420 * @brief Test StatusRequest signal() method for incremental completion

Callers

nothing calls this directly

Calls 15

delayFunction · 0.85
millisFunction · 0.85
completedMethod · 0.80
pendingMethod · 0.80
getCountMethod · 0.80
getStatusMethod · 0.80
setWaitingMethod · 0.80
signalMethod · 0.80
signalCompleteMethod · 0.80
waitForMethod · 0.80
isEnabledMethod · 0.80
isPendingMethod · 0.80

Tested by

no test coverage detected