summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 08:20:36 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-10 20:28:01 +0200
commit7f0d702f4e568790dfdfd916fa3c2da5ec78c6df (patch)
tree617646d5471b9da4126c33ff95e6670406bf62d7
parentf047e8b9786df0fbee307a0ec425eea385ab6657 (diff)
Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I574208abc90a8042b500b3f96e3862b0ff339eb6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r--src/client/qwaylanddisplay.cpp4
-rw-r--r--src/client/qwaylandscreen.cpp2
-rw-r--r--src/client/qwaylandtouch.cpp8
-rw-r--r--src/client/qwaylandwindow.cpp6
-rw-r--r--src/compositor/compositor_api/qwaylandtouch.cpp4
-rw-r--r--src/compositor/extensions/qwaylandtextinput.cpp6
-rw-r--r--src/compositor/extensions/qwlqttouch.cpp4
-rw-r--r--src/compositor/extensions/qwltexturesharingextension.cpp2
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager.cpp4
-rw-r--r--src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp2
-rw-r--r--src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp2
-rw-r--r--src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp2
-rw-r--r--src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp2
-rw-r--r--src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp2
-rw-r--r--src/shared/qwaylandinputmethodeventbuilder.cpp12
-rw-r--r--src/shared/qwaylandmimehelper.cpp2
-rw-r--r--tests/auto/client/client/tst_client.cpp2
-rw-r--r--tests/auto/client/clientextension/tst_clientextension.cpp12
-rw-r--r--tests/auto/client/datadevicev1/tst_datadevicev1.cpp2
-rw-r--r--tests/auto/client/fullscreenshellv1/tst_fullscreenshellv1.cpp2
-rw-r--r--tests/auto/client/inputcontext/tst_inputcontext.cpp8
-rw-r--r--tests/auto/client/primaryselectionv1/tst_primaryselectionv1.cpp2
-rw-r--r--tests/auto/client/seat/tst_seat.cpp26
-rw-r--r--tests/auto/client/seatv4/tst_seatv4.cpp10
-rw-r--r--tests/auto/client/shared/iviapplication.cpp2
-rw-r--r--tests/auto/client/shared/mockcompositor.cpp2
-rw-r--r--tests/auto/client/surface/tst_surface.cpp16
-rw-r--r--tests/auto/client/xdgshell/tst_xdgshell.cpp12
-rw-r--r--tests/auto/compositor/compositor/tst_compositor.cpp52
29 files changed, 106 insertions, 106 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 275a4a144..48331c5a4 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -610,7 +610,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
void QWaylandDisplay::registry_global_remove(uint32_t id)
{
- for (int i = 0, ie = mGlobals.count(); i != ie; ++i) {
+ for (int i = 0, ie = mGlobals.size(); i != ie; ++i) {
RegistryGlobal &global = mGlobals[i];
if (global.id == id) {
if (global.interface == QLatin1String(QtWayland::wl_output::interface()->name)) {
@@ -677,7 +677,7 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data)
{
Listener l = { listener, data };
mRegistryListeners.append(l);
- for (int i = 0, ie = mGlobals.count(); i != ie; ++i)
+ for (int i = 0, ie = mGlobals.size(); i != ie; ++i)
(*l.listener)(l.data, mGlobals[i].registry, mGlobals[i].id, mGlobals[i].interface, mGlobals[i].version);
}
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp
index 57bccde38..fd56a252b 100644
--- a/src/client/qwaylandscreen.cpp
+++ b/src/client/qwaylandscreen.cpp
@@ -148,7 +148,7 @@ QList<QPlatformScreen *> QWaylandScreen::virtualSiblings() const
const QList<QWaylandScreen*> screens = mWaylandDisplay->screens();
auto *placeholder = mWaylandDisplay->placeholderScreen();
- list.reserve(screens.count() + (placeholder ? 1 : 0));
+ list.reserve(screens.size() + (placeholder ? 1 : 0));
for (QWaylandScreen *screen : qAsConst(screens)) {
if (screen->screen())
diff --git a/src/client/qwaylandtouch.cpp b/src/client/qwaylandtouch.cpp
index 41dfd0855..a88947e07 100644
--- a/src/client/qwaylandtouch.cpp
+++ b/src/client/qwaylandtouch.cpp
@@ -107,12 +107,12 @@ void QWaylandTouchExtension::touch_extension_touch(uint32_t time,
void QWaylandTouchExtension::sendTouchEvent()
{
// Copy all points, that are in the previous but not in the current list, as stationary.
- for (int i = 0; i < mPrevTouchPoints.count(); ++i) {
+ for (int i = 0; i < mPrevTouchPoints.size(); ++i) {
const QWindowSystemInterface::TouchPoint &prevPoint(mPrevTouchPoints.at(i));
if (prevPoint.state == QEventPoint::Released)
continue;
bool found = false;
- for (int j = 0; j < mTouchPoints.count(); ++j)
+ for (int j = 0; j < mTouchPoints.size(); ++j)
if (mTouchPoints.at(j).id == prevPoint.id) {
found = true;
break;
@@ -132,14 +132,14 @@ void QWaylandTouchExtension::sendTouchEvent()
QWindowSystemInterface::handleTouchEvent(mTargetWindow, mTimestamp, mTouchDevice, mTouchPoints);
QEventPoint::States states = {};
- for (int i = 0; i < mTouchPoints.count(); ++i)
+ for (int i = 0; i < mTouchPoints.size(); ++i)
states |= mTouchPoints.at(i).state;
if (mFlags & QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH) {
const bool firstPress = states == QEventPoint::Pressed;
if (firstPress)
mMouseSourceId = mTouchPoints.first().id;
- for (int i = 0; i < mTouchPoints.count(); ++i) {
+ for (int i = 0; i < mTouchPoints.size(); ++i) {
const QWindowSystemInterface::TouchPoint &tp(mTouchPoints.at(i));
if (tp.id == mMouseSourceId) {
const bool released = tp.state == QEventPoint::Released;
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 001f99d02..73a14b897 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -132,7 +132,7 @@ void QWaylandWindow::initWindow()
mShellSurface->setAppId(fi.baseName());
} else {
QString appId;
- for (int i = 0; i < domainName.count(); ++i)
+ for (int i = 0; i < domainName.size(); ++i)
appId.prepend(QLatin1Char('.')).prepend(domainName.at(i));
appId.append(fi.baseName());
mShellSurface->setAppId(appId);
@@ -288,9 +288,9 @@ void QWaylandWindow::setWindowTitle(const QString &title)
const int maxLength = libwaylandMaxBufferSize / 3 - 100;
auto truncated = QStringView{formatted}.left(maxLength);
- if (truncated.length() < formatted.length()) {
+ if (truncated.size() < formatted.size()) {
qCWarning(lcQpaWayland) << "Window titles longer than" << maxLength << "characters are not supported."
- << "Truncating window title (from" << formatted.length() << "chars)";
+ << "Truncating window title (from" << formatted.size() << "chars)";
}
mShellSurface->setTitle(truncated.toString());
}
diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp
index 2e6957f9b..39aeac491 100644
--- a/src/compositor/compositor_api/qwaylandtouch.cpp
+++ b/src/compositor/compositor_api/qwaylandtouch.cpp
@@ -73,7 +73,7 @@ int QWaylandTouchPrivate::toSequentialWaylandId(int touchId)
return availableId;
}
ids.append(touchId);
- return ids.length() - 1;
+ return ids.size() - 1;
}
/*!
@@ -189,7 +189,7 @@ void QWaylandTouch::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *ev
if (points.isEmpty())
return;
- const int pointCount = points.count();
+ const int pointCount = points.size();
for (int i = 0; i < pointCount; ++i) {
const QTouchEvent::TouchPoint &tp(points.at(i));
// Convert the local pos in the compositor window to surface-relative.
diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp
index 766faf16a..933f31208 100644
--- a/src/compositor/extensions/qwaylandtextinput.cpp
+++ b/src/compositor/extensions/qwaylandtextinput.cpp
@@ -105,10 +105,10 @@ void QWaylandTextInputPrivate::sendInputMethodEvent(QInputMethodEvent *event)
if (event->replacementLength() > 0 || event->replacementStart() != 0) {
// Remove replacement
- afterCommit.cursorPosition = qBound(0, afterCommit.cursorPosition + event->replacementStart(), afterCommit.surroundingText.length());
+ afterCommit.cursorPosition = qBound(0, afterCommit.cursorPosition + event->replacementStart(), afterCommit.surroundingText.size());
afterCommit.surroundingText.remove(afterCommit.cursorPosition,
qMin(event->replacementLength(),
- afterCommit.surroundingText.length() - afterCommit.cursorPosition));
+ afterCommit.surroundingText.size() - afterCommit.cursorPosition));
if (event->replacementStart() <= 0 && (event->replacementLength() >= -event->replacementStart())) {
const int selectionStart = qMin(currentState->cursorPosition, currentState->anchorPosition);
@@ -124,7 +124,7 @@ void QWaylandTextInputPrivate::sendInputMethodEvent(QInputMethodEvent *event)
// Insert commit string
afterCommit.surroundingText.insert(afterCommit.cursorPosition, event->commitString());
- afterCommit.cursorPosition += event->commitString().length();
+ afterCommit.cursorPosition += event->commitString().size();
afterCommit.anchorPosition = afterCommit.cursorPosition;
for (const QInputMethodEvent::Attribute &attribute : event->attributes()) {
diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp
index 89753cc1f..1435dde1e 100644
--- a/src/compositor/extensions/qwlqttouch.cpp
+++ b/src/compositor/extensions/qwlqttouch.cpp
@@ -33,13 +33,13 @@ static inline int toFixed(qreal f)
bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandSurface *surface)
{
const QList<QTouchEvent::TouchPoint> points = event->points();
- const int pointCount = points.count();
+ const int pointCount = points.size();
if (!pointCount)
return false;
wl_client *surfaceClient = surface->client()->client();
uint32_t time = m_compositor->currentTimeMsecs();
- const int rescount = m_resources.count();
+ const int rescount = m_resources.size();
for (int res = 0; res < rescount; ++res) {
Resource *target = m_resources.at(res);
diff --git a/src/compositor/extensions/qwltexturesharingextension.cpp b/src/compositor/extensions/qwltexturesharingextension.cpp
index 9d7810a15..ef8961e4c 100644
--- a/src/compositor/extensions/qwltexturesharingextension.cpp
+++ b/src/compositor/extensions/qwltexturesharingextension.cpp
@@ -399,7 +399,7 @@ void QWaylandTextureSharingExtension::cleanupBuffers()
void QWaylandTextureSharingExtension::dumpBufferInfo()
{
- qDebug() << "shared buffers:" << m_server_buffers.count();
+ qDebug() << "shared buffers:" << m_server_buffers.size();
for (auto it = m_server_buffers.cbegin(); it != m_server_buffers.cend(); ++it)
qDebug() << " " << it.key() << ":" << it.value().buffer << "in use" << it.value().buffer->bufferInUse() << "usedLocally" << it.value().usedLocally ;
}
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
index b7d94ae94..04add014f 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
@@ -67,7 +67,7 @@ void DataDeviceManager::retain()
{
QList<QString> offers = m_current_selection_source->mimeTypes();
finishReadFromClient();
- if (m_retainedReadIndex >= offers.count()) {
+ if (m_retainedReadIndex >= offers.size()) {
QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData);
return;
}
@@ -104,7 +104,7 @@ void DataDeviceManager::finishReadFromClient(bool exhausted)
void DataDeviceManager::readFromClient(int fd)
{
static char buf[4096];
- int obsCount = m_obsoleteRetainedReadNotifiers.count();
+ int obsCount = m_obsoleteRetainedReadNotifiers.size();
for (int i = 0; i < obsCount; ++i) {
QSocketNotifier *sn = m_obsoleteRetainedReadNotifiers.at(i);
if (sn->socket() == fd) {
diff --git a/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp b/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp
index 2dc0dfb1f..a217c1c89 100644
--- a/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp
@@ -100,7 +100,7 @@ QOpenGLTexture *DmaBufServerBuffer::toOpenGlTexture()
bool DmaBufServerBuffer::bufferInUse()
{
- return resourceMap().count() > 0;
+ return resourceMap().size() > 0;
}
DmaBufServerBufferIntegration::DmaBufServerBufferIntegration()
diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
index 13b566e0f..3c49f30a4 100644
--- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
@@ -87,7 +87,7 @@ QOpenGLTexture *DrmEglServerBuffer::toOpenGlTexture()
bool DrmEglServerBuffer::bufferInUse()
{
- return resourceMap().count() > 0;
+ return resourceMap().size() > 0;
}
DrmEglServerBufferIntegration::DrmEglServerBufferIntegration()
diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp
index d0f83a696..dec94e791 100644
--- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp
+++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp
@@ -92,7 +92,7 @@ bool LinuxDmabufParams::handleCreateParams(Resource *resource, int width, int he
// check for holes in plane sequence
auto planeIds = m_planes.keys();
std::sort(planeIds.begin(), planeIds.end());
- for (int i = 0; i < planeIds.count(); ++i) {
+ for (int i = 0; i < planeIds.size(); ++i) {
if (uint(i) != planeIds[i]) {
wl_resource_post_error(resource->handle,
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE,
diff --git a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
index 9eca71619..0f794d115 100644
--- a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
@@ -68,7 +68,7 @@ struct ::wl_resource *ShmServerBuffer::resourceForClient(struct ::wl_client *cli
bool ShmServerBuffer::bufferInUse()
{
- return resourceMap().count() > 0;
+ return resourceMap().size() > 0;
}
QOpenGLTexture *ShmServerBuffer::toOpenGlTexture()
diff --git a/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp b/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp
index 8c9d82b6a..eb10353b0 100644
--- a/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp
@@ -222,7 +222,7 @@ void VulkanServerBuffer::releaseOpenGlTexture()
bool VulkanServerBuffer::bufferInUse()
{
- return (m_texture && m_texture->isCreated()) || resourceMap().count() > 0;
+ return (m_texture && m_texture->isCreated()) || resourceMap().size() > 0;
}
void VulkanServerBuffer::server_buffer_release(Resource *resource)
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
index 256a0c423..cfde26c76 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -106,7 +106,7 @@ QInputMethodEvent *QWaylandInputMethodEventBuilder::buildCommit(const QString &t
const int absoluteOffset = absoluteCursor - cursor;
- const int cursorAfterCommit = qMin(anchor, cursor) + replacement.first + text.length();
+ const int cursorAfterCommit = qMin(anchor, cursor) + replacement.first + text.size();
surrounding.replace(qMin(anchor, cursor) + replacement.first,
qAbs(anchor - cursor) + replacement.second, text);
@@ -278,10 +278,10 @@ int QWaylandInputMethodEventBuilder::indexFromWayland(const QString &text, int l
if (length < 0) {
const QByteArray &utf8 = QStringView{text}.left(base).toUtf8();
- return QString::fromUtf8(utf8.left(qMax(utf8.length() + length, 0))).length();
+ return QString::fromUtf8(utf8.left(qMax(utf8.size() + length, 0))).size();
} else {
const QByteArray &utf8 = QStringView{text}.mid(base).toUtf8();
- return QString::fromUtf8(utf8.left(length)).length() + base;
+ return QString::fromUtf8(utf8.left(length)).size() + base;
}
}
@@ -304,20 +304,20 @@ int QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(const QString &text
const unsigned char ch = utf8.at(start + i);
// check if current character is a utf8's initial character.
if (ch < 0x80 || ch > 0xbf)
- return QString::fromUtf8(utf8.left(start + i)).length();
+ return QString::fromUtf8(utf8.left(start + i)).size();
}
} else {
const QByteArray &utf8 = QStringView{text}.mid(base).toUtf8();
const int len = utf8.size();
const int start = length;
if (start >= len)
- return base + QString::fromUtf8(utf8).length();
+ return base + QString::fromUtf8(utf8).size();
for (int i = 0; i < 4; i++) {
const unsigned char ch = utf8.at(start - i);
// check if current character is a utf8's initial character.
if (ch < 0x80 || ch > 0xbf)
- return base + QString::fromUtf8(utf8.left(start - i)).length();
+ return base + QString::fromUtf8(utf8.left(start - i)).size();
}
}
return -1;
diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp
index f589666c1..3bbbad97b 100644
--- a/src/shared/qwaylandmimehelper.cpp
+++ b/src/shared/qwaylandmimehelper.cpp
@@ -36,7 +36,7 @@ QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString &
content = qvariant_cast<QColor>(mimeData->colorData()).name().toLatin1();
} else if (mimeType == QLatin1String("text/uri-list")) {
QList<QUrl> urls = mimeData->urls();
- for (int i = 0; i < urls.count(); ++i) {
+ for (int i = 0; i < urls.size(); ++i) {
content.append(urls.at(i).toEncoded());
content.append("\r\n");
}
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 1c2883249..db4eb77e4 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -590,7 +590,7 @@ void tst_WaylandClient::longWindowTitleWithUtf16Characters()
{
QWindow window;
QString absurdlyLongTitle = QString("δΈ‰").repeated(10000);
- Q_ASSERT(absurdlyLongTitle.length() == 10000); // just making sure the test isn't broken
+ Q_ASSERT(absurdlyLongTitle.size() == 10000); // just making sure the test isn't broken
window.setTitle(absurdlyLongTitle);
window.show();
QCOMPOSITOR_TRY_VERIFY(surface());
diff --git a/tests/auto/client/clientextension/tst_clientextension.cpp b/tests/auto/client/clientextension/tst_clientextension.cpp
index 209afa822..a6e79bd2c 100644
--- a/tests/auto/client/clientextension/tst_clientextension.cpp
+++ b/tests/auto/client/clientextension/tst_clientextension.cpp
@@ -69,10 +69,10 @@ void tst_clientextension::createWithoutGlobal()
QSignalSpy spy(&extension, &QWaylandClientExtension::activeChanged);
QVERIFY(spy.isValid());
QVERIFY(!extension.isActive());
- QCOMPARE(spy.count(), 0);
+ QCOMPARE(spy.size(), 0);
extension.initialize();
QVERIFY(!extension.isActive());
- QCOMPARE(spy.count(), 0);
+ QCOMPARE(spy.size(), 0);
}
void tst_clientextension::createWithGlobalAutomatic()
@@ -83,7 +83,7 @@ void tst_clientextension::createWithGlobalAutomatic()
QSignalSpy spy(&extension, &QWaylandClientExtension::activeChanged);
QVERIFY(spy.isValid());
QTRY_VERIFY(extension.isActive());
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
}
void tst_clientextension::createWithGlobalManual()
@@ -96,7 +96,7 @@ void tst_clientextension::createWithGlobalManual()
QVERIFY(spy.isValid());
extension.initialize();
QVERIFY(extension.isActive());
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
}
void tst_clientextension::globalBecomesAvailable()
@@ -106,7 +106,7 @@ void tst_clientextension::globalBecomesAvailable()
QVERIFY(spy.isValid());
exec([this] { add<TestGlobal>(); });
QTRY_VERIFY(extension.isActive());
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
}
void tst_clientextension::globalRemoved()
@@ -120,7 +120,7 @@ void tst_clientextension::globalRemoved()
exec([this] { removeAll<TestGlobal>(); });
QTRY_VERIFY(!extension.isActive());
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
}
QCOMPOSITOR_TEST_MAIN(tst_clientextension)
diff --git a/tests/auto/client/datadevicev1/tst_datadevicev1.cpp b/tests/auto/client/datadevicev1/tst_datadevicev1.cpp
index d4dfa2da0..d78255e9f 100644
--- a/tests/auto/client/datadevicev1/tst_datadevicev1.cpp
+++ b/tests/auto/client/datadevicev1/tst_datadevicev1.cpp
@@ -213,7 +213,7 @@ void tst_datadevicev1::destroysSelectionOnLeave()
keyboard()->sendLeave(surface);
});
- QTRY_COMPARE(dataChangedSpy.count(), 1);
+ QTRY_COMPARE(dataChangedSpy.size(), 1);
QVERIFY(!QGuiApplication::clipboard()->mimeData(QClipboard::Clipboard)->hasText());
}
diff --git a/tests/auto/client/fullscreenshellv1/tst_fullscreenshellv1.cpp b/tests/auto/client/fullscreenshellv1/tst_fullscreenshellv1.cpp
index c48e5532b..15613bc04 100644
--- a/tests/auto/client/fullscreenshellv1/tst_fullscreenshellv1.cpp
+++ b/tests/auto/client/fullscreenshellv1/tst_fullscreenshellv1.cpp
@@ -25,7 +25,7 @@ void tst_WaylandClientFullScreenShellV1::createDestroyWindow()
window.resize(800, 600);
window.show();
- QCOMPOSITOR_TRY_VERIFY(fullScreenShellV1()->surfaces().count() == 1);
+ QCOMPOSITOR_TRY_VERIFY(fullScreenShellV1()->surfaces().size() == 1);
QCOMPOSITOR_VERIFY(surface(0));
window.destroy();
diff --git a/tests/auto/client/inputcontext/tst_inputcontext.cpp b/tests/auto/client/inputcontext/tst_inputcontext.cpp
index 9bcfa9e77..328dc1fb2 100644
--- a/tests/auto/client/inputcontext/tst_inputcontext.cpp
+++ b/tests/auto/client/inputcontext/tst_inputcontext.cpp
@@ -36,9 +36,9 @@ private:
{
exec([&] {
QList<arg_type *> extensions = getAll<arg_type>();
- if (extensions.length() > 1)
+ if (extensions.size() > 1)
QFAIL("Requested type is a singleton, hence there should not be more then one object returned");
- if (extensions.length() == 0)
+ if (extensions.size() == 0)
add<arg_type>();
});
}
@@ -48,9 +48,9 @@ private:
{
exec([&] {
QList<arg_type *> extensions = getAll<arg_type>();
- if (extensions.length() > 1)
+ if (extensions.size() > 1)
QFAIL("Requested type is a singleton, hence there should not be more then one object returned");
- if (extensions.length() == 1)
+ if (extensions.size() == 1)
remove(extensions.first());
});
}
diff --git a/tests/auto/client/primaryselectionv1/tst_primaryselectionv1.cpp b/tests/auto/client/primaryselectionv1/tst_primaryselectionv1.cpp
index d947d3006..5ec046d17 100644
--- a/tests/auto/client/primaryselectionv1/tst_primaryselectionv1.cpp
+++ b/tests/auto/client/primaryselectionv1/tst_primaryselectionv1.cpp
@@ -409,7 +409,7 @@ void tst_primaryselectionv1::destroysSelectionOnLeave()
keyboard()->sendLeave(surface);
});
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QVERIFY(!QGuiApplication::clipboard()->mimeData(QClipboard::Selection)->hasText());
}
diff --git a/tests/auto/client/seat/tst_seat.cpp b/tests/auto/client/seat/tst_seat.cpp
index 0b1e1b2a2..68749486b 100644
--- a/tests/auto/client/seat/tst_seat.cpp
+++ b/tests/auto/client/seat/tst_seat.cpp
@@ -94,7 +94,7 @@ void tst_seat::usesEnterSerial()
});
QCOMPOSITOR_TRY_VERIFY(pointer()->cursorSurface());
- QTRY_COMPARE(setCursorSpy.count(), 1);
+ QTRY_COMPARE(setCursorSpy.size(), 1);
QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial);
}
@@ -438,14 +438,14 @@ void tst_seat::singleTap()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
}
@@ -469,14 +469,14 @@ void tst_seat::singleTapFloat()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top()));
}
}
@@ -512,7 +512,7 @@ void tst_seat::multiTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
- QCOMPARE(e.touchPoints.length(), 2);
+ QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Pressed);
QCOMPARE(e.touchPoints[0].position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
@@ -523,7 +523,7 @@ void tst_seat::multiTouch()
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchUpdate);
- QCOMPARE(e.touchPoints.length(), 2);
+ QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Updated);
QCOMPARE(e.touchPoints[0].position(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top()));
@@ -535,7 +535,7 @@ void tst_seat::multiTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchUpdate);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released | QEventPoint::State::Stationary);
- QCOMPARE(e.touchPoints.length(), 2);
+ QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
QCOMPARE(e.touchPoints[0].position(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top()));
@@ -547,7 +547,7 @@ void tst_seat::multiTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
QCOMPARE(e.touchPoints[0].position(), QPointF(49-window.frameMargins().left(), 48-window.frameMargins().top()));
}
@@ -589,14 +589,14 @@ void tst_seat::multiTouchUpAndMotionFrame()
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchUpdate);
- QCOMPARE(e.touchPoints.length(), 2);
+ QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
QCOMPARE(e.touchPoints[1].state(), QEventPoint::State::Updated);
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
}
QVERIFY(window.m_events.empty());
@@ -653,13 +653,13 @@ void tst_seat::cancelTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
- QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchCancel);
- QCOMPARE(e.touchPoints.length(), 0);
+ QCOMPARE(e.touchPoints.size(), 0);
}
}
diff --git a/tests/auto/client/seatv4/tst_seatv4.cpp b/tests/auto/client/seatv4/tst_seatv4.cpp
index 3a5a479fb..873b0ff61 100644
--- a/tests/auto/client/seatv4/tst_seatv4.cpp
+++ b/tests/auto/client/seatv4/tst_seatv4.cpp
@@ -127,7 +127,7 @@ void tst_seatv4::usesEnterSerial()
});
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
- QTRY_COMPARE(setCursorSpy.count(), 1);
+ QTRY_COMPARE(setCursorSpy.size(), 1);
QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial);
}
@@ -139,13 +139,13 @@ void tst_seatv4::focusDestruction()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
// Setting a cursor now is not allowed since there has been no enter event
- QCOMPARE(setCursorSpy.count(), 0);
+ QCOMPARE(setCursorSpy.size(), 0);
uint enterSerial = exec([&] {
return pointer()->sendEnter(xdgSurface()->m_surface, {32, 32});
});
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
- QTRY_COMPARE(setCursorSpy.count(), 1);
+ QTRY_COMPARE(setCursorSpy.size(), 1);
QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial);
// Destroy the focus
@@ -159,7 +159,7 @@ void tst_seatv4::focusDestruction()
// Setting a cursor now is not allowed since there has been no enter event
xdgPingAndWaitForPong();
- QCOMPARE(setCursorSpy.count(), 0);
+ QCOMPARE(setCursorSpy.size(), 0);
}
void tst_seatv4::mousePress()
@@ -568,7 +568,7 @@ void tst_seatv4::animatedCursor()
});
// Verify that we get a new cursor buffer
- QTRY_COMPARE(bufferSpy.count(), 1);
+ QTRY_COMPARE(bufferSpy.size(), 1);
}
#endif // QT_CONFIG(cursor)
diff --git a/tests/auto/client/shared/iviapplication.cpp b/tests/auto/client/shared/iviapplication.cpp
index 7d487d284..978834ca8 100644
--- a/tests/auto/client/shared/iviapplication.cpp
+++ b/tests/auto/client/shared/iviapplication.cpp
@@ -15,7 +15,7 @@ void IviApplication::ivi_application_surface_create(Resource *resource, uint32_t
auto *s = fromResource<Surface>(surface);
auto *iviSurface = new IviSurface(this, s, ivi_id, resource->client(), id, resource->version());
m_iviSurfaces << iviSurface;
- qDebug() << "count is " << m_iviSurfaces.count();
+ qDebug() << "count is " << m_iviSurfaces.size();
}
IviSurface::IviSurface(IviApplication *iviApplication, Surface *surface, uint32_t ivi_id, wl_client *client, int id, int version)
diff --git a/tests/auto/client/shared/mockcompositor.cpp b/tests/auto/client/shared/mockcompositor.cpp
index 03d0ffb6c..1266f7762 100644
--- a/tests/auto/client/shared/mockcompositor.cpp
+++ b/tests/auto/client/shared/mockcompositor.cpp
@@ -92,7 +92,7 @@ void DefaultCompositor::xdgPingAndWaitForPong()
{
QSignalSpy pongSpy(exec([=] { return get<XdgWmBase>(); }), &XdgWmBase::pong);
uint serial = exec([=] { return sendXdgShellPing(); });
- QTRY_COMPARE(pongSpy.count(), 1);
+ QTRY_COMPARE(pongSpy.size(), 1);
QTRY_COMPARE(pongSpy.first().at(0).toUInt(), serial);
}
diff --git a/tests/auto/client/surface/tst_surface.cpp b/tests/auto/client/surface/tst_surface.cpp
index e83450861..083bc4faa 100644
--- a/tests/auto/client/surface/tst_surface.cpp
+++ b/tests/auto/client/surface/tst_surface.cpp
@@ -55,7 +55,7 @@ void tst_surface::waitForFrameCallbackRaster()
exec([=] { xdgToplevel()->sendCompleteConfigure(); });
// We should get the first buffer without waiting for a frame callback
- QTRY_COMPARE(bufferSpy.count(), 1);
+ QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
// Make sure we follow frame callbacks for some frames
@@ -66,7 +66,7 @@ void tst_surface::waitForFrameCallbackRaster()
QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty());
xdgToplevel()->surface()->sendFrameCallbacks();
});
- QTRY_COMPARE(bufferSpy.count(), 1);
+ QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
}
}
@@ -96,14 +96,14 @@ void tst_surface::waitForFrameCallbackGl()
exec([=] { xdgToplevel()->sendCompleteConfigure(); });
// We should get the first buffer without waiting for a frame callback
- QTRY_COMPARE(bufferSpy.count(), 1);
+ QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
// Make sure we follow frame callbacks for some frames
for (int i = 0; i < 5; ++i) {
xdgPingAndWaitForPong(); // Make sure things have happened on the client
if (!qEnvironmentVariableIntValue("QT_WAYLAND_DISABLE_WINDOWDECORATION") && i == 0) {
- QCOMPARE(bufferSpy.count(), 1);
+ QCOMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
}
exec([&] {
@@ -111,7 +111,7 @@ void tst_surface::waitForFrameCallbackGl()
QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty());
xdgToplevel()->surface()->sendFrameCallbacks();
});
- QTRY_COMPARE(bufferSpy.count(), 1);
+ QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
}
}
@@ -168,15 +168,15 @@ void tst_surface::createSubsurface()
// Move subsurface. The parent should redraw and commit
subWindow.setGeometry(100, 100, 64, 64);
// the toplevel should commit to indicate the subsurface moved
- QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1);
+ QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.size(), 1);
mainSurfaceCommitSpy.clear();
childSurfaceCommitSpy.clear();
// Move and resize the subSurface. The parent should redraw and commit
// The child should also redraw
subWindow.setGeometry(50, 50, 80, 80);
- QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1);
- QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.count(), 1);
+ QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.size(), 1);
+ QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.size(), 1);
}
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp
index 8d275e1eb..e560784e9 100644
--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp
+++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp
@@ -78,7 +78,7 @@ void tst_xdgshell::basicConfigure()
QTRY_VERIFY(window.isExposed());
// The client is now going to ack the configure
- QTRY_COMPARE(configureSpy.count(), 1);
+ QTRY_COMPARE(configureSpy.size(), 1);
QCOMPARE(configureSpy.takeFirst().at(0).toUInt(), serial);
// And attach a buffer
@@ -104,7 +104,7 @@ void tst_xdgshell::configureSize()
xdgToplevel()->sendCompleteConfigure(configureSize);
});
- QTRY_COMPARE(configureSpy.count(), 1);
+ QTRY_COMPARE(configureSpy.size(), 1);
exec([=] {
Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer;
@@ -192,7 +192,7 @@ void tst_xdgshell::popup()
QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
QSignalSpy toplevelConfigureSpy(exec([=] { return xdgSurface(); }), &XdgSurface::configureCommitted);
exec([=] { xdgToplevel()->sendCompleteConfigure(); });
- QTRY_COMPARE(toplevelConfigureSpy.count(), 1);
+ QTRY_COMPARE(toplevelConfigureSpy.size(), 1);
uint clickSerial = exec([=] {
auto *surface = xdgToplevel()->surface();
@@ -230,7 +230,7 @@ void tst_xdgshell::popup()
QTRY_VERIFY(popup->isExposed());
// The client is now going to ack the configure
- QTRY_COMPARE(popupConfigureSpy.count(), 1);
+ QTRY_COMPARE(popupConfigureSpy.size(), 1);
QCOMPARE(popupConfigureSpy.takeFirst().at(0).toUInt(), configureSerial);
// And attach a buffer
@@ -560,7 +560,7 @@ void tst_xdgshell::pongs()
wl_resource *resource = base->resourceMap().first()->handle;
base->send_ping(resource, serial);
});
- QTRY_COMPARE(pongSpy.count(), 1);
+ QTRY_COMPARE(pongSpy.size(), 1);
QCOMPARE(pongSpy.first().at(0).toUInt(), serial);
}
@@ -626,7 +626,7 @@ void tst_xdgshell::foreignSurface()
// the pointer events above are handled.
QSignalSpy spy(exec([=] { return surface(newSurfaceIndex); }), &Surface::commit);
wl_surface_commit(foreignSurface);
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
wl_surface_destroy(foreignSurface);
}
diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp
index 9c70ef84e..ed7490b36 100644
--- a/tests/auto/compositor/compositor/tst_compositor.cpp
+++ b/tests/auto/compositor/compositor/tst_compositor.cpp
@@ -312,14 +312,14 @@ void tst_WaylandCompositor::keyboardGrab()
//QSignalSpy grabModifierSpy(grab, SIGNAL(modifiersCalled()));
seat->setKeyboardFocus(waylandSurface);
- QTRY_COMPARE(grabFocusSpy.count(), 1);
+ QTRY_COMPARE(grabFocusSpy.size(), 1);
QKeyEvent ke(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, 30, 0, 0);
QKeyEvent ke1(QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier, 30, 0, 0);
seat->sendFullKeyEvent(&ke);
seat->sendFullKeyEvent(&ke1);
- QTRY_COMPARE(grabKeyPressSpy.count(), 1);
- QTRY_COMPARE(grabKeyReleaseSpy.count(), 1);
+ QTRY_COMPARE(grabKeyPressSpy.size(), 1);
+ QTRY_COMPARE(grabKeyReleaseSpy.size(), 1);
QKeyEvent ke2(QEvent::KeyPress, Qt::Key_Shift, Qt::NoModifier, 50, 0, 0);
QKeyEvent ke3(QEvent::KeyRelease, Qt::Key_Shift, Qt::NoModifier, 50, 0, 0);
@@ -327,14 +327,14 @@ void tst_WaylandCompositor::keyboardGrab()
seat->sendFullKeyEvent(&ke3);
//QTRY_COMPARE(grabModifierSpy.count(), 2);
// Modifiers are also keys
- QTRY_COMPARE(grabKeyPressSpy.count(), 2);
- QTRY_COMPARE(grabKeyReleaseSpy.count(), 2);
+ QTRY_COMPARE(grabKeyPressSpy.size(), 2);
+ QTRY_COMPARE(grabKeyReleaseSpy.size(), 2);
// Stop grabbing
seat->setKeyboardFocus(nullptr);
seat->sendFullKeyEvent(&ke);
seat->sendFullKeyEvent(&ke1);
- QTRY_COMPARE(grabKeyPressSpy.count(), 2);
+ QTRY_COMPARE(grabKeyPressSpy.size(), 2);
}
void tst_WaylandCompositor::geometry()
@@ -466,7 +466,7 @@ void tst_WaylandCompositor::mapSurface()
wl_surface_damage(surface, 0, 0, size.width(), size.height());
wl_surface_commit(surface);
- QTRY_COMPARE(hasContentSpy.count(), 1);
+ QTRY_COMPARE(hasContentSpy.size(), 1);
QCOMPARE(waylandSurface->hasContent(), true);
QCOMPARE(waylandSurface->bufferSize(), size);
QCOMPARE(waylandSurface->destinationSize(), size);
@@ -534,21 +534,21 @@ void tst_WaylandCompositor::mapSurfaceHiDpi()
QCOMPARE(waylandSurface->destinationSize(), QSize());
QCOMPARE(waylandSurface->hasContent(), false);
QCOMPARE(waylandSurface->bufferScale(), 1);
- QCOMPARE(offsetSpy.count(), 0);
+ QCOMPARE(offsetSpy.size(), 0);
wl_surface_commit(surface);
- QTRY_COMPARE(hasContentSpy.count(), 1);
- QTRY_COMPARE(bufferSizeSpy.count(), 1);
- QTRY_COMPARE(destinationSizeSpy.count(), 1);
- QTRY_COMPARE(bufferScaleSpy.count(), 1);
- QTRY_COMPARE(offsetSpy.count(), 1);
- QTRY_COMPARE(damagedSpy.count(), 1);
+ QTRY_COMPARE(hasContentSpy.size(), 1);
+ QTRY_COMPARE(bufferSizeSpy.size(), 1);
+ QTRY_COMPARE(destinationSizeSpy.size(), 1);
+ QTRY_COMPARE(bufferScaleSpy.size(), 1);
+ QTRY_COMPARE(offsetSpy.size(), 1);
+ QTRY_COMPARE(damagedSpy.size(), 1);
// Now verify that wl_surface_damage_buffer gets mapped properly
wl_surface_damage_buffer(surface, 0, 0, bufferSize.width(), bufferSize.height());
wl_surface_commit(surface);
- QTRY_COMPARE(damagedSpy.count(), 2);
+ QTRY_COMPARE(damagedSpy.size(), 2);
wl_surface_destroy(surface);
}
@@ -617,7 +617,7 @@ void tst_WaylandCompositor::frameCallback()
wl_surface_commit(surface);
QTRY_COMPARE(waylandSurface->hasContent(), true);
- QTRY_COMPARE(damagedSpy.count(), i + 1);
+ QTRY_COMPARE(damagedSpy.size(), i + 1);
QCOMPARE(static_cast<BufferView*>(waylandSurface->views().first())->image(), buffer.image);
compositor.defaultOutput()->frameStarted();
@@ -673,18 +673,18 @@ void tst_WaylandCompositor::outputs()
window.resize(800, 600);
auto output = new QWaylandOutput(&compositor, &window);
- QTRY_COMPARE(outputAddedSpy.count(), 1);
+ QTRY_COMPARE(outputAddedSpy.size(), 1);
compositor.setDefaultOutput(output);
- QTRY_COMPARE(defaultOutputSpy.count(), 2);
+ QTRY_COMPARE(defaultOutputSpy.size(), 2);
MockClient client;
QTRY_COMPARE(client.m_outputs.size(), 2);
delete output;
- QTRY_COMPARE(outputRemovedSpy.count(), 1);
+ QTRY_COMPARE(outputRemovedSpy.size(), 1);
QEXPECT_FAIL("", "FIXME: defaultOutputChanged() is not emitted when the default output is removed", Continue);
- QTRY_COMPARE(defaultOutputSpy.count(), 3);
+ QTRY_COMPARE(defaultOutputSpy.size(), 3);
compositor.flushClients();
QTRY_COMPARE(client.m_outputs.size(), 1);
}
@@ -966,7 +966,7 @@ void tst_WaylandCompositor::createsXdgSurfaces()
wl_surface *surface = client.createSurface();
xdg_surface *clientXdgSurface = client.createXdgSurface(surface);
- QTRY_COMPARE(xdgSurfaceCreatedSpy.count(), 1);
+ QTRY_COMPARE(xdgSurfaceCreatedSpy.size(), 1);
QTRY_VERIFY(xdgSurface);
QTRY_VERIFY(xdgSurface->surface());
@@ -1183,7 +1183,7 @@ void tst_WaylandCompositor::createsIviSurfaces()
wl_surface *surface = client.createSurface();
client.createIviSurface(surface, 123);
- QTRY_COMPARE(iviSurfaceCreatedSpy.count(), 1);
+ QTRY_COMPARE(iviSurfaceCreatedSpy.size(), 1);
QTRY_VERIFY(iviSurface);
QTRY_VERIFY(iviSurface->surface());
QTRY_COMPARE(iviSurface->iviId(), 123u);
@@ -1210,7 +1210,7 @@ void tst_WaylandCompositor::emitsErrorOnSameIviId()
{
MockClient secondClient;
QTRY_VERIFY(&secondClient.iviApplication);
- QTRY_COMPARE(compositor.clients().count(), 2);
+ QTRY_COMPARE(compositor.clients().size(), 2);
secondClient.createIviSurface(secondClient.createSurface(), 123);
compositor.flushClients();
@@ -1218,7 +1218,7 @@ void tst_WaylandCompositor::emitsErrorOnSameIviId()
QTRY_COMPARE(secondClient.error, EPROTO);
QTRY_COMPARE(secondClient.protocolError.interface, &ivi_application_interface);
QTRY_COMPARE(static_cast<ivi_application_error>(secondClient.protocolError.code), IVI_APPLICATION_ERROR_IVI_ID);
- QTRY_COMPARE(compositor.clients().count(), 1);
+ QTRY_COMPARE(compositor.clients().size(), 1);
}
}
@@ -1292,7 +1292,7 @@ void tst_WaylandCompositor::destroysIviSurfaces()
QSignalSpy destroySpy(iviSurface, SIGNAL(destroyed()));
mockIviSurface.destroy();
- QTRY_VERIFY(destroySpy.count() == 1);
+ QTRY_VERIFY(destroySpy.size() == 1);
}
class ViewporterTestCompositor: public TestCompositor {
@@ -1728,7 +1728,7 @@ void tst_WaylandCompositor::idleInhibit()
QVERIFY(idleInhibitor);
QTRY_COMPARE(waylandSurfacePrivate->idleInhibitors.size(), 1);
QCOMPARE(waylandSurface->inhibitsIdle(), true);
- QTRY_COMPARE(changedSpy.count(), 1);
+ QTRY_COMPARE(changedSpy.size(), 1);
}
class XdgOutputCompositor : public TestCompositor