diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-09-05 12:59:46 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-09-18 09:17:40 +0200 |
commit | ac9e723fb6baaf9d9afa31f81c57f38ef7610616 (patch) | |
tree | 6011dd94c4e3b2d3a4c6921469c70d2eae324e08 /qemu-io-cmds.c | |
parent | 57e3069641d057a9ca90bb603c86477d5b331ecd (diff) |
tests: unit: simplify test-visitor-serialization list tests
test-visitor-serialization list tests is using an "if" to pick either the first
element of the list or the next one. This was done presumably to mimic the
code that creates the list, which has to fill in either the head pointer
or the next pointer of the last element. However, the code in the insert
phase is a pretty standard singly-linked list insertion, while the one
in the visit phase looks weird and even looks at the first item twice:
this is confusing because the test puts in 32 items and finishes with
an assertion that i == 33.
So, move the "else" step in a separate switch statement, and change
the do...while loop to a while, because cur_head has already been
initialized beforehand.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-io-cmds.c')
0 files changed, 0 insertions, 0 deletions