本文整理汇总了C++中QSKIP函数的典型用法代码示例。如果您正苦于以下问题:C++ QSKIP函数的具体用法?C++ QSKIP怎么用?C++ QSKIP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QSKIP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void tst_QTextScriptEngine::thaiIsolatedSaraAm()
{
if (QFontDatabase().families(QFontDatabase::Any).contains("Waree")) {
QString s;
s.append(QChar(0x0e33));
QTextLayout layout(s, QFont("Waree"));
layout.beginLayout();
layout.createLine();
layout.endLayout();
QTextEngine *e = layout.engine();
e->itemize();
e->shape(0);
QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(3));
unsigned short *logClusters = e->layoutData->logClustersPtr;
QCOMPARE(logClusters[0], ushort(0));
} else
QSKIP("Cannot find Waree.", SkipAll);
}
示例2: QSKIP
void tst_QTabBar::sizeHints()
{
QTabBar tabBar;
QSKIP("To be fixed on Mac (font size below not large enough) and Linux QWS (probably too large for the screen).", SkipSingle);
tabBar.setFont(QFont("Arial", 10));
tabBar.addTab("tab 01");
tabBar.addTab("tab 02");
tabBar.addTab("tab 03");
tabBar.addTab("tab 04");
tabBar.addTab("tab 05");
tabBar.addTab("tab 06");
tabBar.addTab("This is tab7");
tabBar.addTab("This is tab8");
tabBar.addTab("This is tab9 with a very long title");
// No eliding and no scrolling -> tabbar becomes very wide
tabBar.setUsesScrollButtons(false);
tabBar.setElideMode(Qt::ElideNone);
// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
QVERIFY(tabBar.minimumSizeHint().width() > 700);
QVERIFY(tabBar.sizeHint().width() > 700);
// Scrolling enabled -> no reason to become very wide
tabBar.setUsesScrollButtons(true);
// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
QVERIFY(tabBar.minimumSizeHint().width() < 200);
QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
// Eliding enabled -> no reason to become very wide
tabBar.setUsesScrollButtons(false);
tabBar.setElideMode(Qt::ElideRight);
// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
QVERIFY(tabBar.minimumSizeHint().width() < 500);
QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
tabBar.addTab("This is tab10 with a very long title");
QVERIFY(tabBar.minimumSizeHint().width() < 600);
QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
}
示例3: CntSymbianEngine
void TestSymbianEngine::ctors()
{
QContactManager::Error error;
QMap<QString, QString> params;
// Ctor
CntSymbianEngine *ce;
ce = new CntSymbianEngine(params, &error);
QVERIFY(ce != NULL);
QVERIFY(error == QContactManager::NoError);
if (error == QContactManager::NoError) {
QVERIFY(ce->managerName() == CNT_SYMBIAN_MANAGER_NAME);
QVERIFY(ce->m_contactFilter != 0);
QVERIFY(ce->m_dataBase != 0);
QVERIFY(ce->m_relationship != 0);
QVERIFY(ce->m_transformContact != 0);
} else {
QSKIP("Error creating CntSymbianEngine in ctor", SkipSingle);
}
delete ce;
}
示例4: QSKIP
void tst_QDirModel::hidden()
{
#ifndef Q_OS_UNIX
QSKIP("Test not implemented on non-Unixes");
#else
QDir current;
current.mkdir(".qtest_hidden");
QDirModel model;
QModelIndex index = model.index(QDir::currentPath() + "/.qtest_hidden");
//QVERIFY(!index.isValid()); // hidden items are not listed, but if you specify a valid path, it will give a valid index
current.mkdir(".qtest_hidden/qtest_visible");
QModelIndex index2 = model.index(QDir::currentPath() + "/.qtest_hidden/qtest_visible");
QVERIFY(index2.isValid());
QDirModel model2;
model2.setFilter(model2.filter() | QDir::Hidden);
index = model2.index(QDir::currentPath() + "/.qtest_hidden");
QVERIFY(index.isValid());
#endif
}
示例5: defined
// TC_ID_3_x_3 : Call requestUpdate() with same value repeatedly
void TestQGeoPositionInfoSource::requestUpdate_repeatedCalls()
{
CHECK_SOURCE_VALID;
#if defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
QSKIP("Real GPS not suitable for autotesting, skipping the test.", SkipAll);
#endif
QSignalSpy spyUpdate(m_source, SIGNAL(positionUpdated(const QGeoPositionInfo&)));
QSignalSpy spyTimeout(m_source, SIGNAL(updateTimeout()));
m_source->requestUpdate(7000);
EXPECT_FAIL_WINCE_SEE_MOBILITY_337;
QTRY_VERIFY_WITH_TIMEOUT((spyUpdate.count() > 0) && (spyTimeout.count() == 0), 7000);
spyUpdate.clear();
m_source->requestUpdate(7000);
EXPECT_FAIL_WINCE_SEE_MOBILITY_337;
QTRY_VERIFY_WITH_TIMEOUT((spyUpdate.count() > 0) && (spyTimeout.count() == 0), 7000);
}
示例6: QSKIP
void tst_QCameraBackend::testCameraCaptureMetadata()
{
#ifndef Q_WS_MAEMO_6
QSKIP("Capture metadata is supported only on harmattan");
#endif
QCamera camera;
QCameraImageCapture imageCapture(&camera);
camera.exposure()->setFlashMode(QCameraExposure::FlashOff);
QSignalSpy metadataSignal(&imageCapture, SIGNAL(imageMetadataAvailable(int,QString,QVariant)));
QSignalSpy savedSignal(&imageCapture, SIGNAL(imageSaved(int,QString)));
camera.start();
QTRY_VERIFY(imageCapture.isReadyForCapture());
int id = imageCapture.capture(QString::fromLatin1("/dev/null"));
QTRY_VERIFY(!savedSignal.isEmpty());
QVERIFY(!metadataSignal.isEmpty());
QCOMPARE(metadataSignal.first().first().toInt(), id);
}
示例7: QSKIP
void tst_QSocketNotifier::bogusFds()
{
#ifndef Q_OS_SYMBIAN
//behaviour of QSocketNotifier with an invalid fd is totally different across OS
//main point of this test was to check symbian backend doesn't crash
QSKIP("test only for symbian", SkipAll);
#else
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Internal error");
QSocketNotifier max(std::numeric_limits<int>::max(), QSocketNotifier::Read);
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Invalid socket specified");
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Internal error");
QSocketNotifier min(std::numeric_limits<int>::min(), QSocketNotifier::Write);
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Internal error");
//bogus magic number is the first pseudo socket descriptor from symbian socket engine.
QSocketNotifier bogus(0x40000000, QSocketNotifier::Exception);
QSocketNotifier largestlegal(FD_SETSIZE - 1, QSocketNotifier::Read);
QSignalSpy maxspy(&max, SIGNAL(activated(int)));
QSignalSpy minspy(&min, SIGNAL(activated(int)));
QSignalSpy bogspy(&bogus, SIGNAL(activated(int)));
QSignalSpy llspy(&largestlegal, SIGNAL(activated(int)));
//generate some unrelated socket activity
QTcpServer server;
QVERIFY(server.listen(QHostAddress::LocalHost));
connect(&server, SIGNAL(newConnection()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTcpSocket client;
client.connectToHost(QHostAddress::LocalHost, server.serverPort());
QTestEventLoop::instance().enterLoop(5);
QVERIFY(server.hasPendingConnections());
//check no activity on bogus notifiers
QCOMPARE(maxspy.count(), 0);
QCOMPARE(minspy.count(), 0);
QCOMPARE(bogspy.count(), 0);
QCOMPARE(llspy.count(), 0);
#endif
}
示例8: config
void AnimenfoFetcherTest::testHachimitsu() {
KConfig config(QFINDTESTDATA("tellicotest.config"), KConfig::SimpleConfig);
QString groupName = QLatin1String("AnimeNfo.com");
if(!config.hasGroup(groupName)) {
QSKIP("This test requires a config file.", SkipAll);
}
KConfigGroup cg(&config, groupName);
Tellico::Fetch::FetchRequest request(Tellico::Data::Collection::Video, Tellico::Fetch::Keyword, "Hachimitsu to Clover");
Tellico::Fetch::Fetcher::Ptr fetcher(new Tellico::Fetch::AnimeNfoFetcher(this));
fetcher->readConfig(cg, cg.name());
Tellico::Data::EntryList results = DO_FETCH1(fetcher, request, 1);
QCOMPARE(results.size(), 1);
// the first entry had better be the right one
Tellico::Data::EntryPtr entry = results.at(0);
QVERIFY(entry);
QCOMPARE(entry->field("title"), QLatin1String("Hachimitsu to Clover"));
QCOMPARE(entry->field("year"), QLatin1String("2005"));
QCOMPARE(entry->field("episodes"), QLatin1String("26"));
QCOMPARE(entry->field("keyword"), QLatin1String("TV"));
QCOMPARE(entry->field("genre"), QLatin1String("Comedy; Drama; Romance"));
QCOMPARE(entry->field("studio"), QLatin1String("J.C.STAFF"));
QCOMPARE(entry->field("origtitle"), QString::fromUtf8("ハチミツとクローバー"));
QCOMPARE(entry->field("director"), QString::fromUtf8("Kasai Kenichi (カサヰ ケンイチ)"));
QCOMPARE(entry->field("writer"), QString::fromUtf8("Kuroda Yosuke (黒田洋介)"));
QCOMPARE(entry->field("alttitle"), QLatin1String("Honey and Clover"));
QCOMPARE(entry->field("animenfo-rating"), QLatin1String("9"));
QVERIFY(entry->field("plot").startsWith(QLatin1String("Takemoto, Mayama, and Morita are students")));
QVERIFY(!entry->field("cover").isEmpty());
QVERIFY(!entry->field("animenfo").isEmpty());
QStringList castList = Tellico::FieldFormat::splitTable(entry->field("cast"));
QCOMPARE(castList.count(), 7);
QCOMPARE(castList.at(0), QString::fromUtf8("Kudo Haruka (工藤晴香)::Hanamoto Hagumi"));
}
示例9: QSKIP
// To avoid hitting the cache, we first set the icon to s_altIconUrl (ibm.com),
// then back to s_iconUrl (kde.org) (to avoid messing up the favicons for the user ;)
void FavIconTest::testSetIconForURL()
{
if ( !checkNetworkAccess() )
QSKIP( "no network access", SkipAll );
QSignalSpy spy( &m_favIconModule, SIGNAL(iconChanged(bool,QString,QString)) );
QVERIFY( spy.isValid() );
QCOMPARE( spy.count(), 0 );
// The call to connect() triggers qdbus initialization stuff, while QSignalSpy doesn't...
connect(&m_favIconModule, SIGNAL(iconChanged(bool,QString,QString)), &m_eventLoop, SLOT(quit()));
m_favIconModule.setIconForUrl( QString( s_hostUrl ), QString( s_altIconUrl ) );
qDebug( "called first setIconForUrl, waiting" );
if ( spy.count() < 1 ) {
m_eventLoop.exec( QEventLoop::ExcludeUserInputEvents );
}
QCOMPARE( spy.count(), 1 );
QCOMPARE( spy[0][0].toBool(), false );
QCOMPARE( spy[0][1].toString(), QString( s_hostUrl ) );
QCOMPARE( spy[0][2].toString(), QString( "favicons/www.ibm.com" ) );
m_favIconModule.setIconForUrl( QString( s_hostUrl ), QString( s_iconUrl ) );
qDebug( "called setIconForUrl again, waiting" );
if ( spy.count() < 2 ) {
m_eventLoop.exec( QEventLoop::ExcludeUserInputEvents );
}
QCOMPARE( spy.count(), 2 );
QCOMPARE( spy[1][0].toBool(), false );
QCOMPARE( spy[1][1].toString(), QString( s_hostUrl ) );
QCOMPARE( spy[1][2].toString(), QString( "favicons/www.google.com" ) );
disconnect(&m_favIconModule, SIGNAL(iconChanged(bool,QString,QString)), &m_eventLoop, SLOT(quit()));
}
示例10: QSKIP
void tst_QCommandLineParser::testQuoteEscaping()
{
#ifdef QT_NO_PROCESS
QSKIP("This test requires QProcess support");
#else
QCoreApplication app(empty_argc, empty_argv);
QProcess process;
process.start("testhelper/qcommandlineparser_test_helper", QStringList() <<
QString::number(QCommandLineParser::ParseAsCompactedShortOptions) <<
"\\\\server\\path" <<
"-DKEY1=\"VALUE1\""
"-DQTBUG-15379=C:\\path\\'file.ext" <<
"-DQTBUG-30628=C:\\temp\\'file'.ext");
QVERIFY(process.waitForFinished(5000));
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QString output = process.readAll();
QVERIFY2(!output.contains("ERROR"), qPrintable(output));
QVERIFY2(output.contains("\\\\server\\path"), qPrintable(output));
QVERIFY2(output.contains("KEY1=\"VALUE1\""), qPrintable(output));
QVERIFY2(output.contains("QTBUG-15379=C:\\path\\'file.ext"), qPrintable(output));
QVERIFY2(output.contains("QTBUG-30628=C:\\temp\\'file'.ext"), qPrintable(output));
#endif // !QT_NO_PROCESS
}
示例11: defined
void tst_QScriptEngineDebugger::debuggerSignals()
{
#if defined(Q_OS_WINCE) && _WIN32_WCE < 0x600
QSKIP("skipped due to high mem usage until task 261062 is fixed", SkipAll);
#endif
QScriptEngine engine;
QScriptEngineDebugger debugger;
debugger.attachTo(&engine);
debugger.setAutoShowStandardWindow(false);
QSignalSpy evaluationSuspendedSpy(&debugger, SIGNAL(evaluationSuspended()));
QSignalSpy evaluationResumedSpy(&debugger, SIGNAL(evaluationResumed()));
QObject::connect(&debugger, SIGNAL(evaluationSuspended()),
debugger.action(QScriptEngineDebugger::ContinueAction),
SLOT(trigger()));
engine.evaluate("123");
QCOMPARE(evaluationSuspendedSpy.count(), 0);
QCOMPARE(evaluationResumedSpy.count(), 0);
engine.evaluate("debugger");
QCoreApplication::processEvents();
QCOMPARE(evaluationSuspendedSpy.count(), 1);
QCOMPARE(evaluationResumedSpy.count(), 1);
}
示例12: qputenv
void FavIconTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
// To avoid a runtime dependency on klauncher
qputenv("KDE_FORK_SLAVES", "yes");
// To let ctest exit, we shouldn't start kio_http_cache_cleaner
qputenv("KIO_DISABLE_CACHE_CLEANER", "yes");
// To get KJob::errorString() in English
qputenv("LC_ALL", "en_US.UTF-8");
if (!checkNetworkAccess()) {
QSKIP("no network access", SkipAll);
}
// Ensure we start with no cache on disk
const QString favIconCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/favicons");
QDir(favIconCacheDir).removeRecursively();
QVERIFY(!QFileInfo::exists(favIconCacheDir));
// Enable debug output
QLoggingCategory::setFilterRules(QStringLiteral("kde.kio.favicons.debug=true"));
}
示例13: QSKIP
void MoleculeFileTest::fileFormatDetectionWithCompression()
{
// check that gzip compression is supported
std::vector<std::string> compressionFormats =
chemkit::MoleculeFile::compressionFormats();
if(std::find(compressionFormats.begin(),
compressionFormats.end(),
"gz") == compressionFormats.end()){
QSKIP("Gzip compression not supported", SkipSingle);
}
// create empty file object
chemkit::MoleculeFile file;
// try to set an invalid file format
bool ret = file.setFileName("ethanol.dml.gz");
// check return code and error string
QVERIFY(ret == false);
QCOMPARE(file.errorString().c_str(), "File format 'dml' is not supported.");
// check file format and compression format
QVERIFY(file.format() == 0);
QCOMPARE(file.compressionFormat().c_str(), "gz");
// try to set a valid file format
ret = file.setFileName("ethanol.cml.gz");
QVERIFY(file.format() != 0);
// check file format and compression format
QVERIFY(file.format() != 0);
QCOMPARE(file.compressionFormat().c_str(), "gz");
// check return code
QVERIFY(ret == true);
}
示例14: QFETCH_GLOBAL
//----------------------------------------------------------------------------------
void tst_QTcpServer::maxPendingConnections()
{
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
QFETCH_GLOBAL(int, proxyType);
if (proxyType == QNetworkProxy::Socks5Proxy) {
QSKIP("With socks5 only 1 connection is allowed ever", SkipAll);
}
}
//### sees to fail sometimes ... a timing issue with the test on windows
QTcpServer server;
server.setMaxPendingConnections(2);
QTcpSocket socket1;
QTcpSocket socket2;
QTcpSocket socket3;
QVERIFY(server.listen());
socket1.connectToHost(QHostAddress::LocalHost, server.serverPort());
socket2.connectToHost(QHostAddress::LocalHost, server.serverPort());
socket3.connectToHost(QHostAddress::LocalHost, server.serverPort());
QVERIFY(server.waitForNewConnection(5000));
QVERIFY(server.hasPendingConnections());
QVERIFY(server.nextPendingConnection());
QVERIFY(server.hasPendingConnections());
QVERIFY(server.nextPendingConnection());
QVERIFY(!server.hasPendingConnections());
QCOMPARE(server.nextPendingConnection(), (QTcpSocket*)0);
QVERIFY(server.waitForNewConnection(5000));
QVERIFY(server.hasPendingConnections());
QVERIFY(server.nextPendingConnection());
}
示例15: QSKIP
void tst_QWebEngineView::renderHints()
{
#if !defined(QWEBENGINEVIEW_RENDERHINTS)
QSKIP("QWEBENGINEVIEW_RENDERHINTS");
#else
QWebEngineView webView;
// default is only text antialiasing + smooth pixmap transform
QVERIFY(!(webView.renderHints() & QPainter::Antialiasing));
QVERIFY(webView.renderHints() & QPainter::TextAntialiasing);
QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform);
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
webView.setRenderHint(QPainter::Antialiasing, true);
QVERIFY(webView.renderHints() & QPainter::Antialiasing);
QVERIFY(webView.renderHints() & QPainter::TextAntialiasing);
QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform);
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
webView.setRenderHint(QPainter::Antialiasing, false);
QVERIFY(!(webView.renderHints() & QPainter::Antialiasing));
QVERIFY(webView.renderHints() & QPainter::TextAntialiasing);
QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform);
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
webView.setRenderHint(QPainter::SmoothPixmapTransform, true);
QVERIFY(!(webView.renderHints() & QPainter::Antialiasing));
QVERIFY(webView.renderHints() & QPainter::TextAntialiasing);
QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform);
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
webView.setRenderHint(QPainter::SmoothPixmapTransform, false);
QVERIFY(webView.renderHints() & QPainter::TextAntialiasing);
QVERIFY(!(webView.renderHints() & QPainter::SmoothPixmapTransform));
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
#endif
}