24
|
1 |
// Copyright (c) 2007-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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// TE_ETELRECORDER.CPP
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#include <e32test.h>
|
|
19 |
|
|
20 |
#include "TE_EtelMMTestStepBase.h"
|
|
21 |
#include "testdef.h"
|
|
22 |
#include <e32debug.h>
|
|
23 |
#include <s32file.h>
|
|
24 |
#include <f32file.h>
|
|
25 |
|
|
26 |
#include <etelext.h>
|
|
27 |
|
|
28 |
#include "TE_MMEtelRecorder.h"
|
|
29 |
|
|
30 |
|
|
31 |
CTestRecorder::CTestRecorder()
|
|
32 |
/** Each test step initialises it's own name
|
|
33 |
*/
|
|
34 |
{
|
|
35 |
SetTestStepName(_L("TestRecorder"));
|
|
36 |
}
|
|
37 |
|
|
38 |
/** Force an invalid message with NULL descriptors into etel.
|
|
39 |
*/
|
|
40 |
enum TVerdict CTestRecorder::doTestStepL()
|
|
41 |
{
|
|
42 |
// Test is TE_ETELMM because I could create a test on the server side, because the
|
|
43 |
// server requires correct initialisation of the framework, and then cordination of the
|
|
44 |
// finite state machine before it would be safe to log.
|
|
45 |
//
|
|
46 |
// The alternative was to put the test in TE_ETel but it proved hard to find a SendRecive Function
|
|
47 |
// that would accepted NULL pointers, and actually get to the logging function that we wanted to test.
|
|
48 |
// In the end RMobilePhone (part of MMEtel) and EMobilePhoneGetPhoneStoreInfo provided a solution.
|
|
49 |
//
|
|
50 |
|
|
51 |
INFO_PRINTF1(_L("Test Recorder"));
|
|
52 |
|
|
53 |
// Lets get access to protected fn's.
|
|
54 |
class RMobilePhone1:public RMobilePhone
|
|
55 |
{
|
|
56 |
public:
|
|
57 |
void SendReceive1(TInt aFunction, const TIpcArgs &aArgs, TRequestStatus &aStatus) const
|
|
58 |
{
|
|
59 |
SendReceive(aFunction, aArgs, aStatus);
|
|
60 |
}
|
|
61 |
};
|
|
62 |
|
|
63 |
RMobilePhone1 mmPhone;
|
|
64 |
TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
|
|
65 |
TEST(ret==KErrNone);
|
|
66 |
|
|
67 |
TIpcArgs args;
|
|
68 |
|
|
69 |
args.Set(0,0);
|
|
70 |
args.Set(2,0);
|
|
71 |
args.Set(1,EIsaNarrowDesToSetAndGet);
|
|
72 |
// Does not really matter since, we pass 0 ptr.
|
|
73 |
// But should be something that makes sense.
|
|
74 |
// Otherwise the server will reject it before we attempt to
|
|
75 |
// output the NULL descriptor.
|
|
76 |
// Note.
|
|
77 |
// It is a deliberate choice to pass the descriptor to the server this way.
|
|
78 |
// This is just in case there are other issues with NULL pts.
|
|
79 |
|
|
80 |
TRequestStatus reqStatusSendRec;
|
|
81 |
mmPhone.SendReceive1(EMobilePhoneGetPhoneStoreInfo, args, reqStatusSendRec);
|
|
82 |
// EMobilePhoneGetPhoneStoreInfo is tested in TE_mmphone.cpp (CTestPhone::TestCapabilityL),
|
|
83 |
// if you need to compare behaviour.
|
|
84 |
User::WaitForRequest(reqStatusSendRec);
|
|
85 |
// Let us fake a simple ptr falure.
|
|
86 |
// Note this will panic the client for both the original run,
|
|
87 |
// and for the player, but we should still get a log record output.
|
|
88 |
// The player should, get the record, and note the null records.
|
|
89 |
// The null records will then cause a panic, when passed into the etel system.
|
|
90 |
|
|
91 |
|
|
92 |
return TestStepResult();
|
|
93 |
}
|
|
94 |
|