kerneltest/e32test/dll/t_wsdextension.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2007-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 the License "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 // e32test\earlyextension\t_testextension.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include <e32test.h>
       
    19 #include <hal.h>
       
    20 #include "d_wsdextension.h"
       
    21 
       
    22 RLddWsdExtension lddChan;
       
    23 GLDEF_D RTest test(_L("LDD tests"));
       
    24 _LIT(KLddFileName, "D_WSDEXTENSION.LDD");
       
    25 
       
    26 GLDEF_C TInt E32Main()
       
    27     {
       
    28 	test.Title();
       
    29 	test.Start(_L("Testing WSD extension...\n"));
       
    30 	//Load logical device
       
    31 	TInt r = User::LoadLogicalDevice(KLddFileName);
       
    32 	test((r == KErrNone) || (r == KErrAlreadyExists));
       
    33 	//Open the channel
       
    34 	r = lddChan.Open();
       
    35     test(r==KErrNone || r==KErrAlreadyExists);
       
    36 	
       
    37     TInt data=0;
       
    38     r = lddChan.Test_getStaticData(data);
       
    39     test(r == KErrNone);
       
    40 	test(data == 0xEFEFEFEF);
       
    41     test.Printf(_L("Static Data from extension as expected!!!\n"));
       
    42 	test.Printf(_L("Closing the channel\n"));
       
    43 	
       
    44 	lddChan.Close();
       
    45 
       
    46 	test.Printf(_L("Freeing logical device\n"));
       
    47 	r = User::FreeLogicalDevice(KLddFileName);
       
    48 	test(r==KErrNone);
       
    49 	User::After(100000);
       
    50 	test.End();
       
    51 	test.Close();
       
    52 	return r;
       
    53 	}