diff -r 000000000000 -r a41df078684a kerneltest/e32test/locale/t_msgtxt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kerneltest/e32test/locale/t_msgtxt.cpp Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,168 @@ +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// e32test\locale\t_msgtxt.cpp +// Tests the TLocaleMessageText class +// +// + +#include +#include + +LOCAL_D TBuf* localeBufs[ELocaleMessages_LastMsg]; + +RTest test(_L("T_MSGTXT")); + +LOCAL_C void DisplayMessages() +// +// Display the locale messages +// + { + + RNotifier notifier; + TInt r=notifier.Connect(); + test(r==KErrNone); + TRequestStatus status; + TInt buttonVal=0; + + test.Next(_L("Test File Server Error Dialogs")); + TLocaleMessageText msgTxt; + msgTxt.Set(EFileServer_Button1); + TBuf button1(msgTxt); + msgTxt.Set(EFileServer_Button2); + TBuf button2(msgTxt); + + test.Next(_L("DIALOG1: Displayed if a disk is removed during a write")); + User::After(300000); + test.Printf(_L("***Press SHIFT+R or SHIFT+S to confim dialogue***\n")); + TInt count=2; + msgTxt.Set((TLocaleMessage)count++); + TBuf line1=msgTxt; + msgTxt.Set((TLocaleMessage)count++); + TBuf line2=msgTxt; + notifier.Notify(line1,line2,button1,button2,buttonVal,status); + User::WaitForRequest(status); + User::After(300000); + + test.Next(_L("DIALOG2: Write failed due to low power")); + User::After(300000); + msgTxt.Set((TLocaleMessage)count++); + line1=msgTxt; + msgTxt.Set((TLocaleMessage)count++); + line2=msgTxt; + notifier.Notify(line1,line2,button1,button2,buttonVal,status); + User::WaitForRequest(status); + User::After(300000); + + test.Next(_L("DIALOG3: General error message - disk write failed")); + User::After(300000); + msgTxt.Set((TLocaleMessage)count++); + line1=msgTxt; + msgTxt.Set((TLocaleMessage)count++); + line2=msgTxt; + notifier.Notify(line1,line2,button1,button2,buttonVal,status); + User::WaitForRequest(status); + User::After(300000); + test.Printf(_L("***End***\n\n")); + + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("ALARMNAME: 'Chimes' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("ALARMNAME: 'Rings' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("ALARMNAME: 'Signal' - %S\n"),&msgTxt); + test.Printf(_L("***Press any key***\n\n")); + test.Getch(); + + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'Internal' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External1' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External2' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External3' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External4' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External5' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External6' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External7' - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("DISKNAME: 'External8' - %S\n"),&msgTxt); + test.Printf(_L("***Press any key***\n\n")); + test.Getch(); + + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("SOCKETNAME0: - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("SOCKETNAME1: - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("SOCKETNAME2: - %S\n"),&msgTxt); + msgTxt.Set((TLocaleMessage)count++); + test.Printf(_L("SOCKETNAME3: - %S\n"),&msgTxt); + notifier.Close(); + } + +TInt E32Main() +// +// Main +// + { + + test.Title(); +// TBuf* localeBufs[ELocaleMessages_LastMsg]; {Too big for local decleration} + + test.Start(_L("Constructor")); + TLocaleMessageText msgTxt; + msgTxt.Set((TLocaleMessage)4); + TInt count=0; + for (count=0;count(msgTxt); + test(localeBufs[count]!=NULL); + } + + test.Next(_L("Set")); + for (count=0;count