Skip to content

Update deps + parameterized test support#586

Draft
mattdurak wants to merge 4 commits intomasterfrom
parameterized_tests
Draft

Update deps + parameterized test support#586
mattdurak wants to merge 4 commits intomasterfrom
parameterized_tests

Conversation

@mattdurak
Copy link
Contributor

Updates c-testrunnerswitcher and ctest submodules to master, bringing in PARAMETERIZED_TEST_FUNCTION macro support.

Changes:

  • Update deps/c-testrunnerswitcher to master (adds PARAMETERIZED_TEST_FUNCTION support)
  • Update deps/ctest to master (adds CTEST_PARAMETERIZED_TEST_FUNCTION)
  • Refactor azure_base64_ut: consolidate 6 identical Azure_Base64_Decode_invalid_length_fails tests into a single PARAMETERIZED_TEST_FUNCTION (reduces 81 lines to 18 lines)

- Update deps/c-testrunnerswitcher to master (adds PARAMETERIZED_TEST_FUNCTION support)
- Update deps/ctest to master (adds CTEST_PARAMETERIZED_TEST_FUNCTION)
- Refactor azure_base64_ut: consolidate 6 identical Azure_Base64_Decode_invalid_length_fails tests into a single PARAMETERIZED_TEST_FUNCTION

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ARGS(uint32_t, flags_value, const char*, expected_string),
CASE((1, "FLAG_ONE"), flag_one),
CASE((2, "FLAG_TWO"), flag_two),
CASE((3, "FLAG_ONE | FLAG_TWO"), flag_one_and_two),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(3

this should be "1 | 2" like it was literally before

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattdurak
Copy link
Contributor Author

Code Review: PR #586 — Parameterized Test Conversion

Files changed

  • tests/azure_base64_ut/azure_base64_ut.c
  • tests/flags_to_string_int/flags_to_string_int.c
  • tests/reals_ut/c_util_reals_ut.c

✅ Correct

  • azure_base64_ut.c: 6 deleted TEST_FUNCTIONs → 6 CASEs. All input values match originals. SRS comment (Tests_SRS_BASE64_06_011) correctly deduplicated to one occurrence above the PARAMETERIZED_TEST_FUNCTION. CASE suffixes (length_1length_7, no length_4) accurately describe the string length being tested rather than using opaque sequential numbers.
  • flags_to_string_int.c (values): 7 deleted TEST_FUNCTIONs → 7 CASEs. All flags_value/expected_string pairs match the originals (including 1 | 23).

🐛 Bug — Missing comma (syntax error)

File: tests/flags_to_string_int/flags_to_string_int.c, line 34

\\c
PARAMETERIZED_TEST_FUNCTION(collection_one_flags_to_string // ← missing comma here
ARGS(uint32_t, flags_value, const char*, expected_string),
\\

Should be:
\\c
PARAMETERIZED_TEST_FUNCTION(collection_one_flags_to_string,
ARGS(uint32_t, flags_value, const char*, expected_string),
\\


⚠️ Unrelated change — // no-srs removed

File: tests/reals_ut/c_util_reals_ut.c

// no-srs was removed from check_all_c_util_reals, but this test is not being parameterized and has no SRS comment. Per checklist item 4, // no-srs should not be added or removed unless part of the parameterization. This change should be reverted or moved to a separate PR.


Summary

Check Status
Every CASE matches a deleted TEST_FUNCTION
No dropped tests
SRS comments deduplicated, no orphans
No spurious // no-srs added ⚠️ One removed from unrelated test
Helpers inlined, not called ✅ (N/A — no helpers)
Syntax correctness 🐛 Missing comma in flags_to_string_int.c

- Added missing comma between function name and ARGS in flags_to_string_int.c
- Restored // no-srs comment on TEST_FUNCTION in c_util_reals_ut.c

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattdurak
Copy link
Contributor Author

Fixed: added missing comma in flags_to_string_int.c, restored // no-srs in c_util_reals_ut.c. Build and tests pass.

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.

1 participant