~ubuntu-branches/ubuntu/maverick/qt4-x11/maverick-security

« back to all changes in this revision

Viewing changes to tests/auto/qvideoframe/tst_qvideoframe.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-07-06 02:43:04 UTC
  • mfrom: (1.1.32 upstream)
  • Revision ID: james.westby@ubuntu.com-20100706024304-xnrnlzeq0r5nggnb
Tags: 4:4.7.0~beta1+git20100706-0ubuntu1
* New upstream snapshot
  - Refresh kubuntu patches
  - libqt4-help replaces qt4-dev-tools (<< 4:4.7.0~beta1+git20100706)
  - qt4-designer replaces qt4-dev-tools (<< 4:4.7.0~beta1+git20100706)
  - Disable kubuntu_08_add_missing_bold_style.diff
  - Disable kubuntu_09_use_ft_glyph_embolden_to_fake_bold.diff
  - New packages:
    - qt4-qmlviewer, which replaces qt4-dev-tools
    - libqt4-declarative-{particles, gestures, folderlistmodel} which
      replaces libqt4-declarative (<< 4:4.7.0~beta1+git20100706)
* Merge with Debian git (unreleased) remaining changes:
  - Do not package firebird and ibase packages, remove from debian/rules and
    debian/control
  - libqt4-sql-ibase not recommend for libqt4-sql
  - libqtgui4: suggest, not recommend, qt4-qtconfig
  - Build with -no-phonon
  - Do not package libqt4-phonon
  - Do not add libpulse-dev to build-depends
  - Do not package libqt4-webkit transitional package
  - Build with -multimedia for now
    - Keep libqt4-multimedia package in debian/control
    - Keep libqt4-multimedia.{install, symbols, lintian-overrides}
  - libqt4-dev recommends libqt4-webkit
  - Build packages with lzma compression with override_dh_builddeb
  - Rules to remove po dir in clean
  - Add MessagesQt.sh
  - Rules to create Messages.sh link to MessagesQt.sh and rules to create po
    dir and exectue extract-messages.sh in common-install-prehook-impl
  - Rules to remove Messages.sh link
  - Make libqt4-dev depend on libx11-dev
  - In debian/rules Set DEB_HOST_ARCH and
    DEB_HOST_ARCH_OS. Configure with "-arch armv6" option on ARM
  - Add Kubuntu patches:
    - kubuntu_08_add_missing_bold_style.diff
    - kubuntu_09_use_ft_glyph_embolden_to_fake_bold.diff
    - kubuntu_10_ibus_input_method.diff
    - kubuntu_12_fix_stack_protector.diff
    - kubuntu_14_qtdemos_compile_failure.diff
    - kubuntu_15_appmenu.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
    void mapImage_data();
80
80
    void mapImage();
81
81
    void imageDetach();
 
82
    void formatConversion_data();
 
83
    void formatConversion();
82
84
};
83
85
 
84
86
Q_DECLARE_METATYPE(QImage::Format)
658
660
    QCOMPARE(image.pixel(4, 4), red);
659
661
}
660
662
 
 
663
void tst_QVideoFrame::formatConversion_data()
 
664
{
 
665
    QTest::addColumn<QImage::Format>("imageFormat");
 
666
    QTest::addColumn<QVideoFrame::PixelFormat>("pixelFormat");
 
667
 
 
668
    QTest::newRow("QImage::Format_RGB32 | QVideoFrame::Format_RGB32")
 
669
            << QImage::Format_RGB32
 
670
            << QVideoFrame::Format_RGB32;
 
671
    QTest::newRow("QImage::Format_ARGB32 | QVideoFrame::Format_ARGB32")
 
672
            << QImage::Format_ARGB32
 
673
            << QVideoFrame::Format_ARGB32;
 
674
    QTest::newRow("QImage::Format_ARGB32_Premultiplied | QVideoFrame::Format_ARGB32_Premultiplied")
 
675
            << QImage::Format_ARGB32_Premultiplied
 
676
            << QVideoFrame::Format_ARGB32_Premultiplied;
 
677
    QTest::newRow("QImage::Format_RGB16 | QVideoFrame::Format_RGB565")
 
678
            << QImage::Format_RGB16
 
679
            << QVideoFrame::Format_RGB565;
 
680
    QTest::newRow("QImage::Format_ARGB8565_Premultiplied | QVideoFrame::Format_ARGB8565_Premultiplied")
 
681
            << QImage::Format_ARGB8565_Premultiplied
 
682
            << QVideoFrame::Format_ARGB8565_Premultiplied;
 
683
    QTest::newRow("QImage::Format_RGB555 | QVideoFrame::Format_RGB555")
 
684
            << QImage::Format_RGB555
 
685
            << QVideoFrame::Format_RGB555;
 
686
    QTest::newRow("QImage::Format_RGB888 | QVideoFrame::Format_RGB24")
 
687
            << QImage::Format_RGB888
 
688
            << QVideoFrame::Format_RGB24;
 
689
 
 
690
    QTest::newRow("QImage::Format_MonoLSB")
 
691
            << QImage::Format_MonoLSB
 
692
            << QVideoFrame::Format_Invalid;
 
693
    QTest::newRow("QImage::Format_Indexed8")
 
694
            << QImage::Format_Indexed8
 
695
            << QVideoFrame::Format_Invalid;
 
696
    QTest::newRow("QImage::Format_ARGB6666_Premultiplied")
 
697
            << QImage::Format_ARGB6666_Premultiplied
 
698
            << QVideoFrame::Format_Invalid;
 
699
    QTest::newRow("QImage::Format_ARGB8555_Premultiplied")
 
700
            << QImage::Format_ARGB8555_Premultiplied
 
701
            << QVideoFrame::Format_Invalid;
 
702
    QTest::newRow("QImage::Format_RGB666")
 
703
            << QImage::Format_RGB666
 
704
            << QVideoFrame::Format_Invalid;
 
705
    QTest::newRow("QImage::Format_RGB444")
 
706
            << QImage::Format_RGB444
 
707
            << QVideoFrame::Format_Invalid;
 
708
    QTest::newRow("QImage::Format_ARGB4444_Premultiplied")
 
709
            << QImage::Format_ARGB4444_Premultiplied
 
710
            << QVideoFrame::Format_Invalid;
 
711
 
 
712
    QTest::newRow("QVideoFrame::Format_BGRA32")
 
713
            << QImage::Format_Invalid
 
714
            << QVideoFrame::Format_BGRA32;
 
715
    QTest::newRow("QVideoFrame::Format_BGRA32_Premultiplied")
 
716
            << QImage::Format_Invalid
 
717
            << QVideoFrame::Format_BGRA32_Premultiplied;
 
718
    QTest::newRow("QVideoFrame::Format_BGR32")
 
719
            << QImage::Format_Invalid
 
720
            << QVideoFrame::Format_BGR32;
 
721
    QTest::newRow("QVideoFrame::Format_BGR24")
 
722
            << QImage::Format_Invalid
 
723
            << QVideoFrame::Format_BGR24;
 
724
    QTest::newRow("QVideoFrame::Format_BGR565")
 
725
            << QImage::Format_Invalid
 
726
            << QVideoFrame::Format_BGR565;
 
727
    QTest::newRow("QVideoFrame::Format_BGR555")
 
728
            << QImage::Format_Invalid
 
729
            << QVideoFrame::Format_BGR555;
 
730
    QTest::newRow("QVideoFrame::Format_BGRA5658_Premultiplied")
 
731
            << QImage::Format_Invalid
 
732
            << QVideoFrame::Format_BGRA5658_Premultiplied;
 
733
    QTest::newRow("QVideoFrame::Format_AYUV444")
 
734
            << QImage::Format_Invalid
 
735
            << QVideoFrame::Format_AYUV444;
 
736
    QTest::newRow("QVideoFrame::Format_AYUV444_Premultiplied")
 
737
            << QImage::Format_Invalid
 
738
            << QVideoFrame::Format_AYUV444_Premultiplied;
 
739
    QTest::newRow("QVideoFrame::Format_YUV444")
 
740
            << QImage::Format_Invalid
 
741
            << QVideoFrame::Format_YUV420P;
 
742
    QTest::newRow("QVideoFrame::Format_YV12")
 
743
            << QImage::Format_Invalid
 
744
            << QVideoFrame::Format_YV12;
 
745
    QTest::newRow("QVideoFrame::Format_UYVY")
 
746
            << QImage::Format_Invalid
 
747
            << QVideoFrame::Format_UYVY;
 
748
    QTest::newRow("QVideoFrame::Format_YUYV")
 
749
            << QImage::Format_Invalid
 
750
            << QVideoFrame::Format_YUYV;
 
751
    QTest::newRow("QVideoFrame::Format_NV12")
 
752
            << QImage::Format_Invalid
 
753
            << QVideoFrame::Format_NV12;
 
754
    QTest::newRow("QVideoFrame::Format_NV21")
 
755
            << QImage::Format_Invalid
 
756
            << QVideoFrame::Format_NV21;
 
757
    QTest::newRow("QVideoFrame::Format_IMC1")
 
758
            << QImage::Format_Invalid
 
759
            << QVideoFrame::Format_IMC1;
 
760
    QTest::newRow("QVideoFrame::Format_IMC2")
 
761
            << QImage::Format_Invalid
 
762
            << QVideoFrame::Format_IMC2;
 
763
    QTest::newRow("QVideoFrame::Format_IMC3")
 
764
            << QImage::Format_Invalid
 
765
            << QVideoFrame::Format_IMC3;
 
766
    QTest::newRow("QVideoFrame::Format_IMC4")
 
767
            << QImage::Format_Invalid
 
768
            << QVideoFrame::Format_IMC4;
 
769
    QTest::newRow("QVideoFrame::Format_Y8")
 
770
            << QImage::Format_Invalid
 
771
            << QVideoFrame::Format_Y8;
 
772
    QTest::newRow("QVideoFrame::Format_Y16")
 
773
            << QImage::Format_Invalid
 
774
            << QVideoFrame::Format_Y16;
 
775
}
 
776
 
 
777
void tst_QVideoFrame::formatConversion()
 
778
{
 
779
    QFETCH(QImage::Format, imageFormat);
 
780
    QFETCH(QVideoFrame::PixelFormat, pixelFormat);
 
781
 
 
782
    QCOMPARE(QVideoFrame::pixelFormatFromImageFormat(imageFormat) == pixelFormat,
 
783
              imageFormat != QImage::Format_Invalid);
 
784
 
 
785
    QCOMPARE(QVideoFrame::imageFormatFromPixelFormat(pixelFormat) == imageFormat,
 
786
             pixelFormat != QVideoFrame::Format_Invalid);
 
787
}
 
788
 
661
789
QTEST_MAIN(tst_QVideoFrame)
662
790
 
663
791
#include "tst_qvideoframe.moc"