@@ -43,9 +43,9 @@ SCENARIO("Test the encoding of command messages") {
43
43
// 01020304
44
44
THEN (" The encoding is successful" ) {
45
45
REQUIRE (err == Encoder::Status::Complete);
46
- std::vector<uint8_t > res (buffer, buffer+res_len );
46
+ std::vector<int > res (buffer, buffer+bytes_encoded );
47
47
48
- REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<uint8_t >{
48
+ REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<int >{
49
49
0xda , 0x00 , 0x01 , 0x00 , 0x00 , 0x81 , 0x58 , 0x20 ,
50
50
0x01 , 0x02 , 0x03 , 0x04 , 0x00 , 0x00 , 0x00 , 0x00 ,
51
51
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
@@ -80,9 +80,9 @@ SCENARIO("Test the encoding of command messages") {
80
80
81
81
THEN (" The encoding is successful" ) {
82
82
REQUIRE (err == Encoder::Status::Complete);
83
- std::vector<uint8_t > res (buffer, buffer+res_len );
83
+ std::vector<int > res (buffer, buffer+bytes_encoded );
84
84
85
- REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<uint8_t >{
85
+ REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<int >{
86
86
0xda , 0x00 , 0x01 , 0x03 , 0x00 , 0x81 , 0x68 , 0x74 ,
87
87
0x68 , 0x69 , 0x6e , 0x67 , 0x5f , 0x69 , 0x64
88
88
}));
@@ -107,9 +107,9 @@ SCENARIO("Test the encoding of command messages") {
107
107
// 80 # array(0)
108
108
THEN (" The encoding is successful" ) {
109
109
REQUIRE (err == Encoder::Status::Complete);
110
- std::vector<uint8_t > res (buffer, buffer+res_len );
110
+ std::vector<int > res (buffer, buffer+bytes_encoded );
111
111
112
- REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<uint8_t >{
112
+ REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<int >{
113
113
0xda , 0x00 , 0x01 , 0x05 , 0x00 , 0x80
114
114
}));
115
115
}
@@ -138,9 +138,9 @@ SCENARIO("Test the encoding of command messages") {
138
138
// 322E302E30 # "2.0.0"
139
139
THEN (" The encoding is successful" ) {
140
140
REQUIRE (err == Encoder::Status::Complete);
141
- std::vector<uint8_t > res (buffer, buffer+res_len );
141
+ std::vector<int > res (buffer, buffer+bytes_encoded );
142
142
143
- REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<uint8_t >{
143
+ REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<int >{
144
144
0xda , 0x00 , 0x01 , 0x07 , 0x00 , 0x81 , 0x65 , 0x32 ,
145
145
0x2e , 0x30 , 0x2e , 0x30
146
146
}));
@@ -178,9 +178,9 @@ SCENARIO("Test the encoding of command messages") {
178
178
// 18 64 # unsigned(100)
179
179
THEN (" The encoding is successful" ) {
180
180
REQUIRE (err == Encoder::Status::Complete);
181
- std::vector<uint8_t > res (buffer, buffer+res_len );
181
+ std::vector<int > res (buffer, buffer+bytes_encoded );
182
182
183
- REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<uint8_t >{
183
+ REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<int >{
184
184
0xda , 0x00 , 0x01 , 0x02 , 0x00 , 0x84 , 0x50 , 0x00 ,
185
185
0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 ,
186
186
0x09 , 0x0a , 0x0b , 0x0c , 0x0d , 0x0e , 0x0f , 0xe1 ,
@@ -202,18 +202,14 @@ SCENARIO("Test the encoding of command messages") {
202
202
// CBORMessageEncoder encoder;
203
203
Encoder::Status err = CBORMessageEncoder.encode ((Message*)&command, buffer, bytes_encoded);
204
204
205
- uint8_t expected_result[] = {
206
- 0xda , 0x00 , 0x01 , 0x08 , 0x00 , 0x80
207
- };
208
-
209
205
// Test the encoding is
210
206
// DA 00010800 # tag(67584)
211
207
// 80 # array(0)
212
208
THEN (" The encoding is successful" ) {
213
209
REQUIRE (err == Encoder::Status::Complete);
214
- std::vector<uint8_t > res (buffer, buffer+res_len );
210
+ std::vector<int > res (buffer, buffer+bytes_encoded );
215
211
216
- REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<uint8_t >{
212
+ REQUIRE_THAT (res, Catch::Matchers::Equals (std::vector<int >{
217
213
0xda , 0x00 , 0x01 , 0x08 , 0x00 , 0x80
218
214
}));
219
215
}
0 commit comments