From: Ulrich Weigand Date: Fri, 3 Jul 2020 13:57:59 +0000 (+0200) Subject: unittest_cdc: fix test on big-endian hosts X-Git-Tag: v16.1.0~1837^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e26612d32bffa87f4eea670590f0b5eeb1ac29cf;p=ceph.git 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 --- diff --git a/src/test/common/test_cdc.cc b/src/test/common/test_cdc.cc index c8754261f408..32096b2a285e 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); }