diff options
| author | Simon Glass <[email protected]> | 2025-10-15 16:44:12 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-10-22 14:16:56 -0600 |
| commit | eff1dca96330269c8281b17d00f5d2d0e62bd26e (patch) | |
| tree | c73590db763042b09de96a1702f43d80bb852383 /test | |
| parent | 4ce78089b2a615eab466347e8996fbd54a876234 (diff) | |
boot: Don't change the method count after global bootmeths
At present before scanning global bootmeths, the iterator sets the
method count to the index of the first global bootmeth. Now that we
support scanning the global bootmeths multiple times, we must leave this
count alone.
Check against have_global and first_glob_method instead.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/boot/bootflow.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 8317dee1e20..20297136e3f 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -426,7 +426,7 @@ static int bootflow_iter_glob(struct unit_test_state *uts) ut_asserteq(-EPROTONOSUPPORT, bootflow_scan_next(&iter, &bflow)); /* at this point the global bootmeths are stranded above num_methods */ - ut_asserteq(2, iter.num_methods); + ut_asserteq(3, iter.num_methods); ut_asserteq(2, iter.first_glob_method); ut_assert(!iter.doing_global); ut_assert(iter.have_global); @@ -493,7 +493,7 @@ static int bootflow_iter_disable(struct unit_test_state *uts) ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow)); /* at this point the global bootmeths are stranded above num_methods */ - ut_asserteq(3, iter.num_methods); + ut_asserteq(4, iter.num_methods); ut_assert(!iter.doing_global); ut_assert(iter.have_global); ut_asserteq(3, iter.first_glob_method); @@ -505,7 +505,7 @@ static int bootflow_iter_disable(struct unit_test_state *uts) ut_assert_console_end(); /* Check that the sandbox bootmeth has been removed */ - ut_asserteq(2, iter.num_methods); + ut_asserteq(3, iter.num_methods); for (i = 0; i < iter.num_methods; i++) ut_assert(strcmp("sandbox", iter.method_order[i]->name)); |
