|
1 // Copyright (c) 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 // |
|
15 // mectest004step.cpp |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #include "mectest004step.h" |
|
23 #include "testextensions.h" |
|
24 #include <comms-infras/ss_rmetaextensioncontainer.h> |
|
25 #include <comms-infras/ss_commsprov.h> |
|
26 |
|
27 using namespace ESock; |
|
28 |
|
29 CMecTest004Step::~CMecTest004Step() |
|
30 { |
|
31 } |
|
32 |
|
33 |
|
34 /** |
|
35 //! @SYMTestCaseDesc Simple API Test, AppendExtension() where extension has already been added |
|
36 //! @SYMFssID COMMS-INFRAS/Esock/MetaExtensionContainer/UnitTest |
|
37 //! @SYMTestActions 1) Open container |
|
38 // 2) AppendExtension T1 to container |
|
39 // 3) AppendExtension T1 == KErrAlreadyExists |
|
40 // 4) Close |
|
41 //! @SYMTestExpectedResults KErrNone. |
|
42 */ |
|
43 TVerdict CMecTest004Step::RunTestStepL() |
|
44 { |
|
45 TVerdict result = EFail; |
|
46 |
|
47 RMetaExtensionContainer mec; |
|
48 mec.Open(); |
|
49 CleanupClosePushL(mec); |
|
50 |
|
51 CreateAndAppendExtensionL(mec, TTestExtension1::ETypeId, KExtVersion1); |
|
52 |
|
53 TTestExtension1* ext = new(ELeave)TTestExtension1(KExtVersion2); |
|
54 TInt err = mec.AppendExtension(ext); |
|
55 if (err == KErrAlreadyExists) |
|
56 { |
|
57 delete ext; |
|
58 result = EPass; |
|
59 } |
|
60 else if (err != KErrNone) |
|
61 { |
|
62 delete ext; |
|
63 } |
|
64 |
|
65 CleanupStack::PopAndDestroy(&mec); |
|
66 return result; |
|
67 } |
|
68 |