From f7fdfbe7defb45d8d21781b5e7d19691609c08a5 Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Tue, 3 Jan 2012 16:41:55 +1000 Subject: Remove a random instantiation of a backend. Not appropriate for a unit test. Change-Id: I7b05bb8aa067382b34e30d0602809c9fe56b27ef Reviewed-by: Ling Hu --- tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/auto/unit') diff --git a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp index b902d3cfb..00d866edb 100644 --- a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp +++ b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp @@ -949,13 +949,15 @@ void tst_QMediaPlayer::testPlayerFlags() void tst_QMediaPlayer::testDestructor() { /* create an object for player */ - QMediaPlayer *player = new QMediaPlayer; + MockMediaPlayerService service; + MockMediaServiceProvider provider(&service); + QMediaPlayer *victim = new QMediaPlayer(0, 0, &provider); /* check whether the object is created */ - QVERIFY(player); + QVERIFY(victim); - /* delete the instance */ - delete player; + /* delete the instance (a crash is a failure :) */ + delete victim; } void tst_QMediaPlayer::testNetworkAccess() -- cgit v1.2.3