test-bus-marshal: use cescaping instead of hexmem

It is easier to see the contents this way by eye.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-07-07 19:08:52 +02:00
parent c74a3f973e
commit 3ddf3d4394

View file

@ -18,8 +18,8 @@
#include "bus-label.h" #include "bus-label.h"
#include "bus-message.h" #include "bus-message.h"
#include "bus-util.h" #include "bus-util.h"
#include "escape.h"
#include "fd-util.h" #include "fd-util.h"
#include "hexdecoct.h"
#include "log.h" #include "log.h"
#include "tests.h" #include "tests.h"
#include "util.h" #include "util.h"
@ -111,7 +111,7 @@ int main(int argc, char *argv[]) {
uint8_t u, v; uint8_t u, v;
void *buffer = NULL; void *buffer = NULL;
size_t sz; size_t sz;
char *h; _cleanup_free_ char *h = NULL;
const int32_t integer_array[] = { -1, -2, 0, 1, 2 }, *return_array; const int32_t integer_array[] = { -1, -2, 0, 1, 2 }, *return_array;
char *s; char *s;
_cleanup_free_ char *first = NULL, *second = NULL, *third = NULL; _cleanup_free_ char *first = NULL, *second = NULL, *third = NULL;
@ -197,11 +197,9 @@ int main(int argc, char *argv[]) {
r = bus_message_get_blob(m, &buffer, &sz); r = bus_message_get_blob(m, &buffer, &sz);
assert_se(r >= 0); assert_se(r >= 0);
h = hexmem(buffer, sz); h = cescape_length(buffer, sz);
assert_se(h); assert_se(h);
log_info("message size = %zu, contents =\n%s", sz, h); log_info("message size = %zu, contents =\n%s", sz, h);
free(h);
#if HAVE_GLIB #if HAVE_GLIB
#ifndef __SANITIZE_ADDRESS__ #ifndef __SANITIZE_ADDRESS__