app/tsrc/unittest_mpmtpinfolink/src/unittest_mpmtpinfolink.cpp
changeset 43 0f32e550d9d8
parent 37 eb79a7c355bf
equal deleted inserted replaced
38:b93f525c9244 43:0f32e550d9d8
    14 * Description: Unit test for MpMtpInfoLink
    14 * Description: Unit test for MpMtpInfoLink
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <QGraphicsSceneMouseEvent>
    18 #include <QGraphicsSceneMouseEvent>
       
    19 #include <QTranslator>
       
    20 #include <QLocale>
    19 
    21 
    20 #include "stub/inc/hblabel.h"
    22 #include "stub/inc/hblabel.h"
    21 #include "stub/inc/qdesktopservices.h"
    23 #include "stub/inc/qdesktopservices.h"
    22 #include "stub/inc/mpsettingsmanager.h"
    24 #include "stub/inc/mpsettingsmanager.h"
    23 #include "unittest_mpmtpinfolink.h"
    25 #include "unittest_mpmtpinfolink.h"
    53         return QTest::qExec(&tv, 3, pass);
    55         return QTest::qExec(&tv, 3, pass);
    54     }
    56     }
    55 }
    57 }
    56 
    58 
    57 TestMpMtpInfoLink::TestMpMtpInfoLink()
    59 TestMpMtpInfoLink::TestMpMtpInfoLink()
    58     : mTest( 0 )
    60     : mTest(0),
       
    61       mMpTranslator(0)
    59 {
    62 {
    60 }
    63 }
    61 
    64 
    62 TestMpMtpInfoLink::~TestMpMtpInfoLink()
    65 TestMpMtpInfoLink::~TestMpMtpInfoLink()
    63 {
    66 {
    64     delete mTest;
    67     delete mTest;
       
    68     delete mMpTranslator;
    65 }
    69 }
    66 
    70 
    67 /*!
    71 /*!
    68  Called before the first testfunction is executed.
    72  Called before the first testfunction is executed.
    69  */
    73  */
    70 void TestMpMtpInfoLink::initTestCase()
    74 void TestMpMtpInfoLink::initTestCase()
    71 {
    75 {
       
    76     QString lang = QLocale::system().name();
       
    77     QString path = QString("z:/resource/qt/translations/");
       
    78     bool translatorLoaded = false;
       
    79 
       
    80     mMpTranslator = new QTranslator(this);
       
    81     translatorLoaded = mMpTranslator->load(path + "musicplayer_" + lang);
       
    82     if ( translatorLoaded ) {
       
    83         qApp->installTranslator(mMpTranslator);
       
    84     }
    72 }
    85 }
    73 
    86 
    74 /*!
    87 /*!
    75  Called after the last testfunction was executed.
    88  Called after the last testfunction was executed.
    76  */
    89  */