kerneltest/e32test/locale/t_msgtxt.cpp
author hgs
Mon, 11 Oct 2010 17:54:41 +0100
changeset 286 48e57fb1237e
parent 271 dc268b18d709
permissions -rw-r--r--
201039_11
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
     1
// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     2
// All rights reserved.
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     3
// This component and the accompanying materials are made available
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     5
// which accompanies this distribution, and is available
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     7
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     8
// Initial Contributors:
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    10
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    11
// Contributors:
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    12
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    13
// Description:
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    14
// e32test\locale\t_msgtxt.cpp
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    15
// Tests the TLocaleMessageText class
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    16
// 
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    17
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    18
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    19
#include <e32test.h>
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    20
#include <e32svr.h>
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    21
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    22
LOCAL_D	TBuf<KMaxLocaleMessageText>* localeBufs[ELocaleMessages_LastMsg];
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    23
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    24
RTest test(_L("T_MSGTXT"));
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    25
	
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    26
const TUint KTimeOut=5000000; // 5 seconds timeout for the notifier
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    27
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    28
LOCAL_C void DisplayMessages()
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    29
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    30
// Display the locale messages
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    31
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    32
	{
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    33
	RNotifier notifier;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    34
	TInt r=notifier.Connect();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    35
	test(r==KErrNone);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    36
	TRequestStatus status;
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    37
	TRequestStatus timerStatus;
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    38
	TInt buttonVal=0;
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    39
	RTimer timer;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    40
	timer.CreateLocal();
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    41
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    42
	test.Next(_L("Test File Server Error Dialogs"));
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    43
	TLocaleMessageText msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    44
	msgTxt.Set(EFileServer_Button1);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    45
	TBuf<KMaxLocaleMessageText> button1(msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    46
	msgTxt.Set(EFileServer_Button2);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    47
	TBuf<KMaxLocaleMessageText> button2(msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    48
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    49
	test.Next(_L("DIALOG1: Displayed if a disk is removed during a write (will timeout in 5 seconds)"));
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    50
	TInt count=2;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    51
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    52
	TBuf<KMaxLocaleMessageText> line1=msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    53
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    54
	TBuf<KMaxLocaleMessageText> line2=msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    55
	notifier.Notify(line1,line2,button1,button2,buttonVal,status);
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    56
	timer.After(timerStatus,KTimeOut);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    57
	User::WaitForRequest(status,timerStatus);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    58
	if (status==KRequestPending)
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    59
		{
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    60
		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    61
		// make the notifier to disappear
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    62
		TRawEvent eventDown;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    63
		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    64
		TRawEvent eventUp;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    65
		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    66
		UserSvr::AddEvent(eventDown);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    67
		UserSvr::AddEvent(eventUp);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    68
		}
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    69
	else
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    70
		{
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    71
		timer.Cancel();
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    72
		}
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    73
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    74
	test.Next(_L("DIALOG2: Write failed due to low power (will timeout in 5 seconds)"));
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    75
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    76
	line1=msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    77
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    78
	line2=msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    79
	notifier.Notify(line1,line2,button1,button2,buttonVal,status);
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    80
	timer.After(timerStatus,KTimeOut);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    81
	User::WaitForRequest(status,timerStatus);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    82
	if (status==KRequestPending)
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    83
		{
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    84
		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    85
		// make the notifier to disappear
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    86
		TRawEvent eventDown;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    87
		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    88
		TRawEvent eventUp;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    89
		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    90
		UserSvr::AddEvent(eventDown);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    91
		UserSvr::AddEvent(eventUp);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    92
		}
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    93
	else
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    94
		{
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    95
		timer.Cancel();
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    96
		}
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    97
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
    98
	test.Next(_L("DIALOG3: General error message - disk write failed (will timeout in 5 seconds)"));
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    99
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   100
	line1=msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   101
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   102
	line2=msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   103
	notifier.Notify(line1,line2,button1,button2,buttonVal,status);
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   104
	timer.After(timerStatus,KTimeOut);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   105
	User::WaitForRequest(status,timerStatus);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   106
	if (status==KRequestPending)
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   107
		{
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   108
		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   109
		// make the notifier to disappear
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   110
		TRawEvent eventDown;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   111
		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   112
		TRawEvent eventUp;
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   113
		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   114
		UserSvr::AddEvent(eventDown);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   115
		UserSvr::AddEvent(eventUp);
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   116
		}
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   117
	else
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   118
		{
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   119
		timer.Cancel();
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   120
		}
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   121
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   122
	timer.Close();
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   123
	test.Printf(_L("***End***\n\n"));
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   124
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   125
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   126
	test.Printf(_L("ALARMNAME: 'Chimes' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   127
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   128
	test.Printf(_L("ALARMNAME: 'Rings' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   129
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   130
	test.Printf(_L("ALARMNAME: 'Signal' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   131
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   132
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   133
	test.Printf(_L("DISKNAME: 'Internal' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   134
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   135
	test.Printf(_L("DISKNAME: 'External1' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   136
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   137
	test.Printf(_L("DISKNAME: 'External2' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   138
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   139
	test.Printf(_L("DISKNAME: 'External3' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   140
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   141
	test.Printf(_L("DISKNAME: 'External4' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   142
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   143
	test.Printf(_L("DISKNAME: 'External5' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   144
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   145
	test.Printf(_L("DISKNAME: 'External6' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   146
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   147
	test.Printf(_L("DISKNAME: 'External7' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   148
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   149
	test.Printf(_L("DISKNAME: 'External8' - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   150
	
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   151
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   152
	test.Printf(_L("SOCKETNAME0: - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   153
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   154
	test.Printf(_L("SOCKETNAME1: - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   155
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   156
	test.Printf(_L("SOCKETNAME2: - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   157
	msgTxt.Set((TLocaleMessage)count++);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   158
	test.Printf(_L("SOCKETNAME3: - %S\n"),&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   159
	notifier.Close();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   160
	}
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   161
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   162
TInt E32Main()
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   163
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   164
// Main
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   165
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   166
	{
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   167
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   168
	test.Title();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   169
	test.Start(_L("Constructor"));
271
dc268b18d709 201037_07
hgs
parents: 0
diff changeset
   170
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   171
	TLocaleMessageText msgTxt;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   172
	msgTxt.Set((TLocaleMessage)4);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   173
	TInt count=0;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   174
	for (count=0;count<ELocaleMessages_LastMsg;count++)
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   175
		{
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   176
		TLocaleMessageText msgTxt((TLocaleMessage)count);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   177
		test.Printf(_L("Message %d = \"%S\"\n"),count,&msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   178
		localeBufs[count]=new TBuf<KMaxLocaleMessageText>(msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   179
		test(localeBufs[count]!=NULL);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   180
		}
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   181
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   182
	test.Next(_L("Set"));
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   183
	for (count=0;count<ELocaleMessages_LastMsg;count++)
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   184
		{
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   185
		TLocaleMessageText msgTxt((TLocaleMessage)count);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   186
		test((*localeBufs[count])==msgTxt);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   187
		}
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   188
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   189
	for (count=0;count<ELocaleMessages_LastMsg;count++)
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   190
		{
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   191
		delete localeBufs[count];
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   192
		}
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   193
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   194
	test.Next(_L("Illegal values"));
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   195
	TLocaleMessageText error((TLocaleMessage)0x1000000);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   196
	test(error.Length()==0);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   197
	error.SetLength(20);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   198
	error.Set((TLocaleMessage)0x1000000);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   199
	test(error.Length()==0);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   200
	TLocaleMessageText lastMsg(ELocaleMessages_LastMsg);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   201
	test(lastMsg.Length()==0);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   202
	lastMsg.SetLength(20);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   203
	lastMsg.Set(ELocaleMessages_LastMsg);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   204
	test(lastMsg.Length()==0);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   205
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   206
	DisplayMessages();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   207
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   208
	test.End();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   209
	return KErrNone;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   210
	}