]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_cdc: fix test on big-endian hosts 35921/head
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 3 Jul 2020 13:57:59 +0000 (15:57 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 3 Jul 2020 13:57:59 +0000 (15:57 +0200)
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 <ulrich.weigand@de.ibm.com>
src/test/common/test_cdc.cc

index c8754261f408afb28da086740dc0c79b783154b1..32096b2a285e02dadb25e3a1b5cf128a5cdf8dfc 100644 (file)
@@ -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);
   }