photosgallery/viewframework/medialists/tsrc/ut_cglxstaticitemlist/ut_cglxstaticitemlist.cpp
changeset 0 4e91876724a2
child 18 bcb43dc84c44
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2007 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:    Unit tests
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20  
       
    21 //  CLASS HEADER
       
    22 #include "ut_cglxstaticitemlist.h"
       
    23 
       
    24 //  EXTERNAL INCLUDES
       
    25 #include <digia/eunit/eunitmacros.h>
       
    26 #include <digia/eunit/eunitdecorators.h>
       
    27 
       
    28 //  INTERNAL INCLUDES
       
    29 #include "glxstaticitemlist.h"
       
    30 #include "_glxlisttesthelpers.h"
       
    31 
       
    32 using namespace NGlxListDefs;
       
    33 
       
    34 // Add no static items
       
    35 NGlxListTestHelpers::TStaticItemInfo::TData info_add_none[] = 
       
    36     { { K_STATIC_ITEMS_END } };
       
    37 
       
    38 // Add a static item at front
       
    39 NGlxListTestHelpers::TStaticItemInfo::TData info_add_front_0[] = 
       
    40     { { '0', NGlxListDefs::EInsertFirst },
       
    41       { K_STATIC_ITEMS_END } };
       
    42 
       
    43 // Add a static item at front
       
    44 NGlxListTestHelpers::TStaticItemInfo::TData info_add_rear_0[] = 
       
    45     { { '0', NGlxListDefs::EInsertLast },
       
    46       { K_STATIC_ITEMS_END } };
       
    47       
       
    48 // Add two static items at front
       
    49 NGlxListTestHelpers::TStaticItemInfo::TData info_add_front_01[] = 
       
    50     { { '1', NGlxListDefs::EInsertFirst },
       
    51       { '0', NGlxListDefs::EInsertFirst },
       
    52       { K_STATIC_ITEMS_END } };
       
    53 
       
    54       
       
    55 // Add two static items at front
       
    56 NGlxListTestHelpers::TStaticItemInfo::TData info_add_front_0_rear_12[] = 
       
    57     { { '0', NGlxListDefs::EInsertFirst },
       
    58       { '1', NGlxListDefs::EInsertLast },
       
    59       { '2', NGlxListDefs::EInsertLast },
       
    60       { K_STATIC_ITEMS_END } };
       
    61       
       
    62 // -----------------------------------------------------------------------------
       
    63 // Constructors 
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 CGlxStaticItemListReconstruction* CGlxStaticItemListReconstruction::NewL( TInt aReservationCount )
       
    67     {
       
    68     CGlxStaticItemListReconstruction* self = new (ELeave) CGlxStaticItemListReconstruction();
       
    69     CleanupStack::PushL( self );
       
    70     self->ConstructL( aReservationCount );
       
    71     CleanupStack::Pop( self );
       
    72     return self;
       
    73     }
       
    74     
       
    75 // -----------------------------------------------------------------------------
       
    76 // Reconstruction
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 TBool CGlxStaticItemListReconstruction::ReconstructionEquals() const
       
    80     {
       
    81     return ItemsEqual();
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // Constructors & destructors
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 ut_CGlxStaticItemList* ut_CGlxStaticItemList::NewL()
       
    89     {
       
    90     ut_CGlxStaticItemList* self = ut_CGlxStaticItemList::NewLC();
       
    91     CleanupStack::Pop();
       
    92 
       
    93     return self;
       
    94     }
       
    95 
       
    96 ut_CGlxStaticItemList* ut_CGlxStaticItemList::NewLC()
       
    97     {
       
    98     ut_CGlxStaticItemList* self = new( ELeave ) ut_CGlxStaticItemList();
       
    99     CleanupStack::PushL( self );
       
   100 
       
   101     self->ConstructL();
       
   102 
       
   103     return self;
       
   104     }
       
   105 
       
   106 // Destructor (virtual by CBase)
       
   107 ut_CGlxStaticItemList::~ut_CGlxStaticItemList()
       
   108     {
       
   109     }
       
   110 
       
   111 // Default constructor
       
   112 ut_CGlxStaticItemList::ut_CGlxStaticItemList()
       
   113     {
       
   114     }
       
   115 
       
   116 // Second phase construct
       
   117 void ut_CGlxStaticItemList::ConstructL()
       
   118     {
       
   119     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
       
   120     // It generates the test case table.
       
   121     CEUnitTestSuiteClass::ConstructL();
       
   122     }
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // Setup & Teardown
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 void ut_CGlxStaticItemList::SetupL(  )
       
   129     {
       
   130     }
       
   131     
       
   132 
       
   133 void ut_CGlxStaticItemList::Teardown(  )
       
   134     {
       
   135     DeleteMembers();
       
   136     }
       
   137     
       
   138 // -----------------------------------------------------------------------------
       
   139 // Test SetContentsL(...)
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 void ut_CGlxStaticItemList::T_SetContentsLL(  )
       
   143     {
       
   144     TNotification::TData notificationsStaticItemsDisabled[] = 
       
   145                             { { TNotification::ERemove, 0, 1 }, // a
       
   146                               { TNotification::EAdd,    0, 3 }, // ABC
       
   147                               { TNotification::EAdd,    4, 2 }, // DE
       
   148                               { TNotification::ERemove, 7, 1 }, // d
       
   149                               { TNotification::ERemove, 8, 2 }, // fg
       
   150                               { TNotification::EAdd,    8, 3 }, // FGH
       
   151                               { END_MARKER } };
       
   152     TNotification::TData notificationsStaticItemsEnabled[] = 
       
   153                             { { TNotification::ERemove, 1, 1 }, // a
       
   154                               { TNotification::EAdd,    1, 3 }, // ABC
       
   155                               { TNotification::EAdd,    5, 2 }, // DE
       
   156                               { TNotification::ERemove, 8, 1 }, // d
       
   157                               { TNotification::ERemove, 9, 2 }, // fg
       
   158                               { TNotification::EAdd,    9, 3 }, // FGH
       
   159                               { END_MARKER } };
       
   160     EUNIT_ASSERT( TrySetContentsL ( _L8("abcdefg"),         // original list
       
   161                                     _L8("ABCbDEceFGH"),     // new list
       
   162                                     _L8("0ABCbDEceFGH12"),  // new list with static items
       
   163                                     notificationsStaticItemsEnabled, 
       
   164                                     notificationsStaticItemsDisabled,
       
   165                                     info_add_front_0_rear_12 ) );
       
   166     }
       
   167     
       
   168 // -----------------------------------------------------------------------------
       
   169 // Test RemoveReference(...)
       
   170 // -----------------------------------------------------------------------------
       
   171 //
       
   172 void ut_CGlxStaticItemList::T_RemoveReferenceL(  )
       
   173     {
       
   174     TestRemoveReferenceL();
       
   175     }
       
   176 
       
   177 // -----------------------------------------------------------------------------
       
   178 // Test Remove(...)
       
   179 // -----------------------------------------------------------------------------
       
   180 //
       
   181 void ut_CGlxStaticItemList::T_RemoveL() 
       
   182     {
       
   183         { // Test removing first item
       
   184         TNotification::TData notificationStaticItemsDisabled[] = 
       
   185                                { { TNotification::ERemove, 0, 1 }, 
       
   186                                  { END_MARKER } };
       
   187         TNotification::TData notificationStaticItemsEnabled[] = 
       
   188                                { { TNotification::ERemove, 1, 1 }, 
       
   189                                  { END_MARKER } };
       
   190         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   191                                   'a', EFalse,
       
   192                                   _L8("bcdefg"),
       
   193                                   _L8("0bcdefg12"),
       
   194                                   notificationStaticItemsDisabled,
       
   195                                   notificationStaticItemsEnabled,
       
   196                                   info_add_front_0_rear_12 ) );
       
   197         }
       
   198 
       
   199         { // Test removing middle item
       
   200         TNotification::TData notificationStaticItemsDisabled[] = 
       
   201                                { { TNotification::ERemove, 2, 1 }, 
       
   202                                  { END_MARKER } };
       
   203         TNotification::TData notificationStaticItemsEnabled[] = 
       
   204                                { { TNotification::ERemove, 3, 1 }, 
       
   205                                  { END_MARKER } };
       
   206         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   207                                   'c', EFalse,
       
   208                                   _L8("abdefg"),
       
   209                                   _L8("0abdefg12"),
       
   210                                   notificationStaticItemsDisabled,
       
   211                                   notificationStaticItemsEnabled,
       
   212                                   info_add_front_0_rear_12 ) );
       
   213         }
       
   214 
       
   215         { // Test removing last item
       
   216         TNotification::TData notificationStaticItemsDisabled[] = 
       
   217                                { { TNotification::ERemove, 6, 1 }, 
       
   218                                  { END_MARKER } };
       
   219         TNotification::TData notificationStaticItemsEnabled[] = 
       
   220                                { { TNotification::ERemove, 7, 1 }, 
       
   221                                  { END_MARKER } };
       
   222         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   223                                   'g', EFalse,
       
   224                                   _L8("abcdef"),
       
   225                                   _L8("0abcdef12"),
       
   226                                   notificationStaticItemsDisabled,
       
   227                                   notificationStaticItemsEnabled,
       
   228                                   info_add_front_0_rear_12 ) );
       
   229         }
       
   230         
       
   231         { // Test removing front static item
       
   232         TNotification::TData notificationStaticItemsDisabled[] = 
       
   233                                { { END_MARKER } };
       
   234         TNotification::TData notificationStaticItemsEnabled[] = 
       
   235                                { { TNotification::ERemove, 0, 1 }, 
       
   236                                  { END_MARKER } };
       
   237         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   238                                   '0', ETrue,
       
   239                                   _L8("abcdefg"),
       
   240                                   _L8("abcdefg12"),
       
   241                                   notificationStaticItemsDisabled,
       
   242                                   notificationStaticItemsEnabled,
       
   243                                   info_add_front_0_rear_12 ) );
       
   244         }
       
   245         
       
   246         { // Test removing rear static item 1
       
   247         TNotification::TData notificationStaticItemsDisabled[] = 
       
   248                                { { END_MARKER } };
       
   249         TNotification::TData notificationStaticItemsEnabled[] = 
       
   250                                { { TNotification::ERemove, 8, 1 }, 
       
   251                                  { END_MARKER } };
       
   252         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   253                                   '1', ETrue,
       
   254                                   _L8("abcdefg"),
       
   255                                   _L8("0abcdefg2"),
       
   256                                   notificationStaticItemsDisabled,
       
   257                                   notificationStaticItemsEnabled,
       
   258                                   info_add_front_0_rear_12 ) );
       
   259         }
       
   260         
       
   261         { // Test removing rear static item 2
       
   262         TNotification::TData notificationStaticItemsDisabled[] = 
       
   263                                { { END_MARKER } };
       
   264         TNotification::TData notificationStaticItemsEnabled[] = 
       
   265                                { { TNotification::ERemove, 9, 1 }, 
       
   266                                  { END_MARKER } };
       
   267         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   268                                   '2', ETrue,
       
   269                                   _L8("abcdefg"),
       
   270                                   _L8("0abcdefg1"),
       
   271                                   notificationStaticItemsDisabled,
       
   272                                   notificationStaticItemsEnabled,
       
   273                                   info_add_front_0_rear_12 ) );
       
   274         }
       
   275         
       
   276         { // Test removing non-existent static item
       
   277         TNotification::TData notificationStaticItemsDisabled[] = 
       
   278                                { { END_MARKER } };
       
   279         TNotification::TData notificationStaticItemsEnabled[] = 
       
   280                                { { END_MARKER } };
       
   281         EUNIT_ASSERT( TryRemoveL( _L8("abcdefg"),
       
   282                                   '#', ETrue,
       
   283                                   _L8("abcdefg"),
       
   284                                   _L8("0abcdefg12"),
       
   285                                   notificationStaticItemsDisabled,
       
   286                                   notificationStaticItemsEnabled,
       
   287                                   info_add_front_0_rear_12 ) );
       
   288         }
       
   289     }
       
   290 
       
   291 // -----------------------------------------------------------------------------
       
   292 // Test AddStaticItemL(...)
       
   293 // -----------------------------------------------------------------------------
       
   294 //
       
   295 void ut_CGlxStaticItemList::T_AddStaticItemLL(  )
       
   296     {
       
   297         { // Test adding first static item to front, empty list
       
   298         TNotification::TData notifications[] = 
       
   299                                { { TNotification::EAdd, 0, 1 }, 
       
   300                                  { END_MARKER } };
       
   301         EUNIT_ASSERT( TryAddStaticItemL( _L8(""),
       
   302                                   '0', NGlxListDefs::EInsertFirst,
       
   303                                   _L8("0"),
       
   304                                   notifications, notifications,
       
   305                                   info_add_none ) );
       
   306         }
       
   307 
       
   308         { // Test adding first static item to rear, empty list
       
   309         TNotification::TData notifications[] = 
       
   310                                { { TNotification::EAdd, 0, 1 }, 
       
   311                                  { END_MARKER } };
       
   312         EUNIT_ASSERT( TryAddStaticItemL( _L8(""),
       
   313                                   '0', NGlxListDefs::EInsertLast,
       
   314                                   _L8("0"),
       
   315                                   notifications, notifications,
       
   316                                   info_add_none ) );
       
   317         }
       
   318 
       
   319         { // Test adding first static item to rear, empty list
       
   320         TNotification::TData notifications[] = 
       
   321                                { { TNotification::EAdd, 0, 1 }, 
       
   322                                  { END_MARKER } };
       
   323         EUNIT_ASSERT( TryAddStaticItemL( _L8(""),
       
   324                                   '0', NGlxListDefs::EInsertLast,
       
   325                                   _L8("0"),
       
   326                                   notifications, notifications,
       
   327                                   info_add_none ) );
       
   328         }
       
   329 
       
   330         { // Test adding first static item to front
       
   331         TNotification::TData notifications[] = 
       
   332                                { { TNotification::EAdd, 0, 1 }, 
       
   333                                  { END_MARKER } };
       
   334         TNotification::TData notificationsWithAllStaticItems[] = 
       
   335                                { { TNotification::EAdd, 0, 2 }, 
       
   336                                  { TNotification::EAdd, 2, 2 }, 
       
   337                                  { END_MARKER } };
       
   338         EUNIT_ASSERT( TryAddStaticItemL( _L8(""),
       
   339                                   '3', NGlxListDefs::EInsertFirst,
       
   340                                   _L8("3012"),
       
   341                                   notifications, notificationsWithAllStaticItems,
       
   342                                   info_add_front_0_rear_12 ) );
       
   343         }
       
   344         
       
   345         { // Test adding first static item to rear
       
   346         TNotification::TData notifications[] = 
       
   347                                { { TNotification::EAdd, 3, 1 }, 
       
   348                                  { END_MARKER } };
       
   349         TNotification::TData notificationsWithAllStaticItems[] = 
       
   350                                { { TNotification::EAdd, 0, 1 }, 
       
   351                                  { TNotification::EAdd, 1, 3 }, 
       
   352                                  { END_MARKER } };
       
   353         EUNIT_ASSERT( TryAddStaticItemL( _L8(""),
       
   354                                   '3', NGlxListDefs::EInsertLast,
       
   355                                   _L8("0123"),
       
   356                                   notifications, notificationsWithAllStaticItems,
       
   357                                   info_add_front_0_rear_12 ) );
       
   358         }
       
   359 
       
   360         { // Test adding first static item to rear
       
   361         TNotification::TData notifications[] = 
       
   362                                { { TNotification::EAdd, 4, 1 }, 
       
   363                                  { END_MARKER } };
       
   364         EUNIT_ASSERT( TryAddStaticItemL( _L8("abcd"),
       
   365                                   '0', NGlxListDefs::EInsertLast,
       
   366                                   _L8("abcd0"),
       
   367                                   notifications, notifications,
       
   368                                   info_add_none ) );
       
   369         }
       
   370 
       
   371         { // Test adding static item to front
       
   372         TNotification::TData notifications[] = 
       
   373                                { { TNotification::EAdd, 0, 1 }, 
       
   374                                  { END_MARKER } };
       
   375         TNotification::TData notificationsWithAllStaticItems[] = 
       
   376                                { { TNotification::EAdd, 0, 2 }, 
       
   377                                  { TNotification::EAdd, 6, 2 }, 
       
   378                                  { END_MARKER } };
       
   379         EUNIT_ASSERT( TryAddStaticItemL( _L8("abcd"),
       
   380                                   '3', NGlxListDefs::EInsertFirst,
       
   381                                   _L8("30abcd12"),
       
   382                                   notifications, notificationsWithAllStaticItems,
       
   383                                   info_add_front_0_rear_12 ) );
       
   384         }
       
   385 
       
   386     // Test adding a static item that already exists
       
   387 
       
   388         { // Test adding existing static item to front
       
   389         TNotification::TData notifications[] = 
       
   390                                { { END_MARKER } };
       
   391         TNotification::TData notificationsWithAllStaticItems[] = 
       
   392                                { { TNotification::EAdd, 0, 1 }, 
       
   393                                  { TNotification::EAdd, 5, 2 }, 
       
   394                                  { END_MARKER } };
       
   395         EUNIT_ASSERT( TryAddStaticItemL( _L8("abcd"),
       
   396                                   '0', NGlxListDefs::EInsertFirst,
       
   397                                   _L8("0abcd12"),
       
   398                                   notifications, notificationsWithAllStaticItems,
       
   399                                   info_add_front_0_rear_12 ) );
       
   400         }
       
   401 
       
   402         { // Test adding existing static item to rear
       
   403         TNotification::TData notifications[] = 
       
   404                                { { END_MARKER } };
       
   405         TNotification::TData notificationsWithAllStaticItems[] = 
       
   406                                { { TNotification::EAdd, 0, 1 }, 
       
   407                                  { TNotification::EAdd, 5, 2 }, 
       
   408                                  { END_MARKER } };
       
   409         EUNIT_ASSERT( TryAddStaticItemL( _L8("abcd"),
       
   410                                   '2', NGlxListDefs::EInsertLast,
       
   411                                   _L8("0abcd12"),
       
   412                                   notifications, notificationsWithAllStaticItems,
       
   413                                   info_add_front_0_rear_12 ) );
       
   414         }
       
   415 
       
   416     // Test adding a static item that already exists, but in different end of list
       
   417         { // Test adding existing static item to front, when old on is at rear
       
   418         TNotification::TData notifications[] = 
       
   419                                { { TNotification::ERemove, 5, 1 }, 
       
   420                                  { TNotification::EAdd, 0, 1 }, 
       
   421                                  { END_MARKER } };
       
   422         TNotification::TData notificationsWithAllStaticItems[] = 
       
   423                                { { TNotification::EAdd, 0, 2 }, 
       
   424                                  { TNotification::EAdd, 6, 1 }, 
       
   425                                  { END_MARKER } };
       
   426         EUNIT_ASSERT( TryAddStaticItemL( _L8("abcd"),
       
   427                                   '1', NGlxListDefs::EInsertFirst,
       
   428                                   _L8("10abcd2"),
       
   429                                   notifications, notificationsWithAllStaticItems,
       
   430                                   info_add_front_0_rear_12 ) );
       
   431         }
       
   432 
       
   433         { // Test adding existing static item to rear, when old on is at front
       
   434         TNotification::TData notifications[] = 
       
   435                                { { TNotification::ERemove, 0, 1 }, 
       
   436                                  { TNotification::EAdd, 6, 1 }, 
       
   437                                  { END_MARKER } };
       
   438         TNotification::TData notificationsWithAllStaticItems[] = 
       
   439                                { { TNotification::EAdd, 4, 3 }, 
       
   440                                  { END_MARKER } };
       
   441         EUNIT_ASSERT( TryAddStaticItemL( _L8("abcd"),
       
   442                                   '0', NGlxListDefs::EInsertLast,
       
   443                                   _L8("abcd120"),
       
   444                                   notifications, notificationsWithAllStaticItems,
       
   445                                   info_add_front_0_rear_12 ) );
       
   446         }
       
   447     }
       
   448     
       
   449 // -----------------------------------------------------------------------------
       
   450 // Test SetStaticItemsEnabled(...)
       
   451 // -----------------------------------------------------------------------------
       
   452 //
       
   453 void ut_CGlxStaticItemList::T_SetStaticItemsEnabledL(  )
       
   454     {
       
   455     // Test list with no normal items
       
   456         { // Add to front
       
   457         TNotification::TData notificationsForEnable[] = 
       
   458                              { { TNotification::EAdd, 0, 1 },
       
   459                                { END_MARKER } };
       
   460         TNotification::TData notificationsForDisable[] = 
       
   461                              { { TNotification::ERemove, 0, 1 },
       
   462                                { END_MARKER } };
       
   463         EUNIT_ASSERT( TrySetStaticItemsEnabledL( _L8(""), 
       
   464                                                  _L8("0"),
       
   465                                                  info_add_front_0,
       
   466                                                  notificationsForEnable,
       
   467                                                  notificationsForDisable ) );    
       
   468         }
       
   469 
       
   470         { // Add to front
       
   471         TNotification::TData notificationsForEnable[] = 
       
   472                              { { TNotification::EAdd, 0, 2 },
       
   473                                { END_MARKER } };
       
   474         TNotification::TData notificationsForDisable[] = 
       
   475                              { { TNotification::ERemove, 0, 2 },
       
   476                                { END_MARKER } };
       
   477         EUNIT_ASSERT( TrySetStaticItemsEnabledL( _L8(""), 
       
   478                                                  _L8("01"),
       
   479                                                  info_add_front_01,
       
   480                                                  notificationsForEnable,
       
   481                                                  notificationsForDisable ) );    
       
   482         }
       
   483 
       
   484         { // Add to front and rear
       
   485         TNotification::TData notificationsForEnable[] = 
       
   486                              { { TNotification::EAdd, 0, 1 },
       
   487                                { TNotification::EAdd, 1, 2 },
       
   488                                { END_MARKER } };
       
   489         TNotification::TData notificationsForDisable[] = 
       
   490                              { { TNotification::ERemove, 0, 1 },
       
   491                                { TNotification::ERemove, 0, 2 },
       
   492                                { END_MARKER } };
       
   493         EUNIT_ASSERT( TrySetStaticItemsEnabledL( _L8(""), 
       
   494                                                  _L8("012"),
       
   495                                                  info_add_front_0_rear_12,
       
   496                                                  notificationsForEnable,
       
   497                                                  notificationsForDisable ) );    
       
   498         }
       
   499         
       
   500     // Test list with also normal items
       
   501         { // Add to front
       
   502         TNotification::TData notificationsForEnable[] = 
       
   503                              { { TNotification::EAdd, 0, 1 },
       
   504                                { END_MARKER } };
       
   505         TNotification::TData notificationsForDisable[] = 
       
   506                              { { TNotification::ERemove, 0, 1 },
       
   507                                { END_MARKER } };
       
   508         EUNIT_ASSERT( TrySetStaticItemsEnabledL( _L8("abcde"), 
       
   509                                                  _L8("0abcde"),
       
   510                                                  info_add_front_0,
       
   511                                                  notificationsForEnable,
       
   512                                                  notificationsForDisable ) );    
       
   513         }
       
   514 
       
   515         { // Add to front
       
   516         TNotification::TData notificationsForEnable[] = 
       
   517                              { { TNotification::EAdd, 0, 2 },
       
   518                                { END_MARKER } };
       
   519         TNotification::TData notificationsForDisable[] = 
       
   520                              { { TNotification::ERemove, 0, 2 },
       
   521                                { END_MARKER } };
       
   522         EUNIT_ASSERT( TrySetStaticItemsEnabledL( _L8("abcde"), 
       
   523                                                  _L8("01abcde"),
       
   524                                                  info_add_front_01,
       
   525                                                  notificationsForEnable,
       
   526                                                  notificationsForDisable ) );    
       
   527         }
       
   528 
       
   529         { // Add to front and rear
       
   530         TNotification::TData notificationsForEnable[] = 
       
   531                              { { TNotification::EAdd, 0, 1 },
       
   532                                { TNotification::EAdd, 6, 2 },
       
   533                                { END_MARKER } };
       
   534         TNotification::TData notificationsForDisable[] = 
       
   535                              { { TNotification::ERemove, 0, 1 },
       
   536                                { TNotification::ERemove, 5, 2 },
       
   537                                { END_MARKER } };
       
   538         EUNIT_ASSERT( TrySetStaticItemsEnabledL( _L8("abcde"), 
       
   539                                                  _L8("0abcde12"),
       
   540                                                  info_add_front_0_rear_12,
       
   541                                                  notificationsForEnable,
       
   542                                                  notificationsForDisable ) );    
       
   543         }
       
   544     }
       
   545 
       
   546 // -----------------------------------------------------------------------------
       
   547 // Test Count(...)
       
   548 // -----------------------------------------------------------------------------
       
   549 //
       
   550 void ut_CGlxStaticItemList::T_CountL(  )
       
   551     {
       
   552     TestCountL();
       
   553     }
       
   554     
       
   555 // -----------------------------------------------------------------------------
       
   556 // Test Item(...)
       
   557 // -----------------------------------------------------------------------------
       
   558 //
       
   559 void ut_CGlxStaticItemList::T_ItemL(  )
       
   560     {
       
   561     TestItemL();
       
   562     }
       
   563     
       
   564 // -----------------------------------------------------------------------------
       
   565 // Test Index(...)
       
   566 // -----------------------------------------------------------------------------
       
   567 //
       
   568 void ut_CGlxStaticItemList::T_IndexL(  )
       
   569     {
       
   570     TestIndexL();
       
   571     }
       
   572     
       
   573 // -----------------------------------------------------------------------------
       
   574 // Test IdSpaceId
       
   575 // -----------------------------------------------------------------------------
       
   576 //
       
   577 void ut_CGlxStaticItemList::T_IdSpaceIdL()
       
   578     {
       
   579     TestIdSpaceIdL();
       
   580     }    
       
   581     
       
   582 // -----------------------------------------------------------------------------
       
   583 // Test table
       
   584 // -----------------------------------------------------------------------------
       
   585 //
       
   586 EUNIT_BEGIN_TEST_TABLE(
       
   587     ut_CGlxStaticItemList,
       
   588     "Static item list test suite.",
       
   589     "UNIT" )
       
   590     
       
   591 EUNIT_TEST(
       
   592     "AddStaticItemL",
       
   593     "CGlxStaticItemList",
       
   594     "AddStaticItemL",
       
   595     "FUNCTIONALITY",
       
   596     SetupL, T_AddStaticItemLL, Teardown)
       
   597         
       
   598 EUNIT_TEST(
       
   599     "SetStaticItemsEnabled",
       
   600     "CGlxStaticItemList",
       
   601     "SetStaticItemsEnabled",
       
   602     "FUNCTIONALITY",
       
   603     SetupL, T_SetStaticItemsEnabledL, Teardown)
       
   604     
       
   605 EUNIT_TEST(
       
   606     "SetContentsL",
       
   607     "CGlxStaticItemList",
       
   608     "SetContentsL",
       
   609     "FUNCTIONALITY",
       
   610     SetupL, T_SetContentsLL, Teardown)
       
   611     
       
   612 EUNIT_TEST(
       
   613     "Remove",
       
   614     "CGlxStaticItemList",
       
   615     "Remove",
       
   616     "FUNCTIONALITY",
       
   617     SetupL, T_RemoveL, Teardown)
       
   618     
       
   619 EUNIT_TEST(
       
   620     "RemoveReference",
       
   621     "CGlxStaticItemList",
       
   622     "RemoveReference",
       
   623     "FUNCTIONALITY",
       
   624     SetupL, T_RemoveReferenceL, Teardown)
       
   625 
       
   626 EUNIT_TEST(
       
   627     "Count",
       
   628     "CGlxStaticItemList",
       
   629     "Count",
       
   630     "FUNCTIONALITY",
       
   631     SetupL, T_CountL, Teardown)
       
   632     
       
   633 EUNIT_TEST(
       
   634     "Item",
       
   635     "CGlxStaticItemList",
       
   636     "Item",
       
   637     "FUNCTIONALITY",
       
   638     SetupL, T_ItemL, Teardown)
       
   639     
       
   640 EUNIT_TEST(
       
   641     "Index",
       
   642     "CGlxStaticItemList",
       
   643     "Index",
       
   644     "FUNCTIONALITY",
       
   645     SetupL, T_IndexL, Teardown)
       
   646     
       
   647 EUNIT_TEST(
       
   648     "Id space id",
       
   649     "CGlxStaticItemList",
       
   650     "IdSpaceId",
       
   651     "FUNCTIONALITY",
       
   652     SetupL, T_IdSpaceIdL, Teardown)
       
   653         
       
   654 EUNIT_END_TEST_TABLE
       
   655 
       
   656 //  END OF FILE