Skip to content

xtypes_v2_union_rules_union_different_ids_1 should be OK #8

Description

@disganaitis

dds-xtypes/test_suite.py

Lines 1226 to 1234 in 2beca33

'union_different_ids_1': {
'common_args': ['-X xml/types/unions.xml'],
'apps': ['pub-exe -P -t test -y Test::union_1 -V xml/data/union_x1.xml -J json/data/union_x1.json',
'sub-exe -S -t test -y Test::union_2 -V xml/data/union_x1.xml -J json/data/union_x1.json'],
'expected_codes': [ReturnCode.INCONSISTENT_TOPIC, ReturnCode.INCONSISTENT_TOPIC],
'check_function': tsf.data_is_correct,
'title': '',
'description': ''
},

<union name="union_1" ><discriminator type="uint32" />
<case><caseDiscriminator value="1"/><member name="x1" type="int16" /></case>
<case><caseDiscriminator value="2"/><member name="x2" type="int32" /></case>
<case><caseDiscriminator value="3"/><member name="x3" type="int32" /></case>
</union>
<union name="union_2" ><discriminator type="uint32" />
<case><caseDiscriminator value="2"/><member name="x2" type="int32"/></case>
<case><caseDiscriminator value="1"/><member name="x1" type="int16"/></case>
<case><caseDiscriminator value="3"/><member name="x3" type="int32"/></case>
</union>

At this point in the test ignore_member_names is set to TRUE (union_different_ids_2 tests for FALSE), therefore the different names of the members do not impact assignability.
As per Table 19 of DDS-Xtypes v1.3 union assignability is based on discriminator values and not on ID values, therefore as each discriminator matches to an identical type - the unions are assignable
Additionally appendable extensibility does not have any explicitly differing behaviors from mutable extensibility, therefore the ordering of the discriminators should not affect assignability, such behavior is only explicitly defined for final extensibility

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions