516 QVERIFY(sortOrder == Qt::DescendingOrder); |
517 QVERIFY(sortOrder == Qt::DescendingOrder); |
517 |
518 |
518 } |
519 } |
519 |
520 |
520 // ----------------------------------------------------------------------------- |
521 // ----------------------------------------------------------------------------- |
521 // testGetServiceIconStrings |
522 // testGetCenRepStringValue |
522 // ----------------------------------------------------------------------------- |
523 // ----------------------------------------------------------------------------- |
523 // |
524 // |
524 void TestVideoVideoCollectionViewUtils::testGetServiceIconStrings() |
525 void TestVideoVideoCollectionViewUtils::testGetCenRepStringValue() |
525 { |
526 { |
526 VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance()); |
527 |
527 CRepository::setNewLLeave(true); |
528 } |
528 _LIT(KExpectedTDesValue, "expected"); |
529 |
529 CRepository::setTDesValue(KExpectedTDesValue()); |
530 // ----------------------------------------------------------------------------- |
530 QString expected((QChar*)KExpectedTDesValue().Ptr(),KExpectedTDesValue().Length()); |
531 // testGetCenRepIntValue |
531 |
532 // ----------------------------------------------------------------------------- |
532 QString icon; |
533 // |
533 QString pressed; |
534 void TestVideoVideoCollectionViewUtils::testGetCenRepIntValue() |
534 QVERIFY(testObject.getServiceIconStrings(icon, pressed) < 0); |
535 { |
535 QVERIFY(icon.isNull()); |
536 |
536 QVERIFY(pressed.isNull()); |
|
537 |
|
538 CRepository::setNewLLeave(false); |
|
539 CRepository::setGetFail(0); |
|
540 QVERIFY(testObject.getServiceIconStrings(icon, pressed) < 0); |
|
541 QVERIFY(icon.isNull()); |
|
542 QVERIFY(pressed.isNull()); |
|
543 |
|
544 CRepository::setGetFail(1); |
|
545 QVERIFY(testObject.getServiceIconStrings(icon, pressed) < 0); |
|
546 QVERIFY(icon.isNull()); |
|
547 QVERIFY(pressed.isNull()); |
|
548 |
|
549 CRepository::setGetFail(255); |
|
550 QVERIFY(testObject.getServiceIconStrings(icon, pressed) == 0); |
|
551 QCOMPARE(icon, expected); |
|
552 QCOMPARE(pressed, expected); |
|
553 } |
|
554 |
|
555 // ----------------------------------------------------------------------------- |
|
556 // testGetServiceIconStrings |
|
557 // ----------------------------------------------------------------------------- |
|
558 // |
|
559 void TestVideoVideoCollectionViewUtils::testGetServiceUriString() |
|
560 { |
|
561 VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance()); |
|
562 CRepository::setNewLLeave(true); |
|
563 _LIT(KExpectedTDesValue, "expected"); |
|
564 CRepository::setTDesValue(KExpectedTDesValue()); |
|
565 QString expected((QChar*)KExpectedTDesValue().Ptr(),KExpectedTDesValue().Length()); |
|
566 |
|
567 QVERIFY(testObject.getServiceUriString().isNull()); |
|
568 |
|
569 CRepository::setNewLLeave(false); |
|
570 CRepository::setGetFail(0); |
|
571 QVERIFY(testObject.getServiceUriString().isNull()); |
|
572 |
|
573 CRepository::setGetFail(255); |
|
574 QCOMPARE(testObject.getServiceUriString(), expected); |
|
575 } |
537 } |
576 |
538 |
577 // ----------------------------------------------------------------------------- |
539 // ----------------------------------------------------------------------------- |
578 // testInitListView |
540 // testInitListView |
579 // ----------------------------------------------------------------------------- |
541 // ----------------------------------------------------------------------------- |