aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/support/useful_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/support/useful_test.c')
-rw-r--r--test/core/support/useful_test.c54
1 files changed, 28 insertions, 26 deletions
diff --git a/test/core/support/useful_test.c b/test/core/support/useful_test.c
index cbf4f02e26..49a1bd353e 100644
--- a/test/core/support/useful_test.c
+++ b/test/core/support/useful_test.c
@@ -36,38 +36,40 @@
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
-int main(int argc, char **argv) {
+int
+main (int argc, char **argv)
+{
int four[4];
int five[5];
gpr_uint32 bitset = 0;
- grpc_test_init(argc, argv);
+ grpc_test_init (argc, argv);
- GPR_ASSERT(GPR_MIN(1, 2) == 1);
- GPR_ASSERT(GPR_MAX(1, 2) == 2);
- GPR_ASSERT(GPR_MIN(2, 1) == 1);
- GPR_ASSERT(GPR_MAX(2, 1) == 2);
- GPR_ASSERT(GPR_CLAMP(1, 0, 2) == 1);
- GPR_ASSERT(GPR_CLAMP(0, 0, 2) == 0);
- GPR_ASSERT(GPR_CLAMP(2, 0, 2) == 2);
- GPR_ASSERT(GPR_CLAMP(-1, 0, 2) == 0);
- GPR_ASSERT(GPR_CLAMP(3, 0, 2) == 2);
- GPR_ASSERT(GPR_ROTL((gpr_uint32)0x80000001, 1) == 3);
- GPR_ASSERT(GPR_ROTR((gpr_uint32)0x80000001, 1) == 0xc0000000);
- GPR_ASSERT(GPR_ARRAY_SIZE(four) == 4);
- GPR_ASSERT(GPR_ARRAY_SIZE(five) == 5);
+ GPR_ASSERT (GPR_MIN (1, 2) == 1);
+ GPR_ASSERT (GPR_MAX (1, 2) == 2);
+ GPR_ASSERT (GPR_MIN (2, 1) == 1);
+ GPR_ASSERT (GPR_MAX (2, 1) == 2);
+ GPR_ASSERT (GPR_CLAMP (1, 0, 2) == 1);
+ GPR_ASSERT (GPR_CLAMP (0, 0, 2) == 0);
+ GPR_ASSERT (GPR_CLAMP (2, 0, 2) == 2);
+ GPR_ASSERT (GPR_CLAMP (-1, 0, 2) == 0);
+ GPR_ASSERT (GPR_CLAMP (3, 0, 2) == 2);
+ GPR_ASSERT (GPR_ROTL ((gpr_uint32) 0x80000001, 1) == 3);
+ GPR_ASSERT (GPR_ROTR ((gpr_uint32) 0x80000001, 1) == 0xc0000000);
+ 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_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);
- GPR_ASSERT(GPR_BITSET(&bitset, 1) == 10);
- GPR_ASSERT(GPR_BITCOUNT(bitset) == 2);
- GPR_ASSERT(GPR_BITCLEAR(&bitset, 3) == 2);
- GPR_ASSERT(GPR_BITCOUNT(bitset) == 1);
- GPR_ASSERT(GPR_BITGET(bitset, 3) == 0);
+ GPR_ASSERT (GPR_BITSET (&bitset, 3) == 8);
+ GPR_ASSERT (GPR_BITCOUNT (bitset) == 1);
+ GPR_ASSERT (GPR_BITGET (bitset, 3) == 1);
+ GPR_ASSERT (GPR_BITSET (&bitset, 1) == 10);
+ GPR_ASSERT (GPR_BITCOUNT (bitset) == 2);
+ GPR_ASSERT (GPR_BITCLEAR (&bitset, 3) == 2);
+ GPR_ASSERT (GPR_BITCOUNT (bitset) == 1);
+ GPR_ASSERT (GPR_BITGET (bitset, 3) == 0);
return 0;
}