aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/statistics
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/statistics')
-rw-r--r--test/core/statistics/census_log_tests.cc (renamed from test/core/statistics/census_log_tests.c)0
-rw-r--r--test/core/statistics/census_stub_test.cc (renamed from test/core/statistics/census_stub_test.c)0
-rw-r--r--test/core/statistics/hash_table_test.cc (renamed from test/core/statistics/hash_table_test.c)18
-rw-r--r--test/core/statistics/multiple_writers_circular_buffer_test.cc (renamed from test/core/statistics/multiple_writers_circular_buffer_test.c)0
-rw-r--r--test/core/statistics/multiple_writers_test.cc (renamed from test/core/statistics/multiple_writers_test.c)0
-rw-r--r--test/core/statistics/performance_test.cc (renamed from test/core/statistics/performance_test.c)0
-rw-r--r--test/core/statistics/quick_test.cc (renamed from test/core/statistics/quick_test.c)0
-rw-r--r--test/core/statistics/rpc_stats_test.cc (renamed from test/core/statistics/rpc_stats_test.c)0
-rw-r--r--test/core/statistics/small_log_test.cc (renamed from test/core/statistics/small_log_test.c)0
-rw-r--r--test/core/statistics/trace_test.cc (renamed from test/core/statistics/trace_test.c)0
-rw-r--r--test/core/statistics/window_stats_test.cc (renamed from test/core/statistics/window_stats_test.c)25
11 files changed, 22 insertions, 21 deletions
diff --git a/test/core/statistics/census_log_tests.c b/test/core/statistics/census_log_tests.cc
index e6eda5486c..e6eda5486c 100644
--- a/test/core/statistics/census_log_tests.c
+++ b/test/core/statistics/census_log_tests.cc
diff --git a/test/core/statistics/census_stub_test.c b/test/core/statistics/census_stub_test.cc
index 507ae0a9fa..507ae0a9fa 100644
--- a/test/core/statistics/census_stub_test.c
+++ b/test/core/statistics/census_stub_test.cc
diff --git a/test/core/statistics/hash_table_test.c b/test/core/statistics/hash_table_test.cc
index 0f6147a095..b660006b8a 100644
--- a/test/core/statistics/hash_table_test.c
+++ b/test/core/statistics/hash_table_test.cc
@@ -89,7 +89,7 @@ static void test_table_with_int_key(void) {
uint64_t* val = NULL;
census_ht_key key;
key.val = i;
- val = census_ht_find(ht, key);
+ val = static_cast<uint64_t*>(census_ht_find(ht, key));
GPR_ASSERT(val == (void*)(intptr_t)i);
}
elements = census_ht_get_all_elements(ht, &num_elements);
@@ -112,22 +112,22 @@ static void test_value_and_key_deleter(void) {
char* val = NULL;
char* val2 = NULL;
key.ptr = gpr_malloc(100);
- val = gpr_malloc(10);
+ val = static_cast<char*>(gpr_malloc(10));
strcpy(val, "value");
strcpy(key.ptr, "some string as a key");
GPR_ASSERT(ht != NULL);
GPR_ASSERT(census_ht_get_size(ht) == 0);
census_ht_insert(ht, key, val);
GPR_ASSERT(census_ht_get_size(ht) == 1);
- val = census_ht_find(ht, key);
+ val = static_cast<char*>(census_ht_find(ht, key));
GPR_ASSERT(val != NULL);
GPR_ASSERT(strcmp(val, "value") == 0);
/* Insert same key different value, old value is overwritten. */
- val2 = gpr_malloc(10);
+ val2 = static_cast<char*>(gpr_malloc(10));
strcpy(val2, "v2");
census_ht_insert(ht, key, val2);
GPR_ASSERT(census_ht_get_size(ht) == 1);
- val2 = census_ht_find(ht, key);
+ val2 = static_cast<char*>(census_ht_find(ht, key));
GPR_ASSERT(val2 != NULL);
GPR_ASSERT(strcmp(val2, "v2") == 0);
census_ht_destroy(ht);
@@ -214,7 +214,7 @@ static void test_table_with_string_key(void) {
census_ht_key key;
int* val_ptr;
key.ptr = (void*)(keys[i]);
- val_ptr = census_ht_find(ht, key);
+ val_ptr = static_cast<int*>(census_ht_find(ht, key));
GPR_ASSERT(*val_ptr == vals[i]);
}
{
@@ -225,7 +225,7 @@ static void test_table_with_string_key(void) {
census_ht_insert(ht, key, (void*)(vals + 8));
/* expect value to be over written by new insertion */
GPR_ASSERT(census_ht_get_size(ht) == 9);
- val_ptr = census_ht_find(ht, key);
+ val_ptr = static_cast<int*>(census_ht_find(ht, key));
GPR_ASSERT(*val_ptr == vals[8]);
}
for (i = 0; i < 9; i++) {
@@ -234,11 +234,11 @@ static void test_table_with_string_key(void) {
uint32_t expected_tbl_sz = 9 - i;
GPR_ASSERT(census_ht_get_size(ht) == expected_tbl_sz);
key.ptr = (void*)(keys[i]);
- val_ptr = census_ht_find(ht, key);
+ val_ptr = static_cast<int*>(census_ht_find(ht, key));
GPR_ASSERT(val_ptr != NULL);
census_ht_erase(ht, key);
GPR_ASSERT(census_ht_get_size(ht) == expected_tbl_sz - 1);
- val_ptr = census_ht_find(ht, key);
+ val_ptr = static_cast<int*>(census_ht_find(ht, key));
GPR_ASSERT(val_ptr == NULL);
}
census_ht_destroy(ht);
diff --git a/test/core/statistics/multiple_writers_circular_buffer_test.c b/test/core/statistics/multiple_writers_circular_buffer_test.cc
index 6d3411289e..6d3411289e 100644
--- a/test/core/statistics/multiple_writers_circular_buffer_test.c
+++ b/test/core/statistics/multiple_writers_circular_buffer_test.cc
diff --git a/test/core/statistics/multiple_writers_test.c b/test/core/statistics/multiple_writers_test.cc
index 47410ab105..47410ab105 100644
--- a/test/core/statistics/multiple_writers_test.c
+++ b/test/core/statistics/multiple_writers_test.cc
diff --git a/test/core/statistics/performance_test.c b/test/core/statistics/performance_test.cc
index 9d4fd6ef90..9d4fd6ef90 100644
--- a/test/core/statistics/performance_test.c
+++ b/test/core/statistics/performance_test.cc
diff --git a/test/core/statistics/quick_test.c b/test/core/statistics/quick_test.cc
index 91ecdde818..91ecdde818 100644
--- a/test/core/statistics/quick_test.c
+++ b/test/core/statistics/quick_test.cc
diff --git a/test/core/statistics/rpc_stats_test.c b/test/core/statistics/rpc_stats_test.cc
index aead5cfdca..aead5cfdca 100644
--- a/test/core/statistics/rpc_stats_test.c
+++ b/test/core/statistics/rpc_stats_test.cc
diff --git a/test/core/statistics/small_log_test.c b/test/core/statistics/small_log_test.cc
index fb8dfc9988..fb8dfc9988 100644
--- a/test/core/statistics/small_log_test.c
+++ b/test/core/statistics/small_log_test.cc
diff --git a/test/core/statistics/trace_test.c b/test/core/statistics/trace_test.cc
index ecbfed09ee..ecbfed09ee 100644
--- a/test/core/statistics/trace_test.c
+++ b/test/core/statistics/trace_test.cc
diff --git a/test/core/statistics/window_stats_test.c b/test/core/statistics/window_stats_test.cc
index 457004bbd0..b17c61a47b 100644
--- a/test/core/statistics/window_stats_test.c
+++ b/test/core/statistics/window_stats_test.cc
@@ -44,11 +44,11 @@ void add_proportion_test_stat(double p, void* base, const void* addme) {
const struct census_window_stats_stat_info kMyStatInfo = {
sizeof(test_stat), NULL, add_test_stat, add_proportion_test_stat};
-const gpr_timespec kMilliSecInterval = {0, 1000000};
-const gpr_timespec kSecInterval = {1, 0};
-const gpr_timespec kMinInterval = {60, 0};
-const gpr_timespec kHourInterval = {3600, 0};
-const gpr_timespec kPrimeInterval = {0, 101};
+const gpr_timespec kMilliSecInterval = {0, 1000000, GPR_CLOCK_MONOTONIC};
+const gpr_timespec kSecInterval = {1, 0, GPR_CLOCK_MONOTONIC};
+const gpr_timespec kMinInterval = {60, 0 GPR_CLOCK_MONOTONIC};
+const gpr_timespec kHourInterval = {3600, 0, GPR_CLOCK_MONOTONIC};
+const gpr_timespec kPrimeInterval = {0, 101, GPR_CLOCK_MONOTONIC};
static int compare_double(double a, double b, double epsilon) {
if (a >= b) {
@@ -60,7 +60,7 @@ static int compare_double(double a, double b, double epsilon) {
void empty_test(void) {
census_window_stats_sums result;
- const gpr_timespec zero = {0, 0};
+ const gpr_timespec zero = {0, 0, GPR_CLOCK_MONOTONIC};
test_stat sum;
struct census_window_stats* stats =
census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
@@ -76,7 +76,7 @@ void empty_test(void) {
void one_interval_test(void) {
const test_stat value = {0.1, 4};
const double epsilon = 1e10 - 11;
- gpr_timespec when = {0, 0};
+ gpr_timespec when = {0, 0, GPR_CLOCK_MONOTONIC};
census_window_stats_sums result;
test_stat sum;
/* granularity == 5 so width of internal windows should be 12s */
@@ -186,7 +186,7 @@ void many_interval_test(void) {
gpr_timespec intervals[4];
const test_stat value = {123.45, 8};
const double epsilon = 1e10 - 11;
- gpr_timespec when = {3600, 0}; /* one hour */
+ gpr_timespec when = {3600, 0, GPR_CLOCK_MONOTONIC}; /* one hour */
census_window_stats_sums result[4];
test_stat sums[4];
int i;
@@ -245,11 +245,11 @@ void many_interval_test(void) {
void rolling_time_test(void) {
const test_stat value = {0.1, 4};
- gpr_timespec when = {0, 0};
+ gpr_timespec when = {0, 0, GPR_CLOCK_MONOTONIC};
census_window_stats_sums result;
test_stat sum;
int i;
- gpr_timespec increment = {0, 0};
+ gpr_timespec increment = {0, 0, GPR_CLOCK_MONOTONIC};
struct census_window_stats* stats =
census_window_stats_create(1, &kMinInterval, 7, &kMyStatInfo);
GPR_ASSERT(stats != NULL);
@@ -270,12 +270,13 @@ void rolling_time_test(void) {
#include <stdio.h>
void infinite_interval_test(void) {
const test_stat value = {0.1, 4};
- gpr_timespec when = {0, 0};
+ gpr_timespec when = {0, 0, GPR_CLOCK_MONOTONIC};
census_window_stats_sums result;
test_stat sum;
int i;
const int count = 100000;
- gpr_timespec increment = {0, 0};
+ gpr_timespec increment = {0, 0, GPR_CLOCK_MONOTONIC};
+ gpr_timespec temp = gpr_inf_future(GPR_CLOCK_REALTIME);
struct census_window_stats* stats = census_window_stats_create(
1, &gpr_inf_future(GPR_CLOCK_REALTIME), 10, &kMyStatInfo);
srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);