Skip to content

Commit

Permalink
test-throttle: use enum ThrottleDirection
Browse files Browse the repository at this point in the history
Use enum ThrottleDirection instead in the throttle test codes.

Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20230728022006.1098509-3-pizhenwei@bytedance.com>
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
  • Loading branch information
pizhenwei authored and XanClic committed Aug 29, 2023
1 parent 8ba02c2 commit 1322f63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ static void test_init(void)

/* check initialized fields */
g_assert(tt->clock_type == QEMU_CLOCK_VIRTUAL);
g_assert(tt->timers[0]);
g_assert(tt->timers[1]);
g_assert(tt->timers[THROTTLE_READ]);
g_assert(tt->timers[THROTTLE_WRITE]);

/* check other fields where cleared */
g_assert(!ts.previous_leak);
Expand All @@ -191,7 +191,7 @@ static void test_destroy(void)
throttle_timers_init(tt, ctx, QEMU_CLOCK_VIRTUAL,
read_timer_cb, write_timer_cb, &ts);
throttle_timers_destroy(tt);
for (i = 0; i < 2; i++) {
for (i = 0; i < THROTTLE_MAX; i++) {
g_assert(!tt->timers[i]);
}
}
Expand Down

0 comments on commit 1322f63

Please sign in to comment.