]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/test_intarith: adapt to the change in intarith.h
authorKefu Chai <kchai@redhat.com>
Tue, 27 Jul 2021 06:24:18 +0000 (14:24 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 27 Jul 2021 12:03:32 +0000 (20:03 +0800)
commit943b91a11bb1b6e9409d865f1ec6bfc3c3ae87a0
treed8db1d0b93652ee779839604f1e7593090d09535
parent49bd620f7506659ccf4fff3cda730b2febf657b7
test/test_intarith: adapt to the change in intarith.h

back in 2623fec1cdd5fd9b15ee67c4b115385c67129ef4, the vaiants of, for
instance, ctz() are consolidated to a single template. so the
ctz<>() dispatches by the size of argument after that change.
but the tests were not updated accordingly.

in this change:

* the tests are updated to use the template.
* instead of using integer literal postfix, use the macros like
  UINT64_C to define integer constants for better portability on
  different architectures where the lengths of integer *might* be
  different from amd64. also, it's more readable than postfixes
  like ULL in this context, as we really care about the exact
  length of an integer in this context when counting the leading
  zeros.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/test_intarith.cc