Skip to content

Conversation

Copy link

Copilot AI commented Nov 27, 2025

Addresses review feedback from #590 to replace magic number 6 with a maintainable expression.

Changes

  • Move combos array to file scope (static const)
  • Replace hardcoded 6 in main_test_pwritev() with sizeof(combos) / sizeof(combos[0])
static const struct { unsigned iovecs, frames; } combos[] =
{
    { 32, 16, },
    { 16, 16, },
    { 16, 8, },
    { 3, 7, },
    { 7, 3, },
    { 100, 100, },
};

static void main_test_pwritev(void) {
    main_test_pwritev_combo(0, sizeof(combos) / sizeof(combos[0]));
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 27, 2025 13:37
Co-authored-by: dtikhonov <4528576+dtikhonov@users.noreply.github.com>
Co-authored-by: dtikhonov <4528576+dtikhonov@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback on optimizing unit tests Replace hardcoded combo count with named constant in test_h3_framing.c Nov 27, 2025
Copilot AI requested a review from dtikhonov November 27, 2025 13:39
Copilot finished work on behalf of dtikhonov November 27, 2025 13:39
@dtikhonov
Copy link
Collaborator

This is too complicated, @copilot. Just replace "6" with "sizeof(combos) / sizeof(combos[0])" and be done with it.

Co-authored-by: dtikhonov <4528576+dtikhonov@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 27, 2025

This is too complicated, @copilot. Just replace "6" with "sizeof(combos) / sizeof(combos[0])" and be done with it.

Simplified in c86ca9b - moved combos to file scope and replaced 6 with sizeof(combos) / sizeof(combos[0]).

Copilot AI changed the title Replace hardcoded combo count with named constant in test_h3_framing.c Replace hardcoded combo count with sizeof expression in test_h3_framing.c Nov 27, 2025
Copilot finished work on behalf of dtikhonov November 27, 2025 13:47
@dtikhonov dtikhonov marked this pull request as ready for review November 27, 2025 14:14
@dtikhonov dtikhonov merged commit 1fead21 into 202511270752-parallelize-tests Nov 27, 2025
1 of 3 checks passed
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.

2 participants