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

BUG: C++ wrong block length with constant enums #528

Closed
arobenko opened this issue Nov 9, 2017 · 2 comments
Closed

BUG: C++ wrong block length with constant enums #528

arobenko opened this issue Nov 9, 2017 · 2 comments

Comments

@arobenko
Copy link

arobenko commented Nov 9, 2017

Having the following enum definition

<enum name="Enum1" encodingType="uint8">
    <validValue name="Val1">0</validValue>
    <validValue name="Val2">1</validValue>
    <validValue name="Val3">2</validValue>
</enum> 

and the following message:

<message name="Msg1" id="1" description="TestMessage">
    <field name="field1" id="20" type="Enum1" presence="constant" valueRef="Enum1.Val2"/>
</message>

Generates right constant value for "field1" (which is expected)

Enum1::Value field1() const SBE_NOEXCEPT
{
    return Enum1::Value::Val2;
}

But wrong block length (expected to be 0)

static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT
{
    return (std::uint16_t)1;
}

Reproduced with v1.7.4

@mjpt777
Copy link
Contributor

mjpt777 commented Nov 10, 2017

@arobenko Thanks for the reports. Can you test the last commits I've pushed?

@arobenko
Copy link
Author

I will in a couple of days, but I think you should put it in your unittests, and close the ticket if you think it's fixed.

@mjpt777 mjpt777 closed this as completed Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants