From 62fd60b839906e9449ded22ad71e727fe3940d2d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:34:08 +0000 Subject: [PATCH 1/4] Initial plan From fe1e24ba2d2c2a899b0d6da7ac46997f1076a86c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:37:44 +0000 Subject: [PATCH 2/4] Replace hardcoded 6 with N_PWRITEV_COMBOS constant Co-authored-by: dtikhonov <4528576+dtikhonov@users.noreply.github.com> --- _codeql_detected_source_root | 1 + tests/test_h3_framing.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 00000000..945c9b46 --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/tests/test_h3_framing.c b/tests/test_h3_framing.c index 6e3909c4..85341047 100644 --- a/tests/test_h3_framing.c +++ b/tests/test_h3_framing.c @@ -1027,6 +1027,9 @@ test_pwritev (enum lsquic_version version, int http, int sched_immed, } +/* Number of pwritev parameter combinations */ +#define N_PWRITEV_COMBOS 6 + static void main_test_pwritev_combo (int combo_start, int combo_end) { @@ -1050,6 +1053,10 @@ main_test_pwritev_combo (int combo_start, int combo_end) }; int combo_idx; + /* Ensure N_PWRITEV_COMBOS matches the actual array size */ + _Static_assert(sizeof(combos) / sizeof(combos[0]) == N_PWRITEV_COMBOS, + "N_PWRITEV_COMBOS must match the combos array size"); + s_can_write_ack = 1; for (combo_idx = combo_start; combo_idx < combo_end; ++combo_idx) @@ -1078,7 +1085,7 @@ static void main_test_pwritev (void) { /* Run all combos */ - main_test_pwritev_combo(0, 6); + main_test_pwritev_combo(0, N_PWRITEV_COMBOS); } From c4182ff9b12f0d05e19ff31000c807005fb67e66 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:38:11 +0000 Subject: [PATCH 3/4] Remove codeql artifact and add to gitignore Co-authored-by: dtikhonov <4528576+dtikhonov@users.noreply.github.com> --- .gitignore | 1 + _codeql_detected_source_root | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .gitignore delete mode 120000 _codeql_detected_source_root diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..dae5936b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root deleted file mode 120000 index 945c9b46..00000000 --- a/_codeql_detected_source_root +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file From c86ca9bad46b5e2774faaf47571bad67a9971928 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:46:37 +0000 Subject: [PATCH 4/4] Simplify: move combos to file scope and use sizeof directly Co-authored-by: dtikhonov <4528576+dtikhonov@users.noreply.github.com> --- tests/test_h3_framing.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/test_h3_framing.c b/tests/test_h3_framing.c index 85341047..a68fb4fd 100644 --- a/tests/test_h3_framing.c +++ b/tests/test_h3_framing.c @@ -1027,8 +1027,15 @@ test_pwritev (enum lsquic_version version, int http, int sched_immed, } -/* Number of pwritev parameter combinations */ -#define N_PWRITEV_COMBOS 6 +static const struct { unsigned iovecs, frames; } combos[] = +{ + { 32, 16, }, + { 16, 16, }, + { 16, 8, }, + { 3, 7, }, + { 7, 3, }, + { 100, 100, }, +}; static void main_test_pwritev_combo (int combo_start, int combo_end) @@ -1042,21 +1049,8 @@ main_test_pwritev_combo (int combo_start, int combo_end) unsigned i, j, k; enum lsquic_version version; int http, sched_immed; - const struct { unsigned iovecs, frames; } combos[] = - { - { 32, 16, }, - { 16, 16, }, - { 16, 8, }, - { 3, 7, }, - { 7, 3, }, - { 100, 100, }, - }; int combo_idx; - /* Ensure N_PWRITEV_COMBOS matches the actual array size */ - _Static_assert(sizeof(combos) / sizeof(combos[0]) == N_PWRITEV_COMBOS, - "N_PWRITEV_COMBOS must match the combos array size"); - s_can_write_ack = 1; for (combo_idx = combo_start; combo_idx < combo_end; ++combo_idx) @@ -1085,7 +1079,7 @@ static void main_test_pwritev (void) { /* Run all combos */ - main_test_pwritev_combo(0, N_PWRITEV_COMBOS); + main_test_pwritev_combo(0, sizeof(combos) / sizeof(combos[0])); }