os/mm/mmlibs/mmfw/tsrc/mmfunittest/srtdecoder/src/testsrtdecoderlanguagefuncs.cpp
First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "srtdecoder.h"
17 #include "srtreader.h"
18 #include "testsrtdecoderlanguagefuncs.h"
20 _LIT( KSampleSubtitleSRTFilepath1, "c:\\mm\\subtitle1.srt" );
22 RTestSrtDecoderStep0100::RTestSrtDecoderStep0100()
24 iTestStepName = _L("MM-MMF-SUBTITLE-SRTDECODER-U-0100-HP");
27 TVerdict RTestSrtDecoderStep0100::DoTestStepPreambleL()
29 InitializeTestStepL(EFalse, KSampleSubtitleSRTFilepath1);
34 TVerdict RTestSrtDecoderStep0100::DoTestStepPostambleL()
36 UnInitializeTestStep();
41 TVerdict RTestSrtDecoderStep0100::DoTestStepL()
43 INFO_PRINTF1(_L("Enter DoTestStepL"));
44 TVerdict result = EPass;
46 result = TestSubtitleLanguage();
49 ERR_PRINTF1(_L("Error - RTestSrtDecoderStep0100::TestGetSubtitleLanguage failed. "));
50 INFO_PRINTF1(_L("Exit DoTestStepL"));
54 result = TestSetSubtitleLanguage();
57 ERR_PRINTF1(_L("Error - RTestSrtDecoderStep0100::TestSetSubtitleLanguage failed. "));
58 INFO_PRINTF1(_L("Exit DoTestStepL"));
62 result = TestGetSupportedSubtitleLanguages();
65 ERR_PRINTF1(_L("Error - RTestSrtDecoderStep0100::TestGetSubtitleLanguageSupport failed. "));
66 INFO_PRINTF1(_L("Exit DoTestStepL"));
70 INFO_PRINTF1(_L("Exit DoTestStepL"));
75 TVerdict RTestSrtDecoderStep0100::TestSubtitleLanguage()
78 TVerdict result = EPass;
80 TRAP(err, iSrtDecoder->SubtitleLanguageL());
81 if (err != KErrNotSupported)
83 ERR_PRINTF2(_L("Error - MSubtitleDecoder::SubtitleLanguageL returned %d. "), err);
90 TVerdict RTestSrtDecoderStep0100::TestSetSubtitleLanguage()
93 TLanguage leng = ELangEnglish;
94 TVerdict result = EPass;
96 TRAP(err, iSrtDecoder->SetSubtitleLanguageL(leng));
97 if (err != KErrNotSupported)
99 ERR_PRINTF2(_L("Error - MSubtitleDecoder::SetSubtitleLanguageL returned %d. "), err);
106 TVerdict RTestSrtDecoderStep0100::TestGetSupportedSubtitleLanguages()
108 TVerdict result = EPass;
110 RArray<TLanguage> data;
112 TRAP(err, iSrtDecoder->GetSupportedSubtitleLanguagesL(data));
113 if (err != KErrNotSupported)
115 ERR_PRINTF2(_L("Error - MSubtitleDecoder::GetSubtitleLanguageSupportL returned %d. "), err);