datacommsserver/esockserver/test/te_mecunittest/src/mectestpanic4step.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     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 // mectestpanic4step.cpp
       
    16 //
       
    17 
       
    18 /**
       
    19 @file
       
    20 */
       
    21 
       
    22 #include "mectestpanic4step.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 CMecTestPanic4Step::~CMecTestPanic4Step()
       
    30     {
       
    31     }
       
    32 
       
    33 
       
    34 /**
       
    35 //! @SYMTestCaseID      MEC_UNIT_TEST_104
       
    36 //! @SYMTestCaseDesc 	Test Panic mecpanic:3 (EAlreadyOpen) for RMetaExtensionContainerC::Open(RMetaExtensionContainerC& aMec)
       
    37 //! @SYMFssID 			COMMS-INFRAS/Esock/MetaExtensionContainer/UnitTest
       
    38 //! @SYMTestActions 	1) Create container1
       
    39 //						2) AppendExtension T1 to container1
       
    40 //						3) Open constMec against container1
       
    41 //						4) Create container2
       
    42 //						5) AppendExtension T2 to container2
       
    43 //						6) Open constMec against container2
       
    44 //						7) Close
       
    45 //! @SYMTestExpectedResults  Panic mecpanic:3
       
    46 */
       
    47 TVerdict CMecTestPanic4Step::RunTestStepL()
       
    48     {
       
    49     RMetaExtensionContainer container1;
       
    50     container1.Open();
       
    51     CleanupClosePushL(container1);
       
    52     CreateAndAppendExtensionL(container1, TTestExtension1::ETypeId);
       
    53     
       
    54     RMetaExtensionContainerC constMec;
       
    55     constMec.Open(container1);
       
    56     CleanupClosePushL(constMec);
       
    57     
       
    58     RMetaExtensionContainer container2;
       
    59     container2.Open();
       
    60     CleanupClosePushL(container2);
       
    61     CreateAndAppendExtensionL(container2, TTestExtension2::ETypeId);
       
    62     
       
    63     constMec.Open(container2); // PANIC
       
    64 
       
    65     CleanupStack::PopAndDestroy(&container2);
       
    66     CleanupStack::PopAndDestroy(&container1);
       
    67     CleanupStack::PopAndDestroy(&constMec);
       
    68     
       
    69     return EFail;
       
    70     }
       
    71 
       
    72