Skip to content

Fix brace-depth parsing in wifi_draw_message nonblocking test#568

Merged
hapaxx11 merged 6 commits into
mainfrom
copilot/fix-code-for-review-comments
Jun 4, 2026
Merged

Fix brace-depth parsing in wifi_draw_message nonblocking test#568
hapaxx11 merged 6 commits into
mainfrom
copilot/fix-code-for-review-comments

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown

strstr(fn, "\n}") to locate the end of wifi_draw_message() is fragile — any } at column 0 inside nested blocks or #if sections truncates the extracted body early, causing wifi_wait_dismiss checks to silently pass on incomplete text.

Changes

  • tests/test_wifi_scan_status_nonblocking.c — Replace strstr(fn, "\n}") with a brace-depth walk from the function's opening {, stopping when depth returns to zero. This correctly handles nested blocks regardless of brace column position.
/* Before */
const char *body_end = strstr(fn, "\n}");

/* After */
const char *body_start = strchr(fn, '{');
int depth = 0;
for (const char *p = body_start; *p != '\0'; ++p) {
    if (*p == '{') ++depth;
    else if (*p == '}' && --depth == 0) { body_end = p; break; }
}
  • .changelog/wifi-draw-message-nonblocking-test.fixed.md — Changelog fragment for this fix.

Copilot AI changed the title [WIP] Fix code based on review comments Fix non-blocking WiFi status screens and harden the regression guard Jun 4, 2026
Copilot AI requested a review from hapaxx11 June 4, 2026 21:25
@hapaxx11

hapaxx11 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

…review-comments

# Conflicts:
#	tests/test_wifi_scan_status_nonblocking.c

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Author

@copilot resolve the merge conflicts in this pull request

Resolved in de69895.

@hapaxx11 hapaxx11 marked this pull request as ready for review June 4, 2026 21:33
Copilot AI review requested due to automatic review settings June 4, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the WiFi “transient status must be non-blocking” regression guard to prevent future reintroduction of stalls on pre-action screens like “Scanning APs…” / “Connecting…” by tightening how the test locates wifi_draw_message() and expanding positive assertions for additional WiFi flows.

Changes:

  • Update the wifi_draw_message() body extraction logic in the regression test to be anchored to a closing brace instead of the next static symbol.
  • Strengthen regression assertions so Wardrive and Save APs pre-scan statuses must also use wifi_draw_message().
  • Minor formatting cleanup in the tests CMake file (trailing/blank line adjustment).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/test_wifi_scan_status_nonblocking.c Tightens source-level regression checks to ensure transient WiFi scan/connect status screens remain non-blocking across multiple flows.
tests/CMakeLists.txt Minor formatting cleanup (no functional test registration changes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_wifi_scan_status_nonblocking.c Outdated
Copilot AI changed the title Fix non-blocking WiFi status screens and harden the regression guard Fix brace-depth parsing in wifi_draw_message nonblocking test Jun 4, 2026
@hapaxx11 hapaxx11 merged commit d028013 into main Jun 4, 2026
3 checks passed
@hapaxx11 hapaxx11 deleted the copilot/fix-code-for-review-comments branch June 4, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants