[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/6] test-throttle: use enum ThrottleType
From: |
zhenwei pi |
Subject: |
[PATCH v3 2/6] test-throttle: use enum ThrottleType |
Date: |
Thu, 13 Jul 2023 14:41:07 +0800 |
Use enum ThrottleType instead in the throttle test codes.
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
tests/unit/test-throttle.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c
index 7adb5e6652..a60b5fe22e 100644
--- a/tests/unit/test-throttle.c
+++ b/tests/unit/test-throttle.c
@@ -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);
@@ -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]);
}
}
--
2.34.1
- [PATCH v3 0/6] Misc fixes for throttle, zhenwei pi, 2023/07/13
- [PATCH v3 2/6] test-throttle: use enum ThrottleType,
zhenwei pi <=
- [PATCH v3 1/6] throttle: introduce enum ThrottleType, zhenwei pi, 2023/07/13
- [PATCH v3 3/6] throttle: support read-only and write-only, zhenwei pi, 2023/07/13
- [PATCH v3 4/6] test-throttle: test read only and write only, zhenwei pi, 2023/07/13
- [PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction, zhenwei pi, 2023/07/13
- [PATCH v3 6/6] throttle: use enum ThrottleType instead of bool is_write, zhenwei pi, 2023/07/13