Skip to content

Commit 9bad4b3

Browse files
committed
testsuite: fix variable declaration for planner_multi unit tests
Problem: planner_multi_t contexts are declared and initialized using a comma-separated list that can result in UB. Correct the declaration and initialization.
1 parent e0b1912 commit 9bad4b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

resource/planner/test/planner_test02.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,10 @@ static int test_constructors_and_overload ()
556556
const uint64_t request1[] = {1, 0, 0, 0, 0};
557557
const uint64_t request2[] = {0, 2, 0, 0, 0};
558558
const uint64_t request3[] = {0, 0, 3, 0, 0};
559-
planner_multi_t *ctx, *ctx2, *ctx3, *ctx4 = NULL;
559+
planner_multi_t *ctx = NULL, *ctx2 = NULL, *ctx3 = NULL, *ctx4 = NULL;
560560

561-
ctx = planner_multi_new (0, INT64_MAX, resource_totals, resource_types, len);
561+
ctx = planner_multi_new (0, INT64_MAX, resource_totals, resource_types,
562+
len);
562563

563564
planner_multi_add_span (ctx, 0, 1000, request1, len);
564565
span = planner_multi_add_span (ctx, 1000, 1000, request2, len);

0 commit comments

Comments
 (0)