qmic/tests/duplicate_struct_name.qmi
Alex Elder 72d1687658 parser: disallow duplicate members
Check each constant as it is recognized to ensure its name does not
duplicate an already-defined constant.

Check each message member as it is recognized to ensure its name
does not duplicate an already-defined member.  Also check its id
value to ensure the same value isn't used more than once.

Check each struct member as it is recognized to ensure its name does
not duplicate an already-defined member.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-27-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:34:46 -05:00

31 lines
452 B
Plaintext

package test;
const TEST_REQUEST_RESPONSE = 35;
const TEST_INDICATION = 07;
struct qmi_result {
u16 result;
u16 error;
};
struct test_struct {
u8 test_u8;
u8 test_u8;
u16 test_u16;
u32 test_u32;
u64 test_u64;
};
request test_request {
optional test_struct foo = 0x1;
required u8 test_number = 0x12;
} = 0x23;
response test_response {
required qmi_result r = 2;
} = 043;
indication test_indication {
optional u64 value = 0x99;
} = 0x7;