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

New idl for testing setting the MemberId [20109] #17

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions IDL/appendable.idl
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,8 @@ struct AppendableInheritanceStruct : AppendableShortStruct
struct AppendableInheritanceEmptyStruct : AppendableShortStruct
{
};

struct AppendableExtensibilityInheritance : AppendableShortStruct
{
long var_long;
};
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions IDL/final.idl
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,8 @@ struct FinalInheritanceStruct : FinalShortStruct
struct InheritanceEmptyStruct : FinalShortStruct
{
};

struct FinalExtensibilityInheritance : FinalShortStruct
{
long var_long;
};
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions IDL/key.idl
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ struct KeyedEmptyStruct

struct KeyedEmptyInheritanceStruct : KeyedEmptyStruct
{
@key string key_str;
string key_str;
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
string var_str;
};

struct KeyedInheritanceStruct : KeyedShortStruct
{
@key string key_str;
string key_str;
string var_str;
};

Expand Down
128 changes: 128 additions & 0 deletions IDL/member_id.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
@mutable
struct FixId
{
@id(100)
octet o;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I think it is easier to read if the annotation and the type are in the same line as it is usually written in the specifications. Otherwise, it might be helpful to include a blank line between types. Though this is only a style suggestion and as there is no IDL code style, it can be overlooked.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 65376cd

@id(300)
short s;
@id(500)
long l;
long long ll;
};

@mutable
struct FixHashidDefault
{
@hashid
octet o;
@hashid
short s;
@hashid
long l;
long long ll;
};

@mutable
struct FixHashid
{
@hashid("octet")
octet o;
@hashid("short")
short s;
@hashid("long")
long l;
long long ll;
};

@mutable
struct FixMix
{
@id(100)
octet o;
@hashid
short s;
@hashid("long")
long l;
long long ll;
};

@mutable
@autoid
struct AutoidDefault
{
char c;
@id(100)
octet o;
@hashid
short s;
@hashid("long")
long l;
long long ll;
};

@mutable
@autoid(SEQUENTIAL)
struct AutoidSequential
{
char c;
@id(100)
octet o;
@hashid
short s;
@hashid("long")
long l;
long long ll;
};

@mutable
@autoid(HASH)
struct AutoidHash
{
char c;
@id(100)
octet o;
@hashid
short s;
@hashid("long")
long l;
long long ll;
};

@autoid
struct DerivedAutoidDefault : AutoidDefault
{
char cd;
@id(101)
octet od;
@hashid
short sd;
@hashid("long2")
long ld;
long long lld;
};

@autoid(SEQUENTIAL)
struct DerivedAutoidSequential : AutoidSequential
{
char cd;
@id(101)
octet od;
@hashid
short sd;
@hashid("long2")
long ld;
long long lld;
};

@autoid(HASH)
struct DerivedAutoidHash : AutoidHash
{
char cd;
@id(101)
octet od;
@hashid
short sd;
@hashid("long2")
long ld;
long long lld;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a specific inheritance test case that it would be nice to test as well. What happens if there is nested inheritance as the following IDL:

struct SomeStruct
{
    short some_var;
};

struct EmptyStruct : SomeStruct
{
};

struct AnotherInheritedStruct : EmptyStruct
{
    long another_var;
};

Probably the logic in IDL Parser would handle this case correctly, but I suggest having the test case to ensure that in the future is not broken.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 65376cd

5 changes: 5 additions & 0 deletions IDL/mutable.idl
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,8 @@ struct MutableInheritanceStruct : MutableShortStruct
struct MutableInheritanceEmptyStruct : MutableShortStruct
{
};

struct MutableExtensibilityInheritance : MutableShortStruct
{
long var_long;
};