serviceproviders/sapi_mediamanagement/tsrc/testing/tmediaprovidertesting/src/tmediaprovidertestingImpl.cpp
equal
deleted
inserted
replaced
61 iFiletype = EStreamingURLFile; |
61 iFiletype = EStreamingURLFile; |
62 } |
62 } |
63 else if(inpFileType.CompareF(KFileTypeMusic) == 0) |
63 else if(inpFileType.CompareF(KFileTypeMusic) == 0) |
64 { |
64 { |
65 iFiletype = EMusicFile; |
65 iFiletype = EMusicFile; |
|
66 } |
|
67 else if(inpFileType.CompareF(KFileTypeImage) == 0) |
|
68 { |
|
69 iFiletype = EImageFile; |
|
70 iLog->Log(_L("file type is image")); |
66 } |
71 } |
67 //check for expected key |
72 //check for expected key |
68 //if it is there then get the expected result and put it into the map. |
73 //if it is there then get the expected result and put it into the map. |
69 if(expectedStart.CompareF(KExpectedStart) == 0) |
74 if(expectedStart.CompareF(KExpectedStart) == 0) |
70 { |
75 { |
188 { |
193 { |
189 TInt fileSize = -1; |
194 TInt fileSize = -1; |
190 aItem.GetNextInt(fileSize); |
195 aItem.GetNextInt(fileSize); |
191 expectedOutPutMap->InsertL(insertKey, (TInt32)fileSize); |
196 expectedOutPutMap->InsertL(insertKey, (TInt32)fileSize); |
192 } |
197 } |
|
198 else if(key.CompareF(_L("XPixels"))==0 || key.CompareF(_L("YPixels"))==0) |
|
199 { |
|
200 TInt resolution = -1; |
|
201 aItem.GetNextInt(resolution); |
|
202 expectedOutPutMap->InsertL(insertKey, (TInt32)resolution); |
|
203 } |
193 else |
204 else |
194 { |
205 { |
195 aItem.GetNextString(nextString); |
206 aItem.GetNextString(nextString); |
196 value.Set(nextString); |
207 value.Set(nextString); |
197 expectedOutPutMap->InsertL(insertKey, value); |
208 expectedOutPutMap->InsertL(insertKey, value); |
237 if(index<prevFoundIndex) |
248 if(index<prevFoundIndex) |
238 { |
249 { |
239 iLog->Log(_L("Result Not in Expected sort order")); |
250 iLog->Log(_L("Result Not in Expected sort order")); |
240 User::Leave(KErrGeneral); |
251 User::Leave(KErrGeneral); |
241 } |
252 } |
242 iLog->Log(_L("Map is in sorted order with positio ")); // Lok |
253 iLog->Log(_L("Map is in sorted order with position ")); // Lok |
243 TBuf<10>buf; |
254 TBuf<10>buf; |
244 buf.Num(index); |
255 buf.Num(index); |
245 iLog->Log(buf); |
256 iLog->Log(buf); |
246 buf.Zero(); |
257 buf.Zero(); |
247 prevFoundIndex = index; |
258 prevFoundIndex = index; |
297 return EFalse; |
308 return EFalse; |
298 } |
309 } |
299 if(!CompareTTimeResult(KMgFileDate, aExpectedMap, aResultMap)) |
310 if(!CompareTTimeResult(KMgFileDate, aExpectedMap, aResultMap)) |
300 { |
311 { |
301 return EFalse; |
312 return EFalse; |
302 } |
313 } |
|
314 |
|
315 //Image Files |
|
316 if(iFiletype == EImageFile) |
|
317 { |
|
318 if(!CompareTIntResult(KXPixels, aExpectedMap, aResultMap)) |
|
319 { |
|
320 iLog->Log(_L("Expected and Returned XPixel values do not match")); |
|
321 return EFalse; |
|
322 } |
|
323 |
|
324 if(!CompareTIntResult(KYPixels, aExpectedMap, aResultMap)) |
|
325 { |
|
326 iLog->Log(_L("Expected and Returned YPixel values do not match")); |
|
327 return EFalse; |
|
328 } |
|
329 } |
|
330 |
303 //In case of streamingURL file check for few additional keys. |
331 //In case of streamingURL file check for few additional keys. |
304 if(iFiletype == EStreamingURLFile) |
332 if(iFiletype == EStreamingURLFile) |
305 { |
333 { |
306 if(!CompareStringResult(KMgLinkFirstURL, aExpectedMap, aResultMap)) |
334 if(!CompareStringResult(KMgLinkFirstURL, aExpectedMap, aResultMap)) |
307 { |
335 { |
393 */ |
421 */ |
394 TBool Ctmediaprovidertesting::CompareTTimeResult(const TDesC8& aKey, |
422 TBool Ctmediaprovidertesting::CompareTTimeResult(const TDesC8& aKey, |
395 CLiwMap* aExpectedMap, |
423 CLiwMap* aExpectedMap, |
396 const CLiwMap* aResultMap) |
424 const CLiwMap* aResultMap) |
397 { |
425 { |
398 iLog->Log(_L("Inside CompareStringResult")); |
426 iLog->Log(_L("Inside CompareTTimeResult")); |
399 TLiwVariant expValue; |
427 TLiwVariant expValue; |
400 TLiwVariant resValue; |
428 TLiwVariant resValue; |
401 TBool equal = EFalse; |
429 TBool equal = EFalse; |
402 TBuf<255> timeString; |
430 TBuf<255> timeString; |
403 |
431 |