mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musresourcefinderutil.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     1 /*
       
     2 * Copyright (c) 2009 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 //  INTERNAL INCLUDES
       
    20 #include "ut_musresourcefinderutil.h"
       
    21 #include "musresourcefinderutil.h"
       
    22  
       
    23 
       
    24 //  SYSTEM INCLUDES
       
    25 #include <digia/eunit/eunitmacros.h>
       
    26 
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 UT_MusResourceFinderUtil* UT_MusResourceFinderUtil::NewL()
       
    33     {
       
    34     UT_MusResourceFinderUtil* self = UT_MusResourceFinderUtil::NewLC();
       
    35     CleanupStack::Pop( self );
       
    36     return self;
       
    37     }
       
    38 
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 UT_MusResourceFinderUtil* UT_MusResourceFinderUtil::NewLC()
       
    45     {
       
    46     UT_MusResourceFinderUtil* self = new( ELeave ) UT_MusResourceFinderUtil();
       
    47     CleanupStack::PushL( self );
       
    48     self->ConstructL();
       
    49     return self;
       
    50     }
       
    51 
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 UT_MusResourceFinderUtil::~UT_MusResourceFinderUtil()
       
    58     {
       
    59     // NOP
       
    60     }
       
    61 
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // Default constructor
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 UT_MusResourceFinderUtil::UT_MusResourceFinderUtil()
       
    68     {
       
    69     // NOP
       
    70     }
       
    71 
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // Second phase construct
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 void UT_MusResourceFinderUtil::ConstructL()
       
    78     {
       
    79     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
       
    80     // It generates the test case table.
       
    81     CEUnitTestSuiteClass::ConstructL();
       
    82     }
       
    83     
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 void UT_MusResourceFinderUtil::SetupL()
       
    90     {
       
    91 
       
    92     }
       
    93 
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void UT_MusResourceFinderUtil::Teardown()
       
   100     {
       
   101 
       
   102     }
       
   103 
       
   104 
       
   105 
       
   106 // TEST CASES
       
   107 
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 void UT_MusResourceFinderUtil::UT_MusResourceFinderUtil_ResourcePathLL()
       
   114     {
       
   115     _LIT( reourceFile, "noway");
       
   116     HBufC* name = MusResourceFinderUtil::ResourcePathL( reourceFile );
       
   117     CleanupStack::PushL( name );
       
   118     EUNIT_ASSERT( name );
       
   119     CleanupStack::PopAndDestroy( name );
       
   120     }
       
   121 
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 //
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 void UT_MusResourceFinderUtil::UT_MusResourceFinderUtil_AppResourcePathLL()
       
   128     {
       
   129     _LIT( reourceFile, "noway");
       
   130     HBufC* name = MusResourceFinderUtil::AppResourcePathL( reourceFile );
       
   131     CleanupStack::PushL( name );
       
   132     EUNIT_ASSERT( name );
       
   133     CleanupStack::PopAndDestroy( name );
       
   134     }
       
   135 
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 // -----------------------------------------------------------------------------
       
   140 //
       
   141 void UT_MusResourceFinderUtil::UT_MusResourceFinderUtil_IsExistLL()
       
   142     {
       
   143     _LIT( reourceFile, "noway");
       
   144     EUNIT_ASSERT( !MusResourceFinderUtil::IsExistL( reourceFile ) );
       
   145     } 
       
   146     
       
   147 
       
   148 
       
   149 //  TEST TABLE
       
   150 
       
   151 EUNIT_BEGIN_TEST_TABLE(
       
   152     UT_MusResourceFinderUtil,
       
   153     "UT_MusResourceFinderUtil",
       
   154     "UNIT" )
       
   155 
       
   156 EUNIT_TEST(
       
   157     "ResourcePathL - test ",
       
   158     "MusResourceFinderUtil",
       
   159     "ResourcePathL",
       
   160     "FUNCTIONALITY",
       
   161     SetupL, UT_MusResourceFinderUtil_ResourcePathLL, Teardown)
       
   162 
       
   163 EUNIT_TEST(
       
   164     "AppResourcePathL - test ",
       
   165     "MusResourceFinderUtil",
       
   166     "AppResourcePathL",
       
   167     "FUNCTIONALITY",
       
   168     SetupL, UT_MusResourceFinderUtil_AppResourcePathLL, Teardown)
       
   169 
       
   170 EUNIT_TEST(
       
   171     "IsExistL - test ",
       
   172     "MusResourceFinderUtil",
       
   173     "IsExistL",
       
   174     "FUNCTIONALITY",
       
   175     SetupL, UT_MusResourceFinderUtil_IsExistLL, Teardown)
       
   176 
       
   177 
       
   178 
       
   179 EUNIT_END_TEST_TABLE
       
   180 
       
   181 //  END OF FILE
       
   182 
       
   183