| 42 | const bool ERRORS = true; |
| 43 | |
| 44 | static void decode_message_buffer(pn_rwbytes_t data) { |
| 45 | pn_message_t *m = pn_message(); |
| 46 | int err = pn_message_decode(m, data.start, data.size); |
| 47 | if (!err) { |
| 48 | /* Print the decoded message */ |
| 49 | char *s = pn_tostring(pn_message_body(m)); |
| 50 | if (VERBOSE) { |
| 51 | printf("%s\n", s); |
| 52 | fflush(stdout); |
| 53 | } |
| 54 | free(s); |
| 55 | pn_message_free(m); |
| 56 | free(data.start); |
| 57 | } else { |
| 58 | fprintf(stderr, "decode error: %s\n", pn_error_text(pn_message_error(m))); |
| 59 | exit(EXIT_FAILURE); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | static void BM_EncodeListMessage(benchmark::State &state) { |
| 64 | if (VERBOSE) |
nothing calls this directly
no test coverage detected