[vlc-devel] [PATCH 6/6] test: player: test a playback withoyt any outputs

Thomas Guillem thomas at gllm.fr
Fri May 10 11:06:03 CEST 2019


---
 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 f9005a8e3e..08569f676e 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", &params, 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 */
-- 
2.20.1



More information about the vlc-devel mailing list