Skip to content

[uri-path] remove UriEnumCheck checking order of Uri enum values. - #12179

Merged
jwhui merged 1 commit into
openthread:mainfrom
abtink:uri/remove-enum-order-check
Dec 1, 2025
Merged

[uri-path] remove UriEnumCheck checking order of Uri enum values.#12179
jwhui merged 1 commit into
openthread:mainfrom
abtink:uri/remove-enum-order-check

Conversation

@abtink

@abtink abtink commented Nov 22, 2025

Copy link
Copy Markdown
Member

This commit removes the build-time check for the order of the Uri enum values. This check is now redundant as the static_assert calls added in #12017 use AreConstStringsEqual() to validate the correctness of the kEntries array, ensuring that each URI path is correctly associated with its corresponding enum value.

This commit removes the build-time check for the order of the `Uri`
enum values. This check is now redundant as the `static_assert` calls
added in openthread#12017 use `AreConstStringsEqual()` to validate the
correctness of the `kEntries` array, ensuring that each URI path is
correctly associated with its corresponding enum value.
@github-actions

Copy link
Copy Markdown

Merging #12179 into main

name branch text data bss total
ot-cli-ftd de3788c 481648 860 66612 549120
8a4ddc0 481648 860 66612 549120
+/- +0 +0 +0 +0
ot-ncp-ftd de3788c 447572 764 61856 510192
8a4ddc0 447572 764 61856 510192
+/- +0 +0 +0 +0
ot-cli-mtd de3788c 373280 764 51052 425096
8a4ddc0 373280 764 51052 425096
+/- +0 +0 +0 +0
ot-ncp-mtd de3788c 354228 764 46320 401312
8a4ddc0 354228 764 46320 401312
+/- +0 +0 +0 +0
ot-cli-ftd-br de3788c 586576 868 136476 723920
8a4ddc0 586576 868 136476 723920
+/- +0 +0 +0 +0
ot-rcp de3788c 63200 568 20804 84572
8a4ddc0 63200 568 20804 84572
+/- +0 +0 +0 +0
Library files
name branch text data bss total
libopenthread-ftd.a de3788c 248707 95 40390 289192
8a4ddc0 248707 95 40390 289192
+/- +0 +0 +0 +0
libopenthread-cli-ftd.a de3788c 61471 0 8083 69554
8a4ddc0 61471 0 8083 69554
+/- +0 +0 +0 +0
libopenthread-ncp-ftd.a de3788c 33581 0 5948 39529
8a4ddc0 33581 0 5948 39529
+/- +0 +0 +0 +0
libopenthread-mtd.a de3788c 166233 0 24854 191087
8a4ddc0 166233 0 24854 191087
+/- +0 +0 +0 +0
libopenthread-cli-mtd.a de3788c 41426 0 8059 49485
8a4ddc0 41426 0 8059 49485
+/- +0 +0 +0 +0
libopenthread-ncp-mtd.a de3788c 25805 0 5948 31753
8a4ddc0 25805 0 5948 31753
+/- +0 +0 +0 +0
libopenthread-ftd-br.a de3788c 355392 100 110222 465714
8a4ddc0 355392 100 110222 465714
+/- +0 +0 +0 +0
libopenthread-cli-ftd-br.a de3788c 79639 0 8115 87754
8a4ddc0 79639 0 8115 87754
+/- +0 +0 +0 +0
libopenthread-rcp.a de3788c 9944 0 5060 15004
8a4ddc0 9944 0 5060 15004
+/- +0 +0 +0 +0
libopenthread-radio.a de3788c 19483 0 238 19721
8a4ddc0 19483 0 238 19721
+/- +0 +0 +0 +0

@abtink
abtink marked this pull request as ready for review November 22, 2025 02:23
@abtink

abtink commented Nov 22, 2025

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes the UriEnumCheck struct, which performed a compile-time validation to ensure that the Uri enum values are sequential. As explained in the description, this check is redundant because static_assert calls already validate the kEntries array, ensuring each URI path is correctly associated with its enum value. My review confirms that this change is a safe and reasonable code cleanup, as the C++ standard guarantees sequential values for this enum declaration, and the existing static assertions provide sufficient compile-time verification.

@codecov

codecov Bot commented Nov 22, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.20%. Comparing base (de3788c) to head (7b3f0db).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12179      +/-   ##
==========================================
+ Coverage   73.83%   74.20%   +0.36%     
==========================================
  Files         673      671       -2     
  Lines       92159    94526    +2367     
==========================================
+ Hits        68049    70139    +2090     
- Misses      24110    24387     +277     
Files with missing lines Coverage Δ
src/core/thread/uri_paths.cpp 55.76% <ø> (+1.92%) ⬆️

... and 212 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jwhui
jwhui merged commit 578467b into openthread:main Dec 1, 2025
111 of 112 checks passed
@github-project-automation github-project-automation Bot moved this from Under review to Merged in Enhancing MeshCoP Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants