From e3988dbbbdda9939d46b6c155b8955f8da232bc7 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 15 Jul 2015 21:46:04 -0700 Subject: [PATCH] Added more tests for GPR_BITCOUNT --- test/core/support/useful_test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/core/support/useful_test.c b/test/core/support/useful_test.c index 34f4ce6870a..cbf4f02e267 100644 --- a/test/core/support/useful_test.c +++ b/test/core/support/useful_test.c @@ -56,6 +56,10 @@ int main(int argc, char **argv) { GPR_ASSERT(GPR_ARRAY_SIZE(four) == 4); GPR_ASSERT(GPR_ARRAY_SIZE(five) == 5); + GPR_ASSERT(GPR_BITCOUNT((1u << 31) - 1) == 31); + GPR_ASSERT(GPR_BITCOUNT(1u << 3) == 1); + GPR_ASSERT(GPR_BITCOUNT(0) == 0); + GPR_ASSERT(GPR_BITSET(&bitset, 3) == 8); GPR_ASSERT(GPR_BITCOUNT(bitset) == 1); GPR_ASSERT(GPR_BITGET(bitset, 3) == 1);