[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/9] test-write-threshold: drop extra TestStruct structure
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 7/9] test-write-threshold: drop extra TestStruct structure |
Date: |
Tue, 4 May 2021 11:25:51 +0300 |
We don't need this extra logic: it doesn't make code simpler.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/unit/test-write-threshold.c | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/tests/unit/test-write-threshold.c
b/tests/unit/test-write-threshold.c
index 9e9986aefc..49b1ef7a20 100644
--- a/tests/unit/test-write-threshold.c
+++ b/tests/unit/test-write-threshold.c
@@ -37,26 +37,12 @@ static void test_threshold_trigger(void)
g_assert_cmpuint(bdrv_write_threshold_get(&bs), ==, 0);
}
-typedef struct TestStruct {
- const char *name;
- void (*func)(void);
-} TestStruct;
-
int main(int argc, char **argv)
{
- size_t i;
- TestStruct tests[] = {
- { "/write-threshold/not-trigger",
- test_threshold_not_trigger },
- { "/write-threshold/trigger",
- test_threshold_trigger },
- { NULL, NULL }
- };
-
g_test_init(&argc, &argv, NULL);
- for (i = 0; tests[i].name != NULL; i++) {
- g_test_add_func(tests[i].name, tests[i].func);
- }
+ g_test_add_func("/write-threshold/not-trigger",
test_threshold_not_trigger);
+ g_test_add_func("/write-threshold/trigger", test_threshold_trigger);
+
return g_test_run();
}
--
2.29.2
- Re: [PATCH v2 3/9] test-write-threshold: rewrite test_threshold_(not_)trigger tests, (continued)
- [PATCH v2 4/9] block/write-threshold: drop extra APIs, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PATCH v2 2/9] block: drop write notifiers, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PATCH v2 6/9] test-write-threshold: drop extra tests, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PATCH v2 5/9] block/write-threshold: don't use aio context lock, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PATCH v2 7/9] test-write-threshold: drop extra TestStruct structure,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 8/9] test-write-threshold: drop extra includes, Vladimir Sementsov-Ogievskiy, 2021/05/04
- [PATCH v2 9/9] block/write-threshold: drop extra includes, Vladimir Sementsov-Ogievskiy, 2021/05/04