[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/14] test-throttle: use enum ThrottleDirection
From: |
Hanna Czenczek |
Subject: |
[PULL 02/14] test-throttle: use enum ThrottleDirection |
Date: |
Fri, 1 Sep 2023 10:17:57 +0200 |
From: zhenwei pi <pizhenwei@bytedance.com>
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>
---
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.41.0
- [PULL 00/14] Block patches, Hanna Czenczek, 2023/09/01
- [PULL 02/14] test-throttle: use enum ThrottleDirection,
Hanna Czenczek <=
- [PULL 03/14] throttle: support read-only and write-only, Hanna Czenczek, 2023/09/01
- [PULL 01/14] throttle: introduce enum ThrottleDirection, Hanna Czenczek, 2023/09/01
- [PULL 04/14] test-throttle: test read only and write only, Hanna Czenczek, 2023/09/01
- [PULL 06/14] throttle: use enum ThrottleDirection instead of bool is_write, Hanna Czenczek, 2023/09/01
- [PULL 07/14] throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code, Hanna Czenczek, 2023/09/01
- [PULL 05/14] cryptodev: use NULL throttle timer cb for read direction, Hanna Czenczek, 2023/09/01
- [PULL 08/14] fsdev: Use ThrottleDirection instread of bool is_write, Hanna Czenczek, 2023/09/01
- [PULL 10/14] file-posix: Clear bs->bl.zoned on error, Hanna Czenczek, 2023/09/01
- [PULL 11/14] file-posix: Check bs->bl.zoned for zone info, Hanna Czenczek, 2023/09/01
- [PULL 13/14] file-posix: Simplify raw_co_prw's 'out' zone code, Hanna Czenczek, 2023/09/01