Problem setting sequence elements dynamically

3 posts / 0 new
Last post
Offline
Last seen: 8 years 10 months ago
Joined: 08/30/2013
Posts: 2
Problem setting sequence elements dynamically

Hi,

I have a found a problem with dynamically setting individual sequence elements. The attached file demonstates the problem, where an unrelated change in the structure's type code changes the behaviour from working as expected to not working.

Its likely that I'm not doing this correctly and its just a fluke that it works in any condition. (Note that I need to be able to set sequence elements individually - I have seen the code posted recently for setting an entire sequence.) I know there isn't any call made such as "ensure_length", because there doesn't seem to be one available in the DynamicData api.

Any advice or insight appreciated!
Mike.

AttachmentSize
File test_case.cxx9.78 KB
Organization:
Gerardo Pardo's picture
Offline
Last seen: 1 day 9 hours ago
Joined: 06/02/2010
Posts: 601

Hello Mike,

Thank you for sending the example code illustrating the problem.  It helps a lot.  I was able to reproduce the problem and as far as I can tell it is a bug in the DynamicData implememtation which seems to be related to the use of booleans.

I tried the exact same example changing the type of the 'b' members from 'boolean' to 'long' and also replacing the set_boolean() with set_long() and then the program works as expected...

I have created a bug for it. The id for this bug is CORE-5925 once it is resolved it should appear in the release notes.

As a side note I noticed you wrote the function PrintComplexDynamicData to print the contents of the DynamicData object.  However there is already an operation called print in DynamicDatathat does almost the same thing.  So you could have called   sample.print(stdout, 0) instead of  PrintComplexDynamicData("sample", sample)

Regards,

Gerardo

 

Offline
Last seen: 8 years 10 months ago
Joined: 08/30/2013
Posts: 2

Hi Gerardo,

Thanks for looking at this and also pointing out the print method. I have been using print_IDL on typecodes but didn't spot that one.


regards,

Mike.