|
|
@ -97,7 +97,7 @@ static void test_table_with_int_key(void) { |
|
|
|
for (i = 0; i < 20; ++i) { |
|
|
|
for (i = 0; i < 20; ++i) { |
|
|
|
census_ht_key key; |
|
|
|
census_ht_key key; |
|
|
|
key.val = i; |
|
|
|
key.val = i; |
|
|
|
census_ht_insert(ht, key, (void*)i); |
|
|
|
census_ht_insert(ht, key, (void*)(gpr_intptr)i); |
|
|
|
GPR_ASSERT(census_ht_get_size(ht) == i + 1); |
|
|
|
GPR_ASSERT(census_ht_get_size(ht) == i + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
for (i = 0; i < 20; i++) { |
|
|
|
for (i = 0; i < 20; i++) { |
|
|
@ -105,7 +105,7 @@ static void test_table_with_int_key(void) { |
|
|
|
census_ht_key key; |
|
|
|
census_ht_key key; |
|
|
|
key.val = i; |
|
|
|
key.val = i; |
|
|
|
val = census_ht_find(ht, key); |
|
|
|
val = census_ht_find(ht, key); |
|
|
|
GPR_ASSERT(val == (void*)i); |
|
|
|
GPR_ASSERT(val == (void*)(gpr_intptr)i); |
|
|
|
} |
|
|
|
} |
|
|
|
elements = census_ht_get_all_elements(ht, &num_elements); |
|
|
|
elements = census_ht_get_all_elements(ht, &num_elements); |
|
|
|
GPR_ASSERT(elements != NULL); |
|
|
|
GPR_ASSERT(elements != NULL); |
|
|
|