MCPcopy Create free account
hub / github.com/FastLED/FastLED / update

Method update

examples/Asio/Loopback/LoopbackTestRunner.h:62–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 void update() {
63 // State machine advances through RUNNING -> WAITING -> RUNNING transitions
64 // Callbacks (in runTest) handle WAITING -> RUNNING_NEXT transitions
65 switch (state) {
66 case RUNNING_GET_ROOT:
67 runTest("GET /", "http://localhost:8080/",
68 "Hello from loopback test!\n", RUNNING_GET_PING);
69 break;
70
71 case RUNNING_GET_PING:
72 runTest("GET /ping", "http://localhost:8080/ping",
73 "pong\n", RUNNING_GET_TEST);
74 break;
75
76 case RUNNING_GET_TEST:
77 runTest("GET /test", "http://localhost:8080/test",
78 "test response\n", COMPLETED);
79 break;
80
81 case COMPLETED:
82 if (!callback_invoked && completion_callback) {
83 // Print summary
84 Serial.println();
85 Serial.println("======================");
86 Serial.print("Test Results: ");
87 Serial.print(tests_passed);
88 Serial.print("/");
89 Serial.print(tests_run);
90 Serial.println(" passed");
91 Serial.println("======================");
92
93 bool success = !has_failure && tests_passed == tests_run;
94 if (success) {
95 Serial.println("✓ All loopback tests PASSED");
96 } else {
97 Serial.println("✗ Loopback tests FAILED");
98 }
99
100 // Invoke user callback with results
101 completion_callback(success, tests_passed, tests_run);
102 callback_invoked = true;
103 }
104 state = IDLE;
105 break;
106
107 default:
108 // WAITING states or IDLE - nothing to do
109 break;
110 }
111 }
112
113 bool isRunning() const {
114 return state != IDLE && state != COMPLETED;

Callers 7

loopFunction · 0.45
stress_test_concurrentFunction · 0.45
stress_test_rapidFunction · 0.45
pumpMethod · 0.45
registerFunctionsMethod · 0.45
tickMethod · 0.45

Calls 3

runTestFunction · 0.85
printlnMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected