diff options
author | wm4 <wm4@nowhere> | 2019-11-08 14:21:40 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-08 14:21:40 +0100 |
commit | 3ed9c1c9701098db17a2b791f9793e75a1947cc9 (patch) | |
tree | 4a1fb9145ab825c582e1e30fd819522d9aa0f93e /test/index.c | |
parent | 53b7a10f5453083390e65bdab5f1e642c37d89a2 (diff) | |
download | mpv-3ed9c1c9701098db17a2b791f9793e75a1947cc9.tar.bz2 mpv-3ed9c1c9701098db17a2b791f9793e75a1947cc9.tar.xz |
test: just always provide a context for all entrypoints
Diffstat (limited to 'test/index.c')
-rw-r--r-- | test/index.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/index.c b/test/index.c index 64f3f85344..c4ad10888f 100644 --- a/test/index.c +++ b/test/index.c @@ -22,6 +22,11 @@ bool run_tests(struct MPContext *mpctx) return true; } + struct test_ctx ctx = { + .global = mpctx->global, + .log = mpctx->log, + }; + int num_run = 0; for (int n = 0; unittests[n]; n++) { @@ -29,18 +34,15 @@ bool run_tests(struct MPContext *mpctx) // Exactly 1 entrypoint please. assert(MP_IS_POWER_OF_2( - (t->run_simple ? (1 << 0) : 0) | (t->run ? (1 << 1) : 0))); bool run = false; - run |= strcmp(sel, "all-simple") == 0 && !!t->run_simple; + run |= strcmp(sel, "all-simple") == 0 && !t->is_complex; run |= strcmp(sel, t->name); if (run) { - if (t->run_simple) - t->run_simple(); if (t->run) - t->run(mpctx->global, mpctx->log); + t->run(&ctx); num_run++; } } |