diff options
author | David Garcia Quintas <dgq@google.com> | 2015-07-15 21:46:04 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-07-15 21:46:04 -0700 |
commit | e3988dbbbdda9939d46b6c155b8955f8da232bc7 (patch) | |
tree | b748a61474d613fda2f742d7761fa50997407bb2 | |
parent | 6b8d1aef89ecb24c08f2f4b19903abc2383ca7eb (diff) |
Added more tests for GPR_BITCOUNT
-rw-r--r-- | test/core/support/useful_test.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/core/support/useful_test.c b/test/core/support/useful_test.c index 34f4ce6870..cbf4f02e26 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); |