24
|
1 |
// Copyright (c) 2001-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 |
// Header for the mainframe of the gprs test programs
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
|
|
23 |
#if !defined(__TMAIN_H__)
|
|
24 |
#define __TMAIN_H__
|
|
25 |
|
|
26 |
#include <e32test.h>
|
|
27 |
#include <c32comm.h>
|
|
28 |
#include <e32base.h>
|
|
29 |
#include <es_sock.h>
|
|
30 |
#include <in_sock.h>
|
|
31 |
#include <smsuaddr.h>
|
|
32 |
#include <msvstd.h>
|
|
33 |
//#include <agentclient.h>
|
|
34 |
#include "tcfgfile.h"
|
|
35 |
#include "etelpckt.h"
|
|
36 |
|
|
37 |
// LITs used for ini file.
|
|
38 |
_LIT(KTGPRSConfigFile,"t_gprs.ini");
|
|
39 |
_LIT(KTestCfgHTTPServerIpAddress,"TestCfgHTTPServerIpAddress");
|
|
40 |
_LIT(KTestCfgHTTPPageAddress,"TestCfgHTTPPageAddress");
|
|
41 |
_LIT(KTestCfgPhoneMake, "TestCfgPhoneMake");
|
|
42 |
_LIT(KTestCfgPhoneMotorola, "Motorola");
|
|
43 |
_LIT(KTestCfgPhoneEricsson, "Ericsson");
|
|
44 |
|
|
45 |
const TInt KOneSecond = 1000000;
|
|
46 |
const TInt KFiveSeconds = KOneSecond * 5;
|
|
47 |
_LIT(KtsyName, "MM");
|
|
48 |
_LIT(KPhoneName, "GsmPhone1");
|
|
49 |
|
|
50 |
|
|
51 |
GLREF_D RTest gTest;
|
|
52 |
GLREF_D RPhone gPhone;
|
|
53 |
GLREF_D RTelServer gServer;
|
|
54 |
GLREF_D RPacketService gPacketService;
|
|
55 |
GLREF_D RPacketContext gPacketContext[20];
|
|
56 |
// Used for webpage download
|
|
57 |
static RConnection conn;
|
|
58 |
//GLREF_D RGenericAgent gGenericAgent;
|
|
59 |
GLREF_D RSocketServ gSocketServer;
|
|
60 |
GLREF_D CConfigParams* testConfigParams;
|
|
61 |
|
|
62 |
|
|
63 |
enum TPhoneBrand
|
|
64 |
{
|
|
65 |
EMotorola,
|
|
66 |
EEricsson
|
|
67 |
};
|
|
68 |
|
|
69 |
GLREF_D TPhoneBrand GPhoneBrand;
|
|
70 |
GLDEF_C void AutoTestExecute();
|
|
71 |
|
|
72 |
|
|
73 |
#define LEAVE_IF_ERROR(a) \
|
|
74 |
if (a!=KErrNone) \
|
|
75 |
{ \
|
|
76 |
TText8* fileChars = (TText8*)__FILE__; \
|
|
77 |
TPtrC8 fileName8(fileChars); \
|
|
78 |
TBuf<128> fileName; \
|
|
79 |
fileName.Copy(fileName8); \
|
|
80 |
gTest.Printf(_L("%S ret=%d line=%d\n"),&fileName,a,__LINE__); \
|
|
81 |
} \
|
|
82 |
User::LeaveIfError(a);
|
|
83 |
|
|
84 |
#endif //__TMAIN_H__
|
|
85 |
|
|
86 |
|