From e26612d32bffa87f4eea670590f0b5eeb1ac29cf Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Fri, 3 Jul 2020 15:57:59 +0200 Subject: [PATCH] unittest_cdc: fix test on big-endian hosts The specific_result test hardcodes a particular output. However, the input buffer used by the test is currently initialized to a different byte string depending host the host byte order, which makes the expected result not match on big-endian hosts. Fixed by always initializing the input buffer to the same string. Signed-off-by: Ulrich Weigand --- src/test/common/test_cdc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/common/test_cdc.cc b/src/test/common/test_cdc.cc index c8754261f408a..32096b2a285e0 100644 --- a/src/test/common/test_cdc.cc +++ b/src/test/common/test_cdc.cc @@ -27,7 +27,7 @@ void generate_buffer(int size, bufferlist *outbl, int seed = 0) p.set_length(l); char *b = p.c_str(); for (size_t i = 0; i < l / sizeof(uint64_t); ++i) { - ((uint64_t*)b)[i] = engine(); + ((ceph_le64 *)b)[i] = init_le64(engine()); } outbl->append(p); } -- 2.39.5