Skip to content

Commit

Permalink
Testing applying of the comms::option::def::FixedValue option to comm…
Browse files Browse the repository at this point in the history
…s::field::BitmaskValue.
  • Loading branch information
arobenko committed Oct 28, 2024
1 parent 65d38ee commit ca2d43d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/Fields2.th
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public:
void test35();
void test36();
void test37();
void test38();

private:
template <typename TField>
Expand Down Expand Up @@ -2238,6 +2239,22 @@ void FieldsTestSuite2::test37()
TS_ASSERT_EQUALS(field.getValue(), 8U);
}

void FieldsTestSuite2::test38()
{
using Field =
comms::field::BitmaskValue<
comms::Field<BigEndianOpt>,
comms::option::def::FixedLength<1>,
comms::option::def::BitmaskReservedBits<0xff, 0x1>,
comms::option::def::DefaultNumValue<0x1>
>;

Field field;
TS_ASSERT(field.valid());
TS_ASSERT_EQUALS(field.getBitValue(0), true);
TS_ASSERT_EQUALS(field.getBitValue(1), false);
}

template <typename TField>
void FieldsTestSuite2::writeField(
const TField& field,
Expand Down

0 comments on commit ca2d43d

Please sign in to comment.