diff options
author | Alex Elder <elder@linaro.org> | 2021-10-01 18:23:25 -0500 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-10-04 12:28:56 -0500 |
commit | 26191dc4a97f1434d14f8a579be4634c07192ea4 (patch) | |
tree | a213f1e75da6f68ae2dc148aa2c09cf2777575dd /tests | |
parent | 69f032f38066f9d72f2d1575b084510f1fd5578a (diff) |
parser: reset fixed flag each for each array
If a message contains an array, we need to reset the flag that
indicates whether it is a fixed array or not each time through the
loop parsing message members. Otherwise a non-fixed array declared
after a fixed array will be marked as fixed.
Drop the "int" in the definition of the array_size local varaible in
qmi_message_parse() to be consistent with the rest of the program.
Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-22-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixed.qmi | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/fixed.qmi b/tests/fixed.qmi new file mode 100644 index 0000000..c6376ed --- /dev/null +++ b/tests/fixed.qmi @@ -0,0 +1,17 @@ +package test; + +struct qmi_result { + u16 result; + u16 error; +}; + +request test_request { + optional u8 variable(5) = 0x1; + optional u16 fixed[5] = 0x2; + # The next field should have array_type VAR_LEN_ARRAY + optional u32 not_fixed(5) = 0x3; +} = 0x23; + +response test_response { + required qmi_result r = 2; +} = 043; |