navienginebsp/ne1_tb/test/gpio/t_gpio.cpp
changeset 0 5de814552237
equal deleted inserted replaced
-1:000000000000 0:5de814552237
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32test.h>
       
    20 #include <e32ver.h>
       
    21 #include <e32def_private.h>
       
    22 #include "d_gpio.h"
       
    23 
       
    24 _LIT(testName, "t_gpio");
       
    25 _LIT(KLddFileName, "d_gpio.ldd");
       
    26 
       
    27 LOCAL_D	RTest	test(testName);
       
    28 
       
    29 GLDEF_C TInt E32Main()
       
    30 	{
       
    31 	test.Title();
       
    32 	
       
    33 	TInt r;
       
    34 
       
    35 	test.Start(_L("Load Logical Device"));
       
    36 	r = User::LoadLogicalDevice(KLddFileName);
       
    37 	test(r == KErrNone || r == KErrAlreadyExists);
       
    38 
       
    39 	__KHEAP_MARK;
       
    40 
       
    41 	test.Next(_L("Open Device"));
       
    42 	RDevice device;
       
    43 	r = device.Open(RGpio::Name());
       
    44 	test(r == KErrNone);
       
    45 
       
    46 	test.Next(_L("Open Logical Channel"));
       
    47 	RGpio ldd;
       
    48 	r = ldd.Open();
       
    49 	test(r == KErrNone);
       
    50 
       
    51 	test.Next(_L("Call Static Extension"));
       
    52 	r = ldd.CallStaticExtension();
       
    53 	test(r == KErrNone);
       
    54 
       
    55 	test.Next(_L("Close Logical Channel"));
       
    56 	ldd.Close();
       
    57 
       
    58 	__KHEAP_MARKEND;
       
    59 
       
    60 	test.Next(_L("Unload Logical Device"));
       
    61 	r = User::FreeLogicalDevice(KLddFileName);
       
    62 	test(r == KErrNone);
       
    63 
       
    64 	test.End();
       
    65 
       
    66 	return 0;
       
    67 	}
       
    68