summary refs log tree commit diff stats
path: root/scripts/qapi/parser.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-09-05 12:59:46 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-09-18 09:17:40 +0200
commitac9e723fb6baaf9d9afa31f81c57f38ef7610616 (patch)
tree6011dd94c4e3b2d3a4c6921469c70d2eae324e08 /scripts/qapi/parser.py
parent57e3069641d057a9ca90bb603c86477d5b331ecd (diff)
downloadfocaccia-qemu-ac9e723fb6baaf9d9afa31f81c57f38ef7610616.tar.gz
focaccia-qemu-ac9e723fb6baaf9d9afa31f81c57f38ef7610616.zip
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 'scripts/qapi/parser.py')
0 files changed, 0 insertions, 0 deletions