-
Notifications
You must be signed in to change notification settings - Fork 59
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
[14671] Fix generated code for bounded strings #119
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.
Next IDL test file is not compiling due to array and sequence of bounded strings:
module hola
{
struct S
{
string sn;
string<10> sb;
};
};
struct S
{
hola::S st;
string sn;
string<10> sb;
string sna[10];
string<10> sba[10];
sequence<string, 10> sns;
sequence<string<10>, 10> sbs;
};
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
706e1d2
to
f92084e
Compare
@richiware I think I fixed the (de)serialization of collections of bounded strings |
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.
coverage_basic.idl
test from fastddsgen is failing. The output:
2022-06-30T14:03:18.840+0200 [DEBUG] [TestEventLogger] >>> COVERAGE_BASIC TEST: GENERATE...
2022-06-30T14:03:18.840+0200 [DEBUG] [TestEventLogger] Executing command: java -jar share/fastddsgen/java/fastddsgen.jar -replace -example CMake -test -d build/test/integration/idls/coverage_basic thirdparty/idl-parser/test/idls/coverage_basic.idl
2022-06-30T14:03:19.702+0200 [DEBUG] [TestEventLogger] Loading templates...
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] Processing the file thirdparty/idl-parser/test/idls/coverage_basic.idl...
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] Exception in thread "main" java.lang.StackOverflowError
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.703+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.704+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.705+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.705+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.705+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.705+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.705+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.706+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.706+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.706+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.706+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.706+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.707+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.707+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.707+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.707+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.707+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.708+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.708+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.708+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.708+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.708+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
2022-06-30T14:03:19.708+0200 [DEBUG] [TestEventLogger] at org.antlr.stringtemplate.StringTemplate.getAttributeRenderer(StringTemplate.java:1045)
I was investigating and the error is caused by a recursive |
I test it again from scratch. The
The idl part which provokes this is: struct LargeWStringStruct
{
wstring<41925> my_large_wstring;
}; |
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
d031e10
to
42e5af3
Compare
@richiware I think i fixed the wstring issue. I checked with the following idl:
|
Next test also fails:
Here the IDL file for testing: https://raw.githubusercontent.com/eProsima/IDL-Parser/master/test/idls/coverage_complex.idl |
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
This PR changes the generated code for bounded strings, so
eprosima::fastrtps::fixed_string<N>
is used instead ofstd::string
Depends on eProsima/IDL-Parser#53