• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QEXPECT_FAIL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QEXPECT_FAIL函数的典型用法代码示例。如果您正苦于以下问题:C++ QEXPECT_FAIL函数的具体用法?C++ QEXPECT_FAIL怎么用?C++ QEXPECT_FAIL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了QEXPECT_FAIL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: testGetQuotaRoot

void testGetQuotaRoot()
{
    QFETCH( QString, mailbox );
    QFETCH( QList<QByteArray>, roots );
    QFETCH( QList<QByteArray>, resources );
    QFETCH( QList<qint64>, usages );
    QFETCH( QList<qint64>, limits );
    QFETCH( QList<QByteArray>, scenario );

    FakeServer fakeServer;
    fakeServer.setScenario( scenario );
    fakeServer.startAndWait();

    KIMAP::Session session( "127.0.0.1", 5989 );

    KIMAP::GetQuotaRootJob *job = new KIMAP::GetQuotaRootJob( &session );
    job->setMailBox( mailbox );
    bool result = job->exec();
    QEXPECT_FAIL( "bad" , "Expected failure on BAD response", Continue );
    QEXPECT_FAIL( "no" , "Expected failure on NO response", Continue );
    QVERIFY( result );
    QEXPECT_FAIL( "rootname missmatch" , "Expected failure on rootname missmatch in QUOTAROOT and QUOTA response", Abort );
    QCOMPARE( job->roots(), roots );
    for ( int rootIdx = 0; rootIdx < roots.size(); rootIdx++ ) {
      const QByteArray &root = roots[rootIdx];
      for ( int i = 0; i < resources.size(); i++ ) {
        int idx = i + rootIdx * roots.size();
        QByteArray resource = resources[i];
        QCOMPARE( job->limit( root, resource ), limits[idx] );
        QCOMPARE( job->usage( root, resource ), usages[idx] );
      }
    }

    fakeServer.quit();
}
开发者ID:pvuorela,项目名称:kcalcore,代码行数:35,代码来源:quotarootjobtest.cpp


示例2: QFETCH

void tst_QPauseAnimationJob::noTimerUpdates()
{
    EnableConsistentTiming enabled;

    QFETCH(int, duration);
    QFETCH(int, loopCount);

    TestablePauseAnimation animation;
    animation.setDuration(duration);
    animation.setLoopCount(loopCount);
    animation.start();
    QTest::qWait(animation.totalDuration() + 100);

#ifdef Q_OS_WIN
    if (animation.state() != QAbstractAnimationJob::Stopped)
        QEXPECT_FAIL("", winTimerError, Abort);
#endif

    QVERIFY(animation.state() == QAbstractAnimationJob::Stopped);
    const int expectedLoopCount = 1 + loopCount;

#ifdef Q_OS_WIN
    if (animation.m_updateCurrentTimeCount != expectedLoopCount)
        QEXPECT_FAIL("", winTimerError, Abort);
#endif
    QCOMPARE(animation.m_updateCurrentTimeCount, expectedLoopCount);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:27,代码来源:tst_qpauseanimationjob.cpp


示例3: QSKIP

void tst_QNumeric::qNan()
{
#if defined __FAST_MATH__ && (__GNUC__ * 100 + __GNUC_MINOR__ < 404)
    QSKIP("Non-conformant fast math mode is enabled, cannot run test");
#endif
    double nan = qQNaN();
    QVERIFY(!(0 > nan));
    QVERIFY(!(0 < nan));
    QVERIFY(qIsNaN(nan));
    QVERIFY(qIsNaN(nan + 1));
    QVERIFY(qIsNaN(-nan));
    double inf = qInf();
    QVERIFY(inf > 0);
    QVERIFY(-inf < 0);
    QVERIFY(qIsInf(inf));
    QVERIFY(qIsInf(-inf));
    QVERIFY(qIsInf(2*inf));
    QCOMPARE(1/inf, 0.0);
#ifdef Q_CC_INTEL
    QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
#endif
    QVERIFY(qIsNaN(0*nan));
#ifdef Q_CC_INTEL
    QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
#endif
    QVERIFY(qIsNaN(0*inf));
    QVERIFY(qFuzzyCompare(1/inf, 0.0));
}
开发者ID:oneywang,项目名称:qtbase,代码行数:28,代码来源:tst_qnumeric.cpp


示例4: pies

void SchroniskoTesty::testAtrybutyPsa()
{
    Pies pies(24345, "Azor", 4, Lagodny, "Pudel" );

    QCOMPARE( 24345, pies.getId() );
    QCOMPARE( QString("Azor"), pies.getImie() );
    QCOMPARE( 4, pies.getWiek() );
    QCOMPARE( Lagodny, pies.getRodzaj() );
    QCOMPARE( QString("Pudel"), pies.getRasa() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodny numer ID", Continue);
    QCOMPARE( 98345, pies.getId() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodne imie", Continue);
    QCOMPARE( QString("Burek"), pies.getImie() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodny wiek", Continue);
    QCOMPARE( 12, pies.getWiek() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodny rodzaj", Continue);
    QCOMPARE( Grozny, pies.getRodzaj() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodna rasa", Continue);
    QCOMPARE( QString("Owczarek Bernaski"), pies.getRasa() );
}
开发者ID:militia11,项目名称:Schronisko,代码行数:25,代码来源:tst_schroniskotesty.cpp


示例5: klient

void SchroniskoTesty::testAtrybutyKlienta()
{
    Klient klient(123, "Adam", "Kowalski", "ul. Kościelna 12; Bydgoszcz; 85790", 600821340);

    QCOMPARE( 123, klient.getId() );
    QCOMPARE( QString("Adam"), klient.getImie() );
    QCOMPARE( QString("Kowalski"), klient.getNazwisko() );
    QCOMPARE( QString("ul. Kościelna 12; Bydgoszcz; 85790"), klient.getUlica() );
    QCOMPARE( 600821340, klient.getNumerTelefonu() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodny numer Id", Continue);
    QCOMPARE( 345, klient.getId());

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodne imie", Continue);
    QCOMPARE( QString("Kuba"), klient.getImie());

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodne nazwisko", Continue);
    QCOMPARE( QString("Nowicki"), klient.getNazwisko() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodna ulica", Continue);
    QCOMPARE( QString("ul. Sławków 3; Lublin; 44230"), klient.getUlica() );

    QEXPECT_FAIL("", "test na niewłaściwe dane : niezgodny numer", Continue);
    QCOMPARE( 515987464, klient.getNumerTelefonu() );
}
开发者ID:militia11,项目名称:Schronisko,代码行数:25,代码来源:tst_schroniskotesty.cpp


示例6: QEXPECT_FAIL

void tst_StrCmp::compareByteArray() const
{
    QByteArray ba = "foo";
    QEXPECT_FAIL("", "Next test should fail", Continue);
    QCOMPARE(ba.constData(), "bar");
    QCOMPARE(ba.constData(), "foo");

    char *bar = "bar";
    char *foo = "foo";

    QEXPECT_FAIL("", "Next test should fail", Continue);
    QCOMPARE(ba.data(), bar);
    QCOMPARE(ba.data(), foo);

    const char *cbar = "bar";
    const char *cfoo = "foo";

    QEXPECT_FAIL("", "Next test should fail", Continue);
    QCOMPARE(ba.constData(), cbar);
    QCOMPARE(ba.constData(), cfoo);

    /* Create QByteArrays of the size that makes the corresponding toString() crop output. */
    const QByteArray b(500, 'A');
    const QByteArray a(500, 'B');

    QCOMPARE(a, b);
}
开发者ID:Suneal,项目名称:qt,代码行数:27,代码来源:tst_strcmp.cpp


示例7: commandData

    void commandData() {
        QFETCH(bool, pass);

        QEXPECT_FAIL("row2", "expectedFailureData1", Abort);
        QVERIFY2(pass, "fail");

        QEXPECT_FAIL("row3", "expectedFailureData2", Continue);
        QVERIFY(pass);
    }
开发者ID:KDE,项目名称:kdev-xtest,代码行数:9,代码来源:expectedFailure.cpp


示例8: QEXPECT_FAIL

void tst_ExpectFail::xfailWithQString() const
{
    QEXPECT_FAIL("", QString("A string").toLatin1().constData(), Continue);
    QVERIFY(false);

    int bugNo = 5;
    QString msg("The message");
    QEXPECT_FAIL( "", QString("Bug %1 (%2)").arg(bugNo).arg(msg).toLatin1().constData(), Continue);
    QVERIFY(false);
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:10,代码来源:tst_expectfail.cpp


示例9: QVERIFY

void PythonQtTestSlotCalling::testInheritance() {
  PythonQt::self()->registerCPPClass("ClassA",NULL,NULL, PythonQtCreateObject<ClassAWrapper>);
  PythonQt::self()->registerCPPClass("ClassB",NULL,NULL, PythonQtCreateObject<ClassBWrapper>);
  PythonQt::self()->registerCPPClass("ClassC",NULL,NULL, PythonQtCreateObject<ClassCWrapper>);
  PythonQt::self()->addParentClass("ClassC", "ClassA", PythonQtUpcastingOffset<ClassC,ClassA>());
  PythonQt::self()->addParentClass("ClassC", "ClassB", PythonQtUpcastingOffset<ClassC,ClassB>());
  PythonQt::self()->registerClass(&ClassD::staticMetaObject, NULL, PythonQtCreateObject<ClassDWrapper>);
  PythonQt::self()->addParentClass("ClassD", "ClassA", PythonQtUpcastingOffset<ClassD,ClassA>());
  PythonQt::self()->addParentClass("ClassD", "ClassB", PythonQtUpcastingOffset<ClassD,ClassB>());

  PythonQtObjectPtr classA = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassA");
  PythonQtObjectPtr classB = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassB");
  PythonQtObjectPtr classC = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassC");
  PythonQtObjectPtr classD = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassD");
  QVERIFY(classA);
  QVERIFY(classB);
  QVERIFY(classC);
  QVERIFY(classD);

  QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
  QEXPECT_FAIL("", "ClassB can not be converted to ClassA", Continue);
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));

  QEXPECT_FAIL("", "ClassA can not be converted to ClassB", Continue);
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));

  QEXPECT_FAIL("", "ClassA can not be converted to ClassC", Continue);
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
  QEXPECT_FAIL("", "ClassB can not be converted to ClassC", Continue);
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
  QEXPECT_FAIL("", "ClassD can not be converted to ClassC", Continue);
  QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));

  QVERIFY(_helper->runScript("if type(obj.createClassA())==PythonQt.private.ClassA: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassB())==PythonQt.private.ClassB: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassCAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassD())==PythonQt.private.ClassD: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassDAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));

  PythonQt::self()->addPolymorphicHandler("ClassB", polymorphic_ClassB_Handler);

  QVERIFY(_helper->runScript("if type(obj.getClassBPtr(obj.createClassB()))==PythonQt.private.ClassB: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassC: obj.setPassed();\n"));
  QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassD: obj.setPassed();\n"));

}
开发者ID:dbrnz,项目名称:PythonQtCopy,代码行数:54,代码来源:PythonQtTests.cpp


示例10: qDebug

void Foo::test_case1()
{
    qDebug() << "test_case1";
    QFETCH(int, val);

    QEXPECT_FAIL("test2", "2", Continue);
    QCOMPARE(val, 1);
    QEXPECT_FAIL("test1", "bla", Abort);
    QCOMPARE(val, 2);
    QVERIFY2(true, "Hallo");
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:11,代码来源:tst_foo.cpp


示例11: qDebug

void tst_ExpectFail::expectAndAbort() const
{
    qDebug("begin");
    QEXPECT_FAIL("", "This should xfail", Abort);
    QVERIFY(false);
    qDebug("this should not be reached");
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:7,代码来源:tst_expectfail.cpp


示例12: imageDrawText

void tst_QStaticText::scaledPainter()
{
    QPixmap imageDrawText(1000, 1000);
    imageDrawText.fill(Qt::white);
    {
        QPainter p(&imageDrawText);
        p.scale(2.0, 0.2);

        p.drawText(11, 12, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
    }

    QPixmap imageDrawStaticText(1000, 1000);
    imageDrawStaticText.fill(Qt::white);
    {
        QPainter p(&imageDrawStaticText);
        p.scale(2.0, 0.2);

        QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
        text.setTextFormat(Qt::PlainText);

        p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
    }

    if (!supportsTransformations())
      QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
    QCOMPARE(imageDrawStaticText, imageDrawText);
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:27,代码来源:tst_qstatictext.cpp


示例13: spy

void TestExtWeather::run()
{
    // init spy
    QSignalSpy spy(extWeather, SIGNAL(dataReceived(const QVariantHash &)));
    QVariantHash firstValue = extWeather->run();

    // check values
    QVERIFY(spy.wait(5000));
    QVariantHash arguments = spy.takeFirst().at(0).toHash();
    QEXPECT_FAIL("", "WeatherID should not be 0", Continue);
    QCOMPARE(arguments[extWeather->tag("weatherId")].toInt(), 0);
    QVERIFY(
        (arguments[extWeather->tag("humidity")].toInt() >= humidity.first)
        && (arguments[extWeather->tag("humidity")].toInt() <= humidity.second));
    QVERIFY(
        (arguments[extWeather->tag("pressure")].toInt() > pressure.first)
        && (arguments[extWeather->tag("pressure")].toInt() < pressure.second));
    QVERIFY(
        (arguments[extWeather->tag("temperature")].toFloat() > temp.first)
        && (arguments[extWeather->tag("temperature")].toFloat() < temp.second));
    // image should be only one symbol here
    if (extWeather->jsonMapFile().isEmpty())
        QSKIP("No json map found for weather, skip image test");
    QCOMPARE(arguments[extWeather->tag("weather")].toString().count(), 1);
}
开发者ID:arcan1s,项目名称:awesome-widgets,代码行数:25,代码来源:testextweather.cpp


示例14: defined

void tst_QTextScriptEngine::gurmukhi()
{
#if defined(Q_WS_X11)
    {
        if (QFontDatabase().families(QFontDatabase::Gurmukhi).contains("Lohit Punjabi")) {
            QFont f("Lohit Punjabi");
	    const ShapeTable shape_table [] = {
		{ { 0xA15, 0xA4D, 0xa39, 0x0 },
		  { 0x3b, 0x8b, 0x0 } },
		{ {0}, {0} }
	    };


	    const ShapeTable *s = shape_table;
	    while (s->unicode[0]) {
                QEXPECT_FAIL("", "QTBUG-26495", Abort);
		QVERIFY( shaping(f, s) );
		++s;
	    }
	} else {
	    QSKIP("couln't find Lohit Punjabi", SkipAll);
	}
    }
#endif
}
开发者ID:maxxant,项目名称:qt,代码行数:25,代码来源:tst_qtextscriptengine.cpp


示例15: s

void tst_QTextScriptEngine::thaiMultipleVowels()
{
    QString s(QString::fromUtf8("ส"));
    for (int i = 0; i < 100; i++)
        s += QChar(0x0E47); // Add lots of "VOWEL SIGN MAI TAI KHU N/S-T"  stacked on top of the character
    s += QChar(0x200D); // Now add a zero width joiner (which adds a circle which is hidden)
    for (int i = 0; i < 100; i++)
        s += QChar(0x0E47); //Add lots of "VOWEL SIGN MAI TAI KHU N/S-T"  stacked on top of the ZWJ

    for (int i = 0; i < 10; i++)
        s += s; //Repeat the string to make it more likely to crash if we have a buffer overflow
    QTextLayout layout(s);
    layout.beginLayout();
    layout.createLine();
    layout.endLayout();

    QTextEngine *e = layout.engine();
    e->width(0, s.length()); //force itemize and shape

    int k = 0;
    for (int i = 0; i < e->layoutData->items.size(); i++)
        for (int j = 0; j < e->layoutData->items[i].num_glyphs; j++) {
            bool isZWJ = k%401 == 200;
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
            if ((bool)e->layoutData->glyphLayout.attributes[k].dontPrint != isZWJ) {
                QEXPECT_FAIL("", "QTBUG-26495", Abort);
            }
#endif
            QCOMPARE((bool)e->layoutData->glyphLayout.attributes[k++].dontPrint, isZWJ);
        }
}
开发者ID:maxxant,项目名称:qt,代码行数:31,代码来源:tst_qtextscriptengine.cpp


示例16: QVERIFY

void SqliteTests::datetime() {
    User user1;

    user1.userId = "tester";
    user1.name = "tester";
    user1.passwd = "12345678";

    QDateTime datetime = QDateTime::currentDateTime().toUTC();

    user1.lastLoginTime = datetime;

    QVERIFY(user1.clean());
    QVERIFY(user1.save());

    User user2;
    QVERIFY(user2.load(DQWhere("userId=","tester")));

#if (QT_VERSION > QT_VERSION_CHECK(5, 0, 2))
    // The timezone checking do not exists in Qt 5.0.2
    QEXPECT_FAIL("","Sqlite driver do not save the time zone of QDateTime type",Continue);
#endif

    QVERIFY(user2.lastLoginTime == datetime);

    QString format("yyyy-MM-ddThh:mm:ss");
    QVERIFY(user2.lastLoginTime.get().toDateTime().toString(format) == datetime.toString(format));

    QVERIFY(!user2.creationTime->isNull());
}
开发者ID:benlau,项目名称:dquest,代码行数:29,代码来源:sqlitetests.cpp


示例17: myEval

void tst_QScriptContext::inheritActivationAndThisObject()
{
    QScriptEngine eng;
    eng.globalObject().setProperty("myEval", eng.newFunction(myEval));
    {
        QScriptValue ret = eng.evaluate("var a = 123; myEval('a')");
        QVERIFY(ret.isNumber());
        QCOMPARE(ret.toInt32(), 123);
    }
    {
        QScriptValue ret = eng.evaluate("(function() { return myEval('this'); }).call(Number)");
        QVERIFY(ret.isFunction());
        QVERIFY(ret.equals(eng.globalObject().property("Number")));
    }
    {
        QScriptValue ret = eng.evaluate("(function(a) { return myEval('a'); })(123)");
        QVERIFY(ret.isNumber());
        QCOMPARE(ret.toInt32(), 123);
    }

    // QT-2219
    {
        eng.globalObject().setProperty("a", 123);
        QScriptValue ret = eng.evaluate("(function() { myEval('var a = 456'); return a; })()");
        QVERIFY(ret.isNumber());
        QCOMPARE(ret.toInt32(), 456);
        QEXPECT_FAIL("", "QT-2219: Wrong activation object is returned from native function's parent context", Continue);
        QVERIFY(eng.globalObject().property("a").strictlyEquals(123));
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:30,代码来源:tst_qscriptcontext.cpp


示例18: verticalScrollbar

/*
    Test that vertical and horizontal mac-style scrollbars paint their
    entire area.
*/
void tst_MacGui::scrollbarPainting()
{
    ColorWidget colorWidget;
    colorWidget.resize(400, 400);

    QSize scrollBarSize;

    QScrollBar verticalScrollbar(&colorWidget);
    verticalScrollbar.move(10, 10);
    scrollBarSize = verticalScrollbar.sizeHint();
    scrollBarSize.setHeight(200);
    verticalScrollbar.resize(scrollBarSize);

    QScrollBar horizontalScrollbar(&colorWidget);
    horizontalScrollbar.move(30, 10);
    horizontalScrollbar.setOrientation(Qt::Horizontal);
    scrollBarSize = horizontalScrollbar.sizeHint();
    scrollBarSize.setWidth(200);
    horizontalScrollbar.resize(scrollBarSize);

    colorWidget.show();
    colorWidget.raise();
    QTest::qWait(100);

    QPixmap pixmap = grabWindowContents(&colorWidget);

    QEXPECT_FAIL("", "QTBUG-26371", Abort);
    QVERIFY(isContent(pixmap.toImage(), verticalScrollbar.geometry(), GuiTester::Horizontal));
    QVERIFY(isContent(pixmap.toImage(), horizontalScrollbar.geometry(), GuiTester::Vertical));
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:34,代码来源:tst_macgui.cpp


示例19: QCOMPARE

void tst_qdeclarativedebughelper::setAnimationSlowDownFactor()
{
    TestAnimation animation;

    // first check whether setup works
    QCOMPARE(animation.updateCalled, 0);
    animation.start();
    QTest::qWait(animation.totalDuration() + 50);
#ifdef Q_OS_WIN
    if (animation.state() != QAbstractAnimation::Stopped)
        QEXPECT_FAIL("", "On windows, consistent timing is not working properly due to bad timer resolution", Abort);
#endif
    QCOMPARE(animation.state(), QAbstractAnimation::Stopped);
    QVERIFY(animation.updateCalled > 1);

    // check if we can pause all animations
    animation.updateCalled = 0;
    QDeclarativeDebugHelper::setAnimationSlowDownFactor(0.0);
    animation.start();
    QTest::qWait(animation.totalDuration() + 50);
    QVERIFY(animation.updateCalled <= 1); // updateCurrentTime seems to be called at  least once

    // now run them again
    animation.updateCalled = 0;
    QDeclarativeDebugHelper::setAnimationSlowDownFactor(2.0);
    animation.start();
    QTest::qWait(animation.totalDuration() + 50);
    QVERIFY(animation.updateCalled > 1);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:29,代码来源:tst_qdeclarativedebughelper.cpp


示例20: QFETCH

void ValgrindMemcheckParserTest::testValgrindStartError()
{
    QFETCH(QString, valgrindExe);
    QFETCH(QStringList, valgrindArgs);
    QFETCH(QString, debuggee);
    QFETCH(QString, debuggeeArgs);

    ProjectExplorer::StandardRunnable debuggeeExecutable;
    debuggeeExecutable.executable = debuggee;
    debuggeeExecutable.environment = Utils::Environment::systemEnvironment();
    debuggeeExecutable.commandLineArguments = debuggeeArgs;

    ValgrindRunner runner;
    runner.setValgrindExecutable(valgrindExe);
    runner.setValgrindArguments(valgrindArgs);
    runner.setDebuggee(debuggeeExecutable);
    runner.setDevice(ProjectExplorer::DeviceManager::instance()->defaultDevice(
                         ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE));
    RunnerDumper dumper(&runner);
    runner.start();
    runner.waitForFinished();
    QEXPECT_FAIL("", "Error codes of valgrind startup are currently unprocessed", Continue); //FIXME
    QVERIFY(dumper.m_errorReceived);
    // just finish without deadlock and we are fine
}
开发者ID:choenig,项目名称:qt-creator,代码行数:25,代码来源:valgrindmemcheckparsertest.cpp



注:本文中的QEXPECT_FAIL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QFAIL函数代码示例发布时间:2022-05-30
下一篇:
C++ QDomElement函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap