|
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 // mectest050step.cpp |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #include "mectest050step.h" |
|
23 #include "testextensions.h" |
|
24 #include "metaextensioncontainerspy.h" |
|
25 #include <comms-infras/ss_rmetaextensioncontainer.h> |
|
26 #include <comms-infras/ss_commsprov.h> |
|
27 |
|
28 using namespace ESock; |
|
29 |
|
30 CMecTest050Step::~CMecTest050Step() |
|
31 { |
|
32 } |
|
33 |
|
34 |
|
35 /** |
|
36 //! @SYMTestCaseID MEC_UNIT_TEST_050 |
|
37 //! @SYMTestCaseDesc Container Merging Test, Open container and append the same container implementation twice |
|
38 //! @SYMFssID COMMS-INFRAS/Esock/MetaExtensionContainer/UnitTest |
|
39 //! @SYMTestActions 1) Open container cont1 |
|
40 // 2) AppendExtension T1 |
|
41 // 3) Open constMec1 against cont1 |
|
42 // 4) Open constMec2 against cont1 |
|
43 // 5) Open container cont2 |
|
44 // 6) AppendContainerL constMec1 |
|
45 // 7) AppendContainerL constMec2 == KErrAlreadyExists |
|
46 // 8) Close |
|
47 //! @SYMTestExpectedResults KErrNone. |
|
48 */ |
|
49 TVerdict CMecTest050Step::RunTestStepL() |
|
50 { |
|
51 TVerdict result = EFail; |
|
52 |
|
53 RMetaExtensionContainer cont1; |
|
54 cont1.Open(); |
|
55 CleanupClosePushL(cont1); |
|
56 CreateAndAppendExtensionL(cont1, TTestExtension1::ETypeId); |
|
57 |
|
58 RMetaExtensionContainerC constMec1; |
|
59 constMec1.Open(cont1); |
|
60 CleanupClosePushL(constMec1); |
|
61 |
|
62 RMetaExtensionContainerC constMec2; |
|
63 constMec2.Open(cont1); |
|
64 CleanupClosePushL(constMec2); |
|
65 |
|
66 RMetaExtensionContainer cont2; |
|
67 cont2.Open(); |
|
68 CleanupClosePushL(cont2); |
|
69 |
|
70 cont2.AppendContainerL(constMec1); |
|
71 |
|
72 TRAPD(err, cont2.AppendContainerL(constMec2)); |
|
73 if (err == KErrAlreadyExists) |
|
74 { |
|
75 result = EPass; |
|
76 } |
|
77 |
|
78 CleanupStack::PopAndDestroy(&cont2); |
|
79 CleanupStack::PopAndDestroy(&constMec2); |
|
80 CleanupStack::PopAndDestroy(&constMec1); |
|
81 CleanupStack::PopAndDestroy(&cont1); |
|
82 |
|
83 return result; |
|
84 } |
|
85 |