File tree Expand file tree Collapse file tree 2 files changed +4
-23
lines changed
main/java/uk/co/real_logic/sbe/generation/cpp Expand file tree Collapse file tree 2 files changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -1712,7 +1712,7 @@ private CharSequence generateEnumProperty(
17121712
17131713 final StringBuilder sb = new StringBuilder ();
17141714
1715- if (token .isConstantEncoding ())
1715+ if (signalToken .isConstantEncoding ())
17161716 {
17171717 final String constValue = signalToken .encoding ().constValue ().toString ();
17181718
Original file line number Diff line number Diff line change @@ -640,28 +640,9 @@ class Rc3OtfFullIrTest : public testing::Test
640640 {
641641 EXPECT_EQ (fieldToken.fieldId (), fieldIdDiscountedModel);
642642 EXPECT_EQ (encoding.primitiveType (), PrimitiveType::CHAR);
643- EXPECT_EQ (encoding.presence (), Presence::SBE_CONSTANT);
644- EXPECT_TRUE (typeToken.isConstantEncoding ());
645- EXPECT_EQ (typeToken.encodedLength (), 0 );
646-
647- const PrimitiveValue value = encoding.constValue ();
648-
649- EXPECT_EQ (value.getAsInt (), static_cast <std::int64_t >(' C' ));
650- bool found = false ;
651- for (size_t i = fromIndex + 1 ; i < toIndex; i++)
652- {
653- const Token& token = tokens.at (i);
654- const std::int64_t constValue = token.encoding ().constValue ().getAsInt ();
655-
656- std::cout << " " << token.name () << " = " << constValue << " \n " ;
657-
658- if (constValue == value.getAsInt ())
659- {
660- EXPECT_EQ (token.name (), std::string (" C" ));
661- found = true ;
662- }
663- }
664- EXPECT_TRUE (found);
643+ EXPECT_TRUE (fieldToken.isConstantEncoding ());
644+ EXPECT_EQ (fieldToken.encodedLength (), 0 );
645+ EXPECT_EQ (std::string (fieldToken.encoding ().constValue ().getArray ()), std::string (" Model.C" ));
665646 break ;
666647 }
667648
You can’t perform that action at this time.
0 commit comments