Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20538 Update FastDDSGen tests for indirect hashes #307

Merged
merged 6 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ else
discriminator_type_ids.type_identifier2() == type_objects.complete_type_object.union_type().discriminator().common().type_id());
}
$check_type_detail_annotations(object=union.discriminator, type="union_type().discriminator()")$
MemberId member_id = 0;
MemberId member_id = 1;
$union.members: { member | $check_union_member(member=member, parent=union)$}; separator="\n"$
ASSERT_EQ($union.membersSize$, type_objects.minimal_type_object.union_type().member_seq().size());
for (size_t i = 1; i < type_objects.minimal_type_object.union_type().member_seq().size(); ++i)
Expand Down Expand Up @@ -1096,8 +1096,8 @@ if (type_ids.type_identifier1()._d() == TI_PLAIN_ARRAY_SMALL)
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().array_sdefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().array_sdefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_sdefn().element_identifier());
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
EXPECT_TRUE(element_type_ids.type_identifier2() == TK_NONE);
}
else
{
Expand All @@ -1123,8 +1123,8 @@ else
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().array_ldefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().array_ldefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_ldefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier2() == TK_NONE);
}
else
{
Expand Down Expand Up @@ -1181,8 +1181,8 @@ if (type_ids.type_identifier1()._d() == TI_PLAIN_SEQUENCE_SMALL)
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().seq_sdefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().seq_sdefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_sdefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier2() == TK_NONE);
}
else
{
Expand All @@ -1206,8 +1206,8 @@ else
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().seq_ldefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().seq_ldefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_ldefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier2() == TK_NONE);
}
else
{
Expand Down Expand Up @@ -1262,21 +1262,9 @@ if (type_ids.type_identifier1()._d() == TI_PLAIN_MAP_SMALL)
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().map_sdefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().key_identifier() ||
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().key_identifier());
}
else if (EK_BOTH == type_ids.type_identifier1().map_sdefn().header().equiv_kind())
{
EXPECT_EQ(type_ids.type_identifier1().map_sdefn().header().equiv_kind(),
type_ids.type_identifier2().map_sdefn().header().equiv_kind());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().element_identifier());
EXPECT_TRUE((key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier2().map_sdefn().key_identifier()) ||
(key_type_ids.type_identifier1() == *type_ids.type_identifier2().map_sdefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().key_identifier()));
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().key_identifier());
EXPECT_TRUE(element_type_ids.type_identifier2() == TK_NONE);
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
}
else
{
Expand Down Expand Up @@ -1323,21 +1311,9 @@ else
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().map_ldefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().key_identifier() ||
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().key_identifier());
}
else if (EK_BOTH == type_ids.type_identifier1().map_ldefn().header().equiv_kind())
{
EXPECT_EQ(type_ids.type_identifier1().map_ldefn().header().equiv_kind(),
type_ids.type_identifier2().map_ldefn().header().equiv_kind());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().element_identifier());
EXPECT_TRUE((key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier2().map_ldefn().key_identifier()) ||
(key_type_ids.type_identifier1() == *type_ids.type_identifier2().map_ldefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().key_identifier()));
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().key_identifier());
EXPECT_TRUE(element_type_ids.type_identifier2() == TK_NONE);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,13 @@ else
return;
}
EquivalenceKind equiv_kind_$map_name(map)$ = EK_BOTH;
if (EK_COMPLETE == element_identifier_$map_name(map)$->_d() ||
if ((EK_COMPLETE == key_identifier_$map_name(map)$->_d() || EK_COMPLETE == element_identifier_$map_name(map)$->_d()) ||
(TI_PLAIN_SEQUENCE_SMALL == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->seq_sdefn().header().equiv_kind()) ||
(TI_PLAIN_SEQUENCE_LARGE == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->seq_ldefn().header().equiv_kind()) ||
(TI_PLAIN_ARRAY_SMALL == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->array_sdefn().header().equiv_kind()) ||
(TI_PLAIN_ARRAY_LARGE == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->array_ldefn().header().equiv_kind()) ||
(TI_PLAIN_MAP_SMALL == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->map_sdefn().header().equiv_kind()) ||
(TI_PLAIN_MAP_LARGE == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->map_ldefn().header().equiv_kind()))
(TI_PLAIN_MAP_SMALL == element_identifier_$map_name(map)$->_d() && (EK_COMPLETE == element_identifier_$map_name(map)$->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_$map_name(map)$->map_sdefn().header().equiv_kind())) ||
(TI_PLAIN_MAP_LARGE == element_identifier_$map_name(map)$->_d() && (EK_COMPLETE == element_identifier_$map_name(map)$->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_$map_name(map)$->map_ldefn().header().equiv_kind())))
{
equiv_kind_$map_name(map)$ = EK_COMPLETE;
}
Expand Down
Loading