Update contrib.
1 // Copyright (c) 1998-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 the License "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.
14 // e32test\window\t_mmcpw.cpp
15 // Tests MMC card password notifier
24 #include <e32def_private.h>
26 #include <e32std_private.h>
28 static RTest test(_L("T_MMCPW"));
30 GLDEF_C TInt E32Main()
32 test.Start(_L("E32Main"));
34 test.Next(_L("Creating notifier."));
37 test.Next(_L("Connected to notify server."));
39 test((r = n.Connect()) == KErrNone);
41 TPckgBuf<TMediaPswdSendNotifyInfoV1> send;
42 send().iVersion = TVersion(1, 0, 0);
43 TPckgBuf<TMediaPswdReplyNotifyInfoV1> reply;
44 reply().iVersion = TVersion(1, 0, 0);
46 test.Next(_L("Launching notify server."));
48 n.StartNotifierAndGetResponse(rs, TUid::Uid(KMediaPasswordNotifyUid), send, reply);
50 test.Next(_L("Waiting for dialog to respond."));
51 User::WaitForRequest(rs);
53 test.Next(_L("Reading exit mode and resultant password."));
54 test(reply().iEM == EMPEMUnlock || reply().iEM == EMPEMCancel || reply().iEM == EMPEMUnlockAndStore);
55 test.Printf(_L("reply().iEM = %d(d).\n"), TInt(reply().iEM));
60 case EMPEMUnlockAndStore:
62 if (reply().iEM == EMPEMUnlock)
63 test.Printf(_L("EMPEMUnlock selected.\n"));
65 test.Printf(_L("EMPEMUnlockAndStore selected.\n"));
68 pw.Copy(reply().iPW, KMaxMediaPassword);
70 TInt i; // bad for-scope under VC
72 for (i = 0; i < KMaxMediaPassword; i++)
73 test.Printf(_L("%02x "), pw[i]);
74 test.Printf(_L("\n"));
76 for (i = 0; i < KMaxMediaPassword; i++)
77 test.Printf(_L("%02x "), i);
78 test.Printf(_L("\n"));
83 test.Printf(_L("EMPEMCancel selected.\n"));
87 test.Next(_L("Closing notifier."));