-
Notifications
You must be signed in to change notification settings - Fork 787
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
[20424] Dynamic language binding tests #4626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review
{ | ||
eprosima::fastdds::dds::Log::ScopeLogs _("disable"); | ||
// Try to add a descriptor with the same name. | ||
member_descriptor = traits<MemberDescriptor>::make_shared(); | ||
member_descriptor->type(factory->get_primitive_type(eprosima::fastdds::dds::TK_INT32)); | ||
member_descriptor->name("THIRD"); | ||
EXPECT_NE(builder->add_member(member_descriptor), RETCODE_OK); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add some more enum MemberDescriptor consistency checks apart from the non-empty name suggested here:
- Use of
default_value_
to give the enumerator a specific value different from the sequential one automatically assigned. Add another literal and check that the sequential order restarts with the previous literal value. - MemberId taking a value different from MEMBER_ID_INVALID: MemberDescriptor should be inconsistent.
is_default_label_
flag should be false according to the specification, but I think this field should be used to apply the@default_literal
builtin annotation.is_key_
flag should be false as this annotation only applies to Structure members and Union discriminators.is_must_understand_
flag should be false as this builtin annotation only applies to Structure members.is_optional_
flag should be false as this builtin annotation only applies to Structure members.is_shared_
flag should be false as this annotation only applies to Structure members.label
property should be empty in order for the literal to be consistent.try_construct_kind
does not apply, but the enumerator which is defined in the IDL does not allow for this case. It is already initialized to DISCARD so I am not sure if a consistency check can be done with this property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done except default_value_
beucase that logic is not implemented yet.
118fab0
to
059cd7a
Compare
a574750
to
e2458cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another DynamicTypesTests partial review
e2458cb
to
142d003
Compare
142d003
to
eb38f4c
Compare
c53092e
to
3f62216
Compare
b92afc8
to
bcc11eb
Compare
3f62216
to
fd95613
Compare
bcc11eb
to
14e8cf5
Compare
This PR should fix inheritance (both structure and bitsets) when loading a Dynamic Type from a XML profiles file. |
7aeac8e
to
8096fd0
Compare
943b988
to
2c47b5e
Compare
f693187
to
2a37cf6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review
ASSERT_TRUE(struct_data); | ||
|
||
// Test get_member_by_name and get_member_by_index. | ||
ASSERT_EQ(MEMBER_ID_INVALID, struct_data->get_member_id_by_name("")); | ||
ASSERT_EQ(0, struct_data->get_member_id_by_name("Structure")); | ||
ASSERT_EQ(10, struct_data->get_member_id_by_name("int64")); | ||
ASSERT_EQ(0, struct_data->get_member_id_at_index(0)); | ||
ASSERT_EQ(10, struct_data->get_member_id_at_index(1)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not correct. Getting the complex value for a non-selected union member fails. I would expect the same to happen for loans. And if we decide that the loan can be returned and if set, the discriminator points to the new union member, then the same philosophy must be followed with complex API.
Also, the test only uses the get API and this should fail because the union member being read is not the one selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final review for DynamicTypesTests
XML structure and bitset inheritance must be fixed. Please, open also a documentation PR fixing the corresponding snippets. |
2c47b5e
to
c978d52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review. Only maps.idl tests pending for review.
test/feature/dynamic_types/dds_types_tests/DynamicTypesInheritanceDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesInheritanceDDSTypesTests.cpp
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesInheritanceDDSTypesTests.cpp
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesInheritanceDDSTypesTests.cpp
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final review for my part.
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp
Outdated
Show resolved
Hide resolved
static_pubsubType); | ||
EXPECT_EQ(value.size(), struct_data.var_map_long_double().size()); | ||
for (auto const& map_element : value) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been rereading the specification and what it says is:
Map keys are implicitly converted to strings
But the specification does not specify which kind of string. So I suppose, that we should either define both APIs with std::string
or just std::wstring
. This change would introduce support to keys with wide string keys and wide string annotation parameters
8c0830d
to
5148f5d
Compare
Signed-off-by: adriancampo <[email protected]> Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González <[email protected]>
Signed-off-by: Ricardo González <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: Ricardo González Moreno <[email protected]>
5220896
to
7801390
Compare
Signed-off-by: Ricardo González Moreno <[email protected]>
7801390
to
be61920
Compare
Description
This PR adds types that test the Dynamic Language Binding.
Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist