@@ -53,6 +53,86 @@ public:
5353
5454};
5555
56+ bool compare_type_identifiers(
57+ const TypeIdentifier& a_identifier,
58+ const TypeIdentifier& another_identifier)
59+ {
60+
61+ if (a_identifier._d() != another_identifier._d())
62+ {
63+ return false;
64+ }
65+
66+ switch (a_identifier._d())
67+ {
68+ case TI_STRING8_SMALL:
69+ case TI_STRING16_SMALL:
70+ return (a_identifier.string_sdefn() == another_identifier.string_sdefn());
71+ break;
72+
73+ case TI_STRING8_LARGE:
74+ case TI_STRING16_LARGE:
75+ return (a_identifier.string_ldefn() == another_identifier.string_ldefn());
76+ break;
77+
78+ case TI_PLAIN_SEQUENCE_SMALL:
79+ return (a_identifier.seq_sdefn().header() == another_identifier.seq_sdefn().header() &&
80+ a_identifier.seq_sdefn().bound() == another_identifier.seq_sdefn().bound() &&
81+ *a_identifier.seq_sdefn().element_identifier() == *another_identifier.seq_sdefn().element_identifier());
82+ break;
83+
84+ case TI_PLAIN_SEQUENCE_LARGE:
85+ return (a_identifier.seq_ldefn().header() == another_identifier.seq_ldefn().header() &&
86+ a_identifier.seq_ldefn().bound() == another_identifier.seq_ldefn().bound() &&
87+ *a_identifier.seq_ldefn().element_identifier() == *another_identifier.seq_ldefn().element_identifier());
88+
89+ return (a_identifier.seq_ldefn() == another_identifier.seq_ldefn());
90+ break;
91+
92+ case TI_PLAIN_ARRAY_SMALL:
93+ return (a_identifier.array_sdefn().header() == another_identifier.array_sdefn().header() &&
94+ a_identifier.array_sdefn().array_bound_seq() == another_identifier.array_sdefn().array_bound_seq() &&
95+ *a_identifier.array_sdefn().element_identifier() == *another_identifier.array_sdefn().element_identifier());
96+ break;
97+
98+ case TI_PLAIN_ARRAY_LARGE:
99+ return (a_identifier.array_ldefn().header() == another_identifier.array_ldefn().header() &&
100+ a_identifier.array_ldefn().array_bound_seq() == another_identifier.array_ldefn().array_bound_seq() &&
101+ *a_identifier.array_ldefn().element_identifier() == *another_identifier.array_ldefn().element_identifier());
102+ break;
103+
104+ case TI_PLAIN_MAP_SMALL:
105+ return (a_identifier.map_sdefn().header() == another_identifier.map_sdefn().header() &&
106+ a_identifier.map_sdefn().bound() == another_identifier.map_sdefn().bound() &&
107+ *a_identifier.map_sdefn().element_identifier() == *another_identifier.map_sdefn().element_identifier() &&
108+ a_identifier.map_sdefn().key_flags() == another_identifier.map_sdefn().key_flags() &&
109+ *a_identifier.map_sdefn().key_identifier() == *another_identifier.map_sdefn().key_identifier());
110+ break;
111+
112+ case TI_PLAIN_MAP_LARGE:
113+ return (a_identifier.map_ldefn().header() == another_identifier.map_ldefn().header() &&
114+ a_identifier.map_ldefn().bound() == another_identifier.map_ldefn().bound() &&
115+ *a_identifier.map_ldefn().element_identifier() == *another_identifier.map_ldefn().element_identifier() &&
116+ a_identifier.map_ldefn().key_flags() == another_identifier.map_ldefn().key_flags() &&
117+ *a_identifier.map_ldefn().key_identifier() == *another_identifier.map_ldefn().key_identifier());
118+ break;
119+
120+ case TI_STRONGLY_CONNECTED_COMPONENT:
121+ return (a_identifier.sc_component_id() == another_identifier.sc_component_id());
122+ break;
123+
124+ case EK_COMPLETE:
125+ case EK_MINIMAL:
126+ return (a_identifier.equivalence_hash() == another_identifier.equivalence_hash());
127+ break;
128+
129+ default:
130+ return a_identifier.extended_defn() == another_identifier.extended_defn();
131+
132+ break;
133+ }
134+ }
135+
56136$definitions;separator="\n"$
57137
58138int main(
@@ -630,15 +710,15 @@ check_struct_member(member, parent) ::= <<
630710 $get_type_identifier(type=member.typecode, var="member_type_ids")$
631711 if (TK_NONE != member_type_ids.type_identifier2()._d())
632712 {
633- EXPECT_TRUE(member_type_ids.type_identifier1() == type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].common().member_type_id() ||
634- member_type_ids.type_identifier1() == type_objects.complete_type_object.complete().struct_type().member_seq()[pos].common().member_type_id());
635- EXPECT_TRUE(member_type_ids.type_identifier2() == type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].common().member_type_id() ||
636- member_type_ids.type_identifier2() == type_objects.complete_type_object.complete().struct_type().member_seq()[pos].common().member_type_id());
713+ EXPECT_TRUE(compare_type_identifiers( member_type_ids.type_identifier1(), type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].common().member_type_id() ) ||
714+ compare_type_identifiers( member_type_ids.type_identifier1(), type_objects.complete_type_object.complete().struct_type().member_seq()[pos].common().member_type_id() ));
715+ EXPECT_TRUE(compare_type_identifiers( member_type_ids.type_identifier2(), type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].common().member_type_id() ) ||
716+ compare_type_identifiers( member_type_ids.type_identifier2(), type_objects.complete_type_object.complete().struct_type().member_seq()[pos].common().member_type_id() ));
637717 }
638718 else
639719 {
640- EXPECT_EQ( member_type_ids.type_identifier1(), type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].common().member_type_id());
641- EXPECT_EQ( member_type_ids.type_identifier1(), type_objects.complete_type_object.complete().struct_type().member_seq()[pos].common().member_type_id());
720+ EXPECT_TRUE(compare_type_identifiers( member_type_ids.type_identifier1(), type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].common().member_type_id() ));
721+ EXPECT_TRUE(compare_type_identifiers( member_type_ids.type_identifier1(), type_objects.complete_type_object.complete().struct_type().member_seq()[pos].common().member_type_id() ));
642722 }
643723 EXPECT_EQ("$member.name$", type_objects.complete_type_object.complete().struct_type().member_seq()[pos].detail().name().to_string());
644724 EXPECT_EQ(member_name_hashed, type_objects.minimal_type_object.minimal().struct_type().member_seq()[pos].detail().name_hash());
0 commit comments