Add an assertion on restoring the correct index on failure. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> CC: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> --- tools/testing/vma/vma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/vma/vma.c b/tools/testing/vma/vma.c index c53f220eb6cc..46e8989a90ae 100644 --- a/tools/testing/vma/vma.c +++ b/tools/testing/vma/vma.c @@ -243,6 +243,12 @@ static bool test_simple_merge(void) ASSERT_FALSE(vma_link(&mm, vma_left)); ASSERT_FALSE(vma_link(&mm, vma_right)); + fail_prealloc = true; + vma = merge_new(&vmg); + ASSERT_EQ(vma, NULL); + ASSERT_EQ(vmi.mas.index, 0x1000); + + fail_prealloc = false; vma = merge_new(&vmg); ASSERT_NE(vma, NULL); -- 2.34.1