Skip to content

Commit 13dda3d

Browse files
committed
Adjusting test code for changed signature of CBOREncoder::encode
1 parent 8a38a4c commit 13dda3d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

extras/test/src/util/CBORTestUtil.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ namespace cbor
2525
**************************************************************************************/
2626

2727
std::vector<uint8_t> encode(PropertyContainer & property_container, bool lightPayload) {
28+
int bytes_encoded = 0;
2829
uint8_t buf[200] = {0};
29-
int const bytes_buf = CBOREncoder::encode(property_container, buf, 200, lightPayload);
30-
if (bytes_buf == -1) {
30+
31+
if (CBOREncoder::encode(property_container, buf, 200, bytes_encoded, lightPayload) == CborNoError)
32+
return std::vector<uint8_t>(buf, buf + bytes_encoded);
33+
else
3134
return std::vector<uint8_t>();
32-
} else {
33-
return std::vector<uint8_t>(buf, buf + bytes_buf);
34-
}
3535
}
3636

3737
void print(std::vector<uint8_t> const & vect) {

0 commit comments

Comments
 (0)