| 26 | } |
| 27 | |
| 28 | void cbor_example() |
| 29 | { |
| 30 | std::bitset<8> bs1(42); |
| 31 | |
| 32 | std::vector<uint8_t> data; |
| 33 | cbor::encode_cbor(bs1, data); |
| 34 | std::cout << byte_string_view(data) << "\n\n"; |
| 35 | /* |
| 36 | 0xd7, // Expected conversion to base16 |
| 37 | 0x41, // Byte string value of length 1 |
| 38 | 0x54 |
| 39 | */ |
| 40 | |
| 41 | auto bs2 = cbor::decode_cbor<std::bitset<8>>(data); |
| 42 | |
| 43 | assert(bs2 == bs1); |
| 44 | } |
| 45 | |
| 46 | int main() |
| 47 | { |
no test coverage detected