MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / check_encode_cbor

Function check_encode_cbor

test/cbor/src/encode_cbor_tests.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17// MIT license
18
19void check_encode_cbor(const std::vector<uint8_t>& expected, const json& j)
20{
21 std::vector<uint8_t> result;
22 cbor::encode_cbor(j,result);
23
24 if (result.size() != expected.size())
25 {
26 std::cout << j << "\n";
27 }
28 REQUIRE(result.size() == expected.size());
29 for (std::size_t i = 0; i < expected.size(); ++i)
30 {
31 REQUIRE(result[i] == expected[i]);
32 }
33}
34
35TEST_CASE("cbor_encoder_test")
36{

Callers 1

Calls 2

encode_cborFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected