forked from objectcomputing/mFAST
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxetra_enum_encoder_decoder_v2.cpp
More file actions
43 lines (37 loc) · 1.56 KB
/
xetra_enum_encoder_decoder_v2.cpp
File metadata and controls
43 lines (37 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "catch.hpp"
#include <mfast.h>
#include "fast_test_coding_case_v2.hpp"
#include "byte_stream.h"
#include "simple18.h"
using namespace test::coding;
TEST_CASE("xetra enum test encoder_V2/decoder_v2","[xetra_enum_encoder_v2_decoder_v2]")
{
SECTION("No optional enum / Active")
{
fast_test_coding_case_v2<simple18::templates_description> test_case;
simple18::Test_1 test_1;
simple18::Test_1_mref test_1_mref = test_1.mref();
test_1_mref.set_MDStatisticStatus().as_Active();
REQUIRE(test_case.encoding(test_1.cref(),"\xc0\x81\x80",true));
REQUIRE(test_case.decoding("\xc0\x81\x80",test_1.cref(),true));
}
SECTION("No optional enum / Inactive")
{
fast_test_coding_case_v2<simple18::templates_description> test_case;
simple18::Test_1 test_1;
simple18::Test_1_mref test_1_mref = test_1.mref();
test_1_mref.set_MDStatisticStatus().as_Inactive();
REQUIRE(test_case.encoding(test_1.cref(),"\xe0\x81\x81\x80",true));
REQUIRE(test_case.decoding("\xe0\x81\x81\x80",test_1.cref(),true));
}
SECTION("Optional enum")
{
fast_test_coding_case_v2<simple18::templates_description> test_case;
simple18::Test_1 test_1;
simple18::Test_1_mref test_1_mref = test_1.mref();
test_1_mref.set_MDStatisticStatus().as_Inactive();
test_1_mref.set_MDStatisticFrequencyUnit().as_Minutes();
REQUIRE(test_case.encoding(test_1.cref(),"\xe0\x81\x81\x83",true));
REQUIRE(test_case.decoding("\xe0\x81\x81\x83",test_1.cref(),true));
}
}