summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/test_tw_timer.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-12-13 21:47:40 +0100
committerDave Barach <openvpp@barachs.net>2020-12-14 12:14:21 +0000
commitb2c31b685fd2cf28436ca32bc93e23eb24c74878 (patch)
treedc0a1b1ff784445b2cbb0f9b2c07b5bcb4f5a5d0 /src/vppinfra/test_tw_timer.c
parent62c25abaa3e93be5815172d391295a6ab0390122 (diff)
misc: move to new pool_foreach macros
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/test_tw_timer.c')
-rw-r--r--src/vppinfra/test_tw_timer.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/vppinfra/test_tw_timer.c b/src/vppinfra/test_tw_timer.c
index 499cc017ba1..47e5e49bf1f 100644
--- a/src/vppinfra/test_tw_timer.c
+++ b/src/vppinfra/test_tw_timer.c
@@ -317,13 +317,13 @@ test2_single (tw_timer_test_main_t * tm)
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_2t_1w_2048sl (&tm->single_wheel, e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
@@ -375,12 +375,12 @@ test2_single (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -456,13 +456,13 @@ test2_double (tw_timer_test_main_t * tm)
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_16t_2w_512sl (&tm->double_wheel, e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
@@ -513,12 +513,12 @@ test2_double (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -591,8 +591,8 @@ test2_double_updates (tw_timer_test_main_t * tm)
j = 0;
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
expiration_time = get_expiration_time (tm);
max_expiration_time = clib_max (expiration_time, max_expiration_time);
e->expected_to_expire = expiration_time
@@ -601,7 +601,7 @@ test2_double_updates (tw_timer_test_main_t * tm)
expiration_time);
if (++j >= tm->ntimers / 4)
goto done;
- }));
+ }
/* *INDENT-ON* */
done:
@@ -624,12 +624,12 @@ test2_double_updates (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -707,13 +707,13 @@ test2_triple (tw_timer_test_main_t * tm)
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_4t_3w_256sl (&tm->triple_wheel, e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
@@ -764,12 +764,12 @@ test2_triple (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -847,14 +847,14 @@ test2_triple_ov (tw_timer_test_main_t * tm)
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_1t_3w_1024sl_ov (&tm->triple_ov_wheel,
e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
@@ -905,8 +905,8 @@ test2_triple_ov (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
TWT (tw_timer) * t;
fformat (stdout, "[%d] expected to expire %d\n",
@@ -914,7 +914,7 @@ test2_triple_ov (tw_timer_test_main_t * tm)
e->expected_to_expire);
t = pool_elt_at_index (tm->triple_ov_wheel.timers, e->stop_timer_handle);
fformat (stdout, " expiration_time %lld\n", t->expiration_time);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -973,12 +973,12 @@ test1_single (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat(stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
fformat (stdout,
@@ -1031,12 +1031,12 @@ test1_double (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat(stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
fformat (stdout,
@@ -1089,12 +1089,12 @@ test1_two_timer_double (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat(stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
fformat (stdout,
@@ -1169,12 +1169,12 @@ test3_triple_double (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -1253,12 +1253,12 @@ test4_double_double (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
@@ -1337,12 +1337,12 @@ test5_double (tw_timer_test_main_t * tm)
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);