From 9cd2ec292474f2f1ed8ce013907e4ad5fd1d909c Mon Sep 17 00:00:00 2001 From: Thomas Guillem <thomas@gllm.fr> Date: Fri, 10 May 2019 10:33:19 +0200 Subject: [PATCH] test: player: test a playback without any outputs --- test/src/input/player.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/src/input/player.c b/test/src/input/player.c index b70542403a54..91b2bdd47449 100644 --- a/test/src/input/player.c +++ b/test/src/input/player.c @@ -1690,9 +1690,32 @@ test_delete_while_playback(vlc_object_t *obj, bool start) vlc_player_Delete(player); } +static void +test_no_outputs(struct ctx *ctx) +{ + test_log("test_no_outputs\n"); + vlc_player_t *player = ctx->player; + + struct media_params params = DEFAULT_MEDIA_PARAMS(VLC_TICK_FROM_MS(10)); + player_set_current_mock_media(ctx, "media1", ¶ms, false); + player_start(ctx); + + wait_state(ctx, VLC_PLAYER_STATE_STOPPING); + { + vec_on_vout_changed *vec = &ctx->report.on_vout_changed; + assert(vec->size == 0); + } + + audio_output_t *aout = vlc_player_aout_Hold(player); + assert(!aout); + + test_end(ctx); +} + static void test_outputs(struct ctx *ctx) { + test_log("test_outputs\n"); vlc_player_t *player = ctx->player; /* Test that the player has a valid aout and vout, even before first @@ -1809,6 +1832,11 @@ main(void) struct ctx ctx; + /* Test with --aout=none --vout=none */ + ctx_init(&ctx, false); + test_no_outputs(&ctx); + ctx_destroy(&ctx); + ctx_init(&ctx, true); test_outputs(&ctx); /* Must be the first test */ -- GitLab