photosgallery/viewframework/medialists/tsrc/ut_cglxattributecontext/ut_cglxattributecontext.cpp
branchRCL_3
changeset 14 2dac0fdba72b
parent 13 bcb43dc84c44
equal deleted inserted replaced
13:bcb43dc84c44 14:2dac0fdba72b
   197     EUNIT_ASSERT(attributes.Count() == 0);
   197     EUNIT_ASSERT(attributes.Count() == 0);
   198 
   198 
   199     delete attributeSpecs;
   199     delete attributeSpecs;
   200     attributeSpecs = NULL;
   200     attributeSpecs = NULL;
   201 
   201 
   202     CleanupStack::Pop( attributes );
   202     CleanupStack::Pop( &attributes );
   203     attributes.Close();
   203     attributes.Close();
   204 
   204 
   205     CleanupStack::Pop( itemIndices );
   205     CleanupStack::Pop( &itemIndices );
   206     itemIndices.Close();
   206     itemIndices.Close();
   207 
   207 
   208     CleanupStack::PopAndDestroy( mediaList );
   208     CleanupStack::PopAndDestroy( &mediaList );
   209     }
   209     }
   210 
   210 
   211 void UT_CGlxAttributeContext::FetchOneItem_IndexZeroL()
   211 void UT_CGlxAttributeContext::FetchOneItem_IndexZeroL()
   212     {
   212     {
   213     // Fetch 1 item with focus on index 0
   213     // Fetch 1 item with focus on index 0
   238     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   238     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   239 
   239 
   240     delete attributeSpecs;
   240     delete attributeSpecs;
   241     attributeSpecs = NULL;
   241     attributeSpecs = NULL;
   242 
   242 
   243     CleanupStack::Pop(attributes);
   243     CleanupStack::Pop(&attributes);
   244     attributes.Close();
   244     attributes.Close();
   245 
   245 
   246     CleanupStack::Pop(itemIndices);
   246     CleanupStack::Pop(&itemIndices);
   247     itemIndices.Close();
   247     itemIndices.Close();
   248 
   248 
   249     CleanupStack::PopAndDestroy(mediaList);
   249     CleanupStack::PopAndDestroy(&mediaList);
   250     }
   250     }
   251 
   251 
   252 void UT_CGlxAttributeContext::FetchOneItem_IndexOneL()
   252 void UT_CGlxAttributeContext::FetchOneItem_IndexOneL()
   253     {
   253     {
   254     // Fetch 1 item with focus on index 1
   254     // Fetch 1 item with focus on index 1
   279     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   279     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   280 
   280 
   281     delete attributeSpecs;
   281     delete attributeSpecs;
   282     attributeSpecs = NULL;
   282     attributeSpecs = NULL;
   283 
   283 
   284     CleanupStack::Pop(attributes);
   284     CleanupStack::Pop(&attributes);
   285     attributes.Close();
   285     attributes.Close();
   286 
   286 
   287     CleanupStack::Pop(itemIndices);
   287     CleanupStack::Pop(&itemIndices);
   288     itemIndices.Close();
   288     itemIndices.Close();
   289 
   289 
   290     CleanupStack::PopAndDestroy(mediaList);
   290     CleanupStack::PopAndDestroy(&mediaList);
   291     }
   291     }
   292 
   292 
   293 void UT_CGlxAttributeContext::FetchOneItem_IndexTwoL()
   293 void UT_CGlxAttributeContext::FetchOneItem_IndexTwoL()
   294     {
   294     {
   295     // Fetch 1 item with focus on index 2
   295     // Fetch 1 item with focus on index 2
   320     EUNIT_ASSERT((attributes.Count() == 1) && !titleAttributeFound && dateAttributeFound);
   320     EUNIT_ASSERT((attributes.Count() == 1) && !titleAttributeFound && dateAttributeFound);
   321 
   321 
   322     delete attributeSpecs;
   322     delete attributeSpecs;
   323     attributeSpecs = NULL;
   323     attributeSpecs = NULL;
   324 
   324 
   325     CleanupStack::Pop(attributes);
   325     CleanupStack::Pop(&attributes);
   326     attributes.Close();
   326     attributes.Close();
   327 
   327 
   328     CleanupStack::Pop(itemIndices);
   328     CleanupStack::Pop(&itemIndices);
   329     itemIndices.Close();
   329     itemIndices.Close();
   330 
   330 
   331     CleanupStack::PopAndDestroy(mediaList);
   331     CleanupStack::PopAndDestroy(&mediaList);
   332     }
   332     }
   333 
   333 
   334 void UT_CGlxAttributeContext::FetchOneItem_IndexThreeL()
   334 void UT_CGlxAttributeContext::FetchOneItem_IndexThreeL()
   335     {
   335     {
   336     // Fetch 1 item with focus on index 3
   336     // Fetch 1 item with focus on index 3
   361     EUNIT_ASSERT((attributes.Count() == 1) && titleAttributeFound && !dateAttributeFound);
   361     EUNIT_ASSERT((attributes.Count() == 1) && titleAttributeFound && !dateAttributeFound);
   362 
   362 
   363     delete attributeSpecs;
   363     delete attributeSpecs;
   364     attributeSpecs = NULL;
   364     attributeSpecs = NULL;
   365 
   365 
   366     CleanupStack::Pop(attributes);
   366     CleanupStack::Pop(&attributes);
   367     attributes.Close();
   367     attributes.Close();
   368 
   368 
   369     CleanupStack::Pop(itemIndices);
   369     CleanupStack::Pop(&itemIndices);
   370     itemIndices.Close();
   370     itemIndices.Close();
   371 
   371 
   372     CleanupStack::PopAndDestroy(mediaList);
   372     CleanupStack::PopAndDestroy(&mediaList);
   373     }
   373     }
   374 
   374 
   375 void UT_CGlxAttributeContext::FetchOneItem_IndexFourL()
   375 void UT_CGlxAttributeContext::FetchOneItem_IndexFourL()
   376     {
   376     {
   377     // Fetch 1 item with focus on index 4
   377     // Fetch 1 item with focus on index 4
   402     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   402     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   403 
   403 
   404     delete attributeSpecs;
   404     delete attributeSpecs;
   405     attributeSpecs = NULL;
   405     attributeSpecs = NULL;
   406 
   406 
   407     CleanupStack::Pop(attributes);
   407     CleanupStack::Pop(&attributes);
   408     attributes.Close();
   408     attributes.Close();
   409 
   409 
   410     CleanupStack::Pop(itemIndices);
   410     CleanupStack::Pop(&itemIndices);
   411     itemIndices.Close();
   411     itemIndices.Close();
   412 
   412 
   413     CleanupStack::PopAndDestroy(mediaList);
   413     CleanupStack::PopAndDestroy(&mediaList);
   414     }
   414     }
   415 
   415 
   416 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexZeroL()
   416 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexZeroL()
   417     {
   417     {
   418     // Fetch items with focus on index 0 (granularity less than range)
   418     // Fetch items with focus on index 0 (granularity less than range)
   443     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   443     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   444 
   444 
   445     delete attributeSpecs;
   445     delete attributeSpecs;
   446     attributeSpecs = NULL;
   446     attributeSpecs = NULL;
   447 
   447 
   448     CleanupStack::Pop(attributes);
   448     CleanupStack::Pop(&attributes);
   449     attributes.Close();
   449     attributes.Close();
   450 
   450 
   451     CleanupStack::Pop(itemIndices);
   451     CleanupStack::Pop(&itemIndices);
   452     itemIndices.Close();
   452     itemIndices.Close();
   453 
   453 
   454     CleanupStack::PopAndDestroy(mediaList);
   454     CleanupStack::PopAndDestroy(&mediaList);
   455     }
   455     }
   456 
   456 
   457 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexOneL()
   457 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexOneL()
   458     {
   458     {
   459     // Fetch items with focus on index 1 (granularity less than range)
   459     // Fetch items with focus on index 1 (granularity less than range)
   484     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   484     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   485 
   485 
   486     delete attributeSpecs;
   486     delete attributeSpecs;
   487     attributeSpecs = NULL;
   487     attributeSpecs = NULL;
   488 
   488 
   489     CleanupStack::Pop(attributes);
   489     CleanupStack::Pop(&attributes);
   490     attributes.Close();
   490     attributes.Close();
   491 
   491 
   492     CleanupStack::Pop(itemindices);
   492     CleanupStack::Pop(&itemIndices);
   493     itemIndices.Close();
   493     itemIndices.Close();
   494 
   494 
   495     CleanupStack::PopAndDestroy(mediaList);
   495     CleanupStack::PopAndDestroy(&mediaList);
   496     }
   496     }
   497 
   497 
   498 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexTwoL()
   498 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexTwoL()
   499     {
   499     {
   500     // Fetch items with focus on index 2 (granularity less than range)
   500     // Fetch items with focus on index 2 (granularity less than range)
   525     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   525     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   526 
   526 
   527     delete attributeSpecs;
   527     delete attributeSpecs;
   528     attributeSpecs = NULL;
   528     attributeSpecs = NULL;
   529 
   529 
   530     CleanupStack::Pop(attributes);
   530     CleanupStack::Pop(&attributes);
   531     attributes.Close();
   531     attributes.Close();
   532 
   532 
   533     CleanupStack::Pop(itemIndices);
   533     CleanupStack::Pop(&itemIndices);
   534     itemIndices.Close();
   534     itemIndices.Close();
   535 
   535 
   536     CleanupStack::PopAndDestroy(mediaList);
   536     CleanupStack::PopAndDestroy(&mediaList);
   537     }
   537     }
   538 
   538 
   539 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexThreeL()
   539 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexThreeL()
   540     {
   540     {
   541     // Fetch items with focus on index 3 (granularity less than range)
   541     // Fetch items with focus on index 3 (granularity less than range)
   566     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   566     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   567 
   567 
   568     delete attributeSpecs;
   568     delete attributeSpecs;
   569     attributeSpecs = NULL;
   569     attributeSpecs = NULL;
   570 
   570 
   571     CleanupStack::Pop(attributes);
   571     CleanupStack::Pop(&attributes);
   572     attributes.Close();
   572     attributes.Close();
   573 
   573 
   574     CleanupStack::Pop(itemIndices);
   574     CleanupStack::Pop(&itemIndices);
   575     itemIndices.Close();
   575     itemIndices.Close();
   576 
   576 
   577     CleanupStack::PopAndDestroy(mediaList);
   577     CleanupStack::PopAndDestroy(&mediaList);
   578     }
   578     }
   579 
   579 
   580 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexFourL()
   580 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexFourL()
   581     {
   581     {
   582     // Fetch items with focus on index 4 (granularity less than range)
   582     // Fetch items with focus on index 4 (granularity less than range)
   607     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   607     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   608 
   608 
   609     delete attributeSpecs;
   609     delete attributeSpecs;
   610     attributeSpecs = NULL;
   610     attributeSpecs = NULL;
   611 
   611 
   612     CleanupStack::Pop(attributes);
   612     CleanupStack::Pop(&attributes);
   613     attributes.Close();
   613     attributes.Close();
   614 
   614 
   615     CleanupStack::Pop(itemIndices);
   615     CleanupStack::Pop(&itemIndices);
   616     itemIndices.Close();
   616     itemIndices.Close();
   617 
   617 
   618     CleanupStack::PopAndDestroy(mediaList);
   618     CleanupStack::PopAndDestroy(&mediaList);
   619     }
   619     }
   620 
   620 
   621 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexFiveL()
   621 void UT_CGlxAttributeContext::FetchItems_GranularityLessThanRange_IndexFiveL()
   622     {
   622     {
   623     // Fetch items with focus on index 5 (granularity less than range)
   623     // Fetch items with focus on index 5 (granularity less than range)
   648     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   648     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   649 
   649 
   650     delete attributeSpecs;
   650     delete attributeSpecs;
   651     attributeSpecs = NULL;
   651     attributeSpecs = NULL;
   652 
   652 
   653     CleanupStack::Pop(attributes);
   653     CleanupStack::Pop(&attributes);
   654     attributes.Close();
   654     attributes.Close();
   655 
   655 
   656     CleanupStack::Pop(itemIndices);
   656     CleanupStack::Pop(&itemIndices);
   657     itemIndices.Close();
   657     itemIndices.Close();
   658 
   658 
   659     CleanupStack::PopAndDestroy(mediaList);
   659     CleanupStack::PopAndDestroy(&mediaList);
   660     }
   660     }
   661 
   661 
   662 void UT_CGlxAttributeContext::FetchItems_GranularityGreaterThanRangeL()
   662 void UT_CGlxAttributeContext::FetchItems_GranularityGreaterThanRangeL()
   663     {
   663     {
   664     // Fetch items with focus on index 4 (granularity greater than range)
   664     // Fetch items with focus on index 4 (granularity greater than range)
   689     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   689     EUNIT_ASSERT((attributes.Count() == 2) && titleAttributeFound && dateAttributeFound);
   690 
   690 
   691     delete attributeSpecs;
   691     delete attributeSpecs;
   692     attributeSpecs = NULL;
   692     attributeSpecs = NULL;
   693 
   693 
   694     CleanupStack::Pop(attributes);
   694     CleanupStack::Pop(&attributes);
   695     attributes.Close();
   695     attributes.Close();
   696 
   696 
   697     CleanupStack::Pop(itemIndices);
   697     CleanupStack::Pop(&itemIndices);
   698     itemIndices.Close();
   698     itemIndices.Close();
   699 
   699 
   700     CleanupStack::PopAndDestroy(mediaList);
   700     CleanupStack::PopAndDestroy(&mediaList);
   701     }
   701     }
   702 
   702 
   703 TBool UT_CGlxAttributeContext::FindAttribute(RArray<TMPXAttribute>& aAttributes, const TMPXAttribute& aAttribute)
   703 TBool UT_CGlxAttributeContext::FindAttribute(RArray<TMPXAttribute>& aAttributes, const TMPXAttribute& aAttribute)
   704     {
   704     {
   705     TIdentityRelation<TMPXAttribute> match(&TMPXAttribute::Match);
   705     TIdentityRelation<TMPXAttribute> match(&TMPXAttribute::Match);