sl@0
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __CSIPURIANDAUTHORITYTEST_H__
|
sl@0
|
17 |
#define __CSIPURIANDAUTHORITYTEST_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// System includes
|
sl@0
|
20 |
//
|
sl@0
|
21 |
#include <e32base.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
// Local includes
|
sl@0
|
24 |
#include "ctestbase.h"
|
sl@0
|
25 |
|
sl@0
|
26 |
// CSipUriAndAuthorityTest - test class for the Uri and Authority family of classes
|
sl@0
|
27 |
//
|
sl@0
|
28 |
class CSipUriAndAuthorityTest : public CTestBase
|
sl@0
|
29 |
{
|
sl@0
|
30 |
public:
|
sl@0
|
31 |
|
sl@0
|
32 |
// Static factory c'tor. Leaves pointer to created object on the cleanup stack.
|
sl@0
|
33 |
//
|
sl@0
|
34 |
// Rtn: pointer to newly created object - ownership transfered to caller.
|
sl@0
|
35 |
//
|
sl@0
|
36 |
static CSipUriAndAuthorityTest* NewLC(CIpuTestHarness* aTestHarness);
|
sl@0
|
37 |
|
sl@0
|
38 |
// Static factory c'tor.
|
sl@0
|
39 |
//
|
sl@0
|
40 |
// Rtn: pointer to newly created object - ownership transfered to caller.
|
sl@0
|
41 |
//
|
sl@0
|
42 |
static CSipUriAndAuthorityTest* NewL(CIpuTestHarness* aTestHarness);
|
sl@0
|
43 |
|
sl@0
|
44 |
// D'tor
|
sl@0
|
45 |
//
|
sl@0
|
46 |
~CSipUriAndAuthorityTest();
|
sl@0
|
47 |
|
sl@0
|
48 |
// Runs the defined tests.
|
sl@0
|
49 |
//
|
sl@0
|
50 |
void DoTestsL();
|
sl@0
|
51 |
|
sl@0
|
52 |
// Default c'tor.
|
sl@0
|
53 |
//
|
sl@0
|
54 |
CSipUriAndAuthorityTest(CIpuTestHarness* aTestHarness);
|
sl@0
|
55 |
|
sl@0
|
56 |
private: // Methods
|
sl@0
|
57 |
|
sl@0
|
58 |
// Non-trivial c'tor. Second part of 2-phase construction - does all allocation.
|
sl@0
|
59 |
//
|
sl@0
|
60 |
void ConstructL();
|
sl@0
|
61 |
private: // Attributes
|
sl@0
|
62 |
|
sl@0
|
63 |
// Open session and file
|
sl@0
|
64 |
TInt OpenSipURIFile();
|
sl@0
|
65 |
|
sl@0
|
66 |
// In:
|
sl@0
|
67 |
// aError - the error code
|
sl@0
|
68 |
// aSipUri - the SIP URI that is currently being validated
|
sl@0
|
69 |
//
|
sl@0
|
70 |
void SipLogError(TInt aError, const TDesC16& aSipUri) const;
|
sl@0
|
71 |
|
sl@0
|
72 |
// In:
|
sl@0
|
73 |
//aSipUri - the sip uri that we are currently using
|
sl@0
|
74 |
// aError - the error code
|
sl@0
|
75 |
//
|
sl@0
|
76 |
void LogErrorMessage(const TDesC16& aSipUri, const TInt aError)const;
|
sl@0
|
77 |
|
sl@0
|
78 |
//Validate SIP URIs
|
sl@0
|
79 |
//
|
sl@0
|
80 |
TInt SipUriValidationL();
|
sl@0
|
81 |
|
sl@0
|
82 |
//Compare 2 SIP URIs
|
sl@0
|
83 |
//
|
sl@0
|
84 |
TInt SipUriEquivalenceL();
|
sl@0
|
85 |
|
sl@0
|
86 |
// Test harness
|
sl@0
|
87 |
CIpuTestHarness* iTestHarness;
|
sl@0
|
88 |
|
sl@0
|
89 |
TFileText iTUriParserFile;
|
sl@0
|
90 |
RFs iFsSession;
|
sl@0
|
91 |
TBool iFoundEquivalence;
|
sl@0
|
92 |
};
|
sl@0
|
93 |
|
sl@0
|
94 |
#endif // __CSIPURIANDAUTHORITYTEST_H__
|