| 7 | #include <libsocket/framing.hpp> |
| 8 | |
| 9 | int main(void) { |
| 10 | char dest[4]; |
| 11 | memset(dest, 0, 4); |
| 12 | uint32_t number = (1 << 30) + 123; |
| 13 | uint32_t decoded; |
| 14 | |
| 15 | libsocket::encode_uint32(number, dest); |
| 16 | |
| 17 | if (number != (decoded = libsocket::decode_uint32(dest))) { |
| 18 | std::cout << "Failure: " << number << " " << decoded << std::endl; |
| 19 | |
| 20 | for (int i = 0; i < 4; i++) { |
| 21 | printf("%02hhx", dest[i]); |
| 22 | } |
| 23 | printf("\n"); |
| 24 | printf("%x\n", decoded); |
| 25 | } |
| 26 | |
| 27 | return 0; |
| 28 | } |
nothing calls this directly
no test coverage detected