diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-10 08:56:35 +0200 |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-10 08:56:35 +0200 |
commit | f61ec84fc296c6f70011e30788ee511d6b6a18c6 (patch) | |
tree | 54b3b81ac83570e65dc9b44b6756005f6ba1efde /tests/auto/qcssparser | |
parent | cc0a411e5e874aa224c26298a109973cb15ea291 (diff) | |
parent | d13418effc5f00474541ae513a30c9a42c2a1cb3 (diff) | |
download | qt4-tools-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.gz |
Merge commit 'qt/master-stable'
Conflicts:
src/corelib/kernel/qobject.cpp
src/corelib/tools/qsharedpointer_impl.h
src/gui/widgets/qdatetimeedit.cpp
src/gui/widgets/qlinecontrol.cpp
src/gui/widgets/qlineedit.cpp
tests/auto/qcssparser/qcssparser.pro
tests/auto/qicoimageformat/tst_qicoimageformat.cpp
tests/auto/qmultiscreen/qmultiscreen.pro
tests/auto/qresourceengine/qresourceengine.pro
tests/auto/qresourceengine/tst_qresourceengine.cpp
tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
Diffstat (limited to 'tests/auto/qcssparser')
-rw-r--r-- | tests/auto/qcssparser/qcssparser.pro | 2 | ||||
-rw-r--r-- | tests/auto/qcssparser/tst_qcssparser.cpp (renamed from tests/auto/qcssparser/tst_cssparser.cpp) | 92 |
2 files changed, 49 insertions, 45 deletions
diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index 84ee42502c..ce1281fd39 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -1,5 +1,5 @@ load(qttest_p4) -SOURCES += tst_cssparser.cpp +SOURCES += tst_qcssparser.cpp QT += xml requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_qcssparser.cpp index 9870ec2191..fcb29b3aa8 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_qcssparser.cpp @@ -46,7 +46,7 @@ #include "private/qcssparser_p.h" -class tst_CssParser : public QObject +class tst_QCssParser : public QObject { Q_OBJECT private slots: @@ -93,7 +93,7 @@ private slots: void quotedAndUnquotedIdentifiers(); }; -void tst_CssParser::scanner_data() +void tst_QCssParser::scanner_data() { QTest::addColumn<QString>("input"); QTest::addColumn<QString>("output"); @@ -166,7 +166,7 @@ static void debug(const QVector<QCss::Symbol> &symbols, int index = -1) //static void debug(const QCss::Parser &p) { debug(p.symbols); } -void tst_CssParser::scanner() +void tst_QCssParser::scanner() { QFETCH(QString, input); QFETCH(QString, output); @@ -215,7 +215,7 @@ void tst_CssParser::scanner() Q_DECLARE_METATYPE(QCss::Value) -void tst_CssParser::term_data() +void tst_QCssParser::term_data() { QTest::addColumn<bool>("parseSuccess"); QTest::addColumn<QString>("css"); @@ -330,7 +330,7 @@ void tst_CssParser::term_data() QTest::newRow("ItaLIc") << true << "ItaLIc" << val; } -void tst_CssParser::term() +void tst_QCssParser::term() { QFETCH(bool, parseSuccess); QFETCH(QString, css); @@ -351,7 +351,7 @@ void tst_CssParser::term() Q_DECLARE_METATYPE(QVector<QCss::Value>) -void tst_CssParser::expr_data() +void tst_QCssParser::expr_data() { QTest::addColumn<bool>("parseSuccess"); QTest::addColumn<QString>("css"); @@ -376,7 +376,7 @@ void tst_CssParser::expr_data() values.clear(); } -void tst_CssParser::expr() +void tst_QCssParser::expr() { QFETCH(bool, parseSuccess); QFETCH(QString, css); @@ -396,7 +396,7 @@ void tst_CssParser::expr() } } -void tst_CssParser::import() +void tst_QCssParser::import() { QCss::Parser parser("@import \"plainstring\";"); QVERIFY(parser.testImport()); @@ -413,7 +413,7 @@ void tst_CssParser::import() QCOMPARE(rule.media.at(1), QString("screen")); } -void tst_CssParser::media() +void tst_QCssParser::media() { QCss::Parser parser("@media print/*comment*/,screen /*comment to ignore*/{ }"); QVERIFY(parser.testMedia()); @@ -425,7 +425,7 @@ void tst_CssParser::media() QVERIFY(rule.styleRules.isEmpty()); } -void tst_CssParser::page() +void tst_QCssParser::page() { QCss::Parser parser("@page :first/*comment to ignore*/{ }"); QVERIFY(parser.testPage()); @@ -435,7 +435,7 @@ void tst_CssParser::page() QVERIFY(rule.declarations.isEmpty()); } -void tst_CssParser::ruleset() +void tst_QCssParser::ruleset() { { QCss::Parser parser("p/*foo*/{ }"); @@ -483,7 +483,7 @@ void tst_CssParser::ruleset() Q_DECLARE_METATYPE(QCss::Selector) -void tst_CssParser::selector_data() +void tst_QCssParser::selector_data() { QTest::addColumn<QString>("css"); QTest::addColumn<QCss::Selector>("expectedSelector"); @@ -685,7 +685,7 @@ void tst_CssParser::selector_data() } } -void tst_CssParser::selector() +void tst_QCssParser::selector() { QFETCH(QString, css); QFETCH(QCss::Selector, expectedSelector); @@ -717,7 +717,7 @@ void tst_CssParser::selector() } } -void tst_CssParser::prio() +void tst_QCssParser::prio() { { QCss::Parser parser("!important"); @@ -739,14 +739,14 @@ void tst_CssParser::prio() } } -void tst_CssParser::escapes() +void tst_QCssParser::escapes() { QCss::Parser parser("\\hello"); parser.test(QCss::IDENT); QCOMPARE(parser.lexem(), QString("hello")); } -void tst_CssParser::malformedDeclarations_data() +void tst_QCssParser::malformedDeclarations_data() { QTest::addColumn<QString>("css"); @@ -759,7 +759,7 @@ void tst_CssParser::malformedDeclarations_data() QTest::newRow("7") << QString("p { color:red; color{;color:maroon}; color:green } /* same with recovery */"); } -void tst_CssParser::malformedDeclarations() +void tst_QCssParser::malformedDeclarations() { QFETCH(QString, css); QCss::Parser parser(css); @@ -778,7 +778,7 @@ void tst_CssParser::malformedDeclarations() QCOMPARE(rule.declarations.last().d->values.at(0).variant.toString(), QString("green")); } -void tst_CssParser::invalidAtKeywords() +void tst_QCssParser::invalidAtKeywords() { QCss::Parser parser("" "@three-dee {" @@ -810,7 +810,7 @@ void tst_CssParser::invalidAtKeywords() Q_DECLARE_METATYPE(QColor) -void tst_CssParser::colorValue_data() +void tst_QCssParser::colorValue_data() { QTest::addColumn<QString>("css"); QTest::addColumn<QColor>("expectedColor"); @@ -831,7 +831,7 @@ void tst_CssParser::colorValue_data() QTest::newRow("transparent") << "color: transparent" << QColor(Qt::transparent); } -void tst_CssParser::colorValue() +void tst_QCssParser::colorValue() { QFETCH(QString, css); QFETCH(QColor, expectedColor); @@ -886,7 +886,7 @@ private: Q_DECLARE_METATYPE(QDomDocument) -void tst_CssParser::marginValue_data() +void tst_QCssParser::marginValue_data() { QTest::addColumn<QString>("css"); QTest::addColumn<QString>("expectedMargin"); @@ -914,7 +914,7 @@ void tst_CssParser::marginValue_data() QTest::newRow("crap") << "margin: crap" << "0 0 0 0"; } -void tst_CssParser::marginValue() +void tst_QCssParser::marginValue() { QFETCH(QString, css); QFETCH(QString, expectedMargin); @@ -947,7 +947,7 @@ void tst_CssParser::marginValue() } } -void tst_CssParser::styleSelector_data() +void tst_QCssParser::styleSelector_data() { QTest::addColumn<bool>("match"); QTest::addColumn<QString>("selector"); @@ -1062,7 +1062,7 @@ void tst_CssParser::styleSelector_data() QTest::newRow("unknown-pseudo") << false << QString("p:enabled:foobar") << QString("<p/>") << QString(); } -void tst_CssParser::styleSelector() +void tst_QCssParser::styleSelector() { QFETCH(bool, match); QFETCH(QString, selector); @@ -1106,7 +1106,7 @@ void tst_CssParser::styleSelector() } } -void tst_CssParser::specificity_data() +void tst_QCssParser::specificity_data() { QTest::addColumn<QString>("selector"); QTest::addColumn<int>("specificity"); @@ -1129,7 +1129,7 @@ void tst_CssParser::specificity_data() QTest::newRow("id") << QString("#x34y") << 1 * 0x100; } -void tst_CssParser::specificity() +void tst_QCssParser::specificity() { QFETCH(QString, selector); @@ -1146,7 +1146,7 @@ void tst_CssParser::specificity() QTEST(rule.selectors.at(0).specificity(), "specificity"); } -void tst_CssParser::specificitySort_data() +void tst_QCssParser::specificitySort_data() { QTest::addColumn<QString>("firstSelector"); QTest::addColumn<QString>("secondSelector"); @@ -1159,7 +1159,7 @@ void tst_CssParser::specificitySort_data() QTest::newRow("class") << QString("p") << QString(".hey") << QString("<p class=\"hey\" />"); } -void tst_CssParser::specificitySort() +void tst_QCssParser::specificitySort() { QFETCH(QString, firstSelector); QFETCH(QString, secondSelector); @@ -1205,7 +1205,7 @@ void tst_CssParser::specificitySort() } } -void tst_CssParser::rulesForNode_data() +void tst_QCssParser::rulesForNode_data() { QTest::addColumn<QString>("xml"); QTest::addColumn<QString>("css"); @@ -1249,7 +1249,7 @@ void tst_CssParser::rulesForNode_data() << quint64(QCss::PseudoClass_Pressed) << 1 << "blue" << ""; } -void tst_CssParser::rulesForNode() +void tst_QCssParser::rulesForNode() { QFETCH(QString, xml); QFETCH(QString, css); @@ -1291,7 +1291,7 @@ void tst_CssParser::rulesForNode() QCOMPARE(decls.at(1).d->values.at(0).variant.toString(), value1); } -void tst_CssParser::shorthandBackgroundProperty_data() +void tst_QCssParser::shorthandBackgroundProperty_data() { QTest::addColumn<QString>("css"); QTest::addColumn<QBrush>("expectedBrush"); @@ -1311,7 +1311,7 @@ void tst_CssParser::shorthandBackgroundProperty_data() QTest::newRow("multi3") << "background: url(blah.png) top right" << QBrush() << QString("blah.png") << int(QCss::Repeat_XY) << int(Qt::AlignTop | Qt::AlignRight); } -void tst_CssParser::shorthandBackgroundProperty() +void tst_QCssParser::shorthandBackgroundProperty() { QFETCH(QString, css); @@ -1350,7 +1350,7 @@ void tst_CssParser::shorthandBackgroundProperty() QTEST(int(alignment), "expectedAlignment"); } -void tst_CssParser::pseudoElement_data() +void tst_QCssParser::pseudoElement_data() { QTest::addColumn<QString>("css"); QTest::addColumn<QString>("pseudoElement"); @@ -1384,7 +1384,7 @@ void tst_CssParser::pseudoElement_data() << "pe2" << 1; } -void tst_CssParser::pseudoElement() +void tst_QCssParser::pseudoElement() { QFETCH(QString, css); QFETCH(QString, pseudoElement); @@ -1413,7 +1413,7 @@ void tst_CssParser::pseudoElement() QVERIFY(decls.count() == declCount); } -void tst_CssParser::gradient_data() +void tst_QCssParser::gradient_data() { QTest::addColumn<QString>("css"); QTest::addColumn<QString>("type"); @@ -1458,7 +1458,7 @@ void tst_CssParser::gradient_data() */ } -void tst_CssParser::gradient() +void tst_QCssParser::gradient() { QFETCH(QString, css); QFETCH(QString, type); @@ -1506,8 +1506,11 @@ void tst_CssParser::gradient() QVERIFY(g->stops().at(1).second == color1); } -void tst_CssParser::extractFontFamily_data() +void tst_QCssParser::extractFontFamily_data() { + if (QFontInfo(QFont("Times New Roman")).family() != "Times New Roman") + QSKIP("'Times New Roman' font not found ", SkipAll); + QTest::addColumn<QString>("css"); QTest::addColumn<QString>("expectedFamily"); @@ -1522,7 +1525,7 @@ void tst_CssParser::extractFontFamily_data() QTest::newRow("shorthand multiple") << "font: 12pt invalid, Times New Roman " << QString("Times New Roman"); } -void tst_CssParser::extractFontFamily() +void tst_QCssParser::extractFontFamily() { QFETCH(QString, css); css.prepend("dummy {"); @@ -1547,7 +1550,7 @@ void tst_CssParser::extractFontFamily() QTEST(info.family(), "expectedFamily"); } -void tst_CssParser::extractBorder_data() +void tst_QCssParser::extractBorder_data() { QTest::addColumn<QString>("css"); QTest::addColumn<int>("expectedTopWidth"); @@ -1575,7 +1578,7 @@ void tst_CssParser::extractBorder_data() QTest::newRow("top-width+color") << "border-top: 3px green" << 3 << (int)QCss::BorderStyle_None << QColor("green"); } -void tst_CssParser::extractBorder() +void tst_QCssParser::extractBorder() { QFETCH(QString, css); QFETCH(int, expectedTopWidth); @@ -1607,7 +1610,7 @@ void tst_CssParser::extractBorder() QVERIFY(colors[QCss::TopEdge] == expectedTopColor); } -void tst_CssParser::noTextDecoration() +void tst_QCssParser::noTextDecoration() { QCss::Parser parser("dummy { text-decoration: none; }"); QCss::StyleSheet sheet; @@ -1632,7 +1635,7 @@ void tst_CssParser::noTextDecoration() QVERIFY(!f.strikeOut()); } -void tst_CssParser::quotedAndUnquotedIdentifiers() +void tst_QCssParser::quotedAndUnquotedIdentifiers() { QCss::Parser parser("foo { font-style: \"italic\"; font-weight: bold }"); QCss::StyleSheet sheet; @@ -1653,5 +1656,6 @@ void tst_CssParser::quotedAndUnquotedIdentifiers() QCOMPARE(decls.at(1).d->values.first().toString(), QLatin1String("bold")); } -QTEST_MAIN(tst_CssParser) -#include "tst_cssparser.moc" +QTEST_MAIN(tst_QCssParser) +#include "tst_qcssparser.moc" + |