diff options
author | Vladimir Sementsov-Ogievskiy | 2021-05-06 11:06:20 +0200 |
---|---|---|
committer | Max Reitz | 2021-05-14 16:14:10 +0200 |
commit | 23357b93c7bbeec65aef75f798cacbcda0ca5f4d (patch) | |
tree | 593ef0f37ebf4e2ea67b3eb5efab2ccedeead0fe /tests | |
parent | test-write-threshold: drop extra tests (diff) | |
download | qemu-23357b93c7bbeec65aef75f798cacbcda0ca5f4d.tar.gz qemu-23357b93c7bbeec65aef75f798cacbcda0ca5f4d.tar.xz qemu-23357b93c7bbeec65aef75f798cacbcda0ca5f4d.zip |
test-write-threshold: drop extra TestStruct structure
We don't need this extra logic: it doesn't make code simpler.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210506090621.11848-8-vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test-write-threshold.c | 20 |
1 files 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(); } |