File indexing completed on 2024-11-10 04:56:25
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #include "testutils.h" 0010 // KWin 0011 #include "utils/xcbutils.h" 0012 // Qt 0013 #include <QApplication> 0014 #include <QTest> 0015 #include <netwm.h> 0016 #include <private/qtx11extras_p.h> 0017 // xcb 0018 #include <xcb/xcb.h> 0019 #include <xcb/xcb_icccm.h> 0020 0021 using namespace KWin; 0022 0023 class TestXcbSizeHints : public QObject 0024 { 0025 Q_OBJECT 0026 private Q_SLOTS: 0027 void initTestCase(); 0028 void init(); 0029 void cleanup(); 0030 void testSizeHints_data(); 0031 void testSizeHints(); 0032 void testSizeHintsEmpty(); 0033 void testSizeHintsNotSet(); 0034 void geometryHintsBeforeInit(); 0035 void geometryHintsBeforeRead(); 0036 0037 private: 0038 Xcb::Window m_testWindow; 0039 }; 0040 0041 void TestXcbSizeHints::initTestCase() 0042 { 0043 qApp->setProperty("x11RootWindow", QVariant::fromValue<quint32>(QX11Info::appRootWindow())); 0044 qApp->setProperty("x11Connection", QVariant::fromValue<void *>(QX11Info::connection())); 0045 } 0046 0047 void TestXcbSizeHints::init() 0048 { 0049 const uint32_t values[] = {true}; 0050 m_testWindow.create(QRect(0, 0, 10, 10), XCB_WINDOW_CLASS_INPUT_ONLY, XCB_CW_OVERRIDE_REDIRECT, values); 0051 QVERIFY(m_testWindow.isValid()); 0052 } 0053 0054 void TestXcbSizeHints::cleanup() 0055 { 0056 m_testWindow.reset(); 0057 } 0058 0059 void TestXcbSizeHints::testSizeHints_data() 0060 { 0061 // set 0062 QTest::addColumn<QPoint>("userPos"); 0063 QTest::addColumn<QSize>("userSize"); 0064 QTest::addColumn<QSize>("minSize"); 0065 QTest::addColumn<QSize>("maxSize"); 0066 QTest::addColumn<QSize>("resizeInc"); 0067 QTest::addColumn<QSize>("minAspect"); 0068 QTest::addColumn<QSize>("maxAspect"); 0069 QTest::addColumn<QSize>("baseSize"); 0070 QTest::addColumn<qint32>("gravity"); 0071 // read for SizeHints 0072 QTest::addColumn<qint32>("expectedFlags"); 0073 QTest::addColumn<qint32>("expectedPad0"); 0074 QTest::addColumn<qint32>("expectedPad1"); 0075 QTest::addColumn<qint32>("expectedPad2"); 0076 QTest::addColumn<qint32>("expectedPad3"); 0077 QTest::addColumn<qint32>("expectedMinWidth"); 0078 QTest::addColumn<qint32>("expectedMinHeight"); 0079 QTest::addColumn<qint32>("expectedMaxWidth"); 0080 QTest::addColumn<qint32>("expectedMaxHeight"); 0081 QTest::addColumn<qint32>("expectedWidthInc"); 0082 QTest::addColumn<qint32>("expectedHeightInc"); 0083 QTest::addColumn<qint32>("expectedMinAspectNum"); 0084 QTest::addColumn<qint32>("expectedMinAspectDen"); 0085 QTest::addColumn<qint32>("expectedMaxAspectNum"); 0086 QTest::addColumn<qint32>("expectedMaxAspectDen"); 0087 QTest::addColumn<qint32>("expectedBaseWidth"); 0088 QTest::addColumn<qint32>("expectedBaseHeight"); 0089 // read for GeometryHints 0090 QTest::addColumn<QSize>("expectedMinSize"); 0091 QTest::addColumn<QSize>("expectedMaxSize"); 0092 QTest::addColumn<QSize>("expectedResizeIncrements"); 0093 QTest::addColumn<QSize>("expectedMinAspect"); 0094 QTest::addColumn<QSize>("expectedMaxAspect"); 0095 QTest::addColumn<QSize>("expectedBaseSize"); 0096 QTest::addColumn<qint32>("expectedGravity"); 0097 0098 QTest::newRow("userPos") << QPoint(1, 2) << QSize() << QSize() << QSize() << QSize() << QSize() << QSize() << QSize() << 0 0099 << 1 << 1 << 2 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0100 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0101 QTest::newRow("userSize") << QPoint() << QSize(1, 2) << QSize() << QSize() << QSize() << QSize() << QSize() << QSize() << 0 0102 << 2 << 0 << 0 << 1 << 2 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0103 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0104 QTest::newRow("minSize") << QPoint() << QSize() << QSize(1, 2) << QSize() << QSize() << QSize() << QSize() << QSize() << 0 0105 << 16 << 0 << 0 << 0 << 0 << 1 << 2 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0106 << QSize(1, 2) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0107 QTest::newRow("maxSize") << QPoint() << QSize() << QSize() << QSize(1, 2) << QSize() << QSize() << QSize() << QSize() << 0 0108 << 32 << 0 << 0 << 0 << 0 << 0 << 0 << 1 << 2 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0109 << QSize(0, 0) << QSize(1, 2) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0110 QTest::newRow("maxSize0") << QPoint() << QSize() << QSize() << QSize(0, 0) << QSize() << QSize() << QSize() << QSize() << 0 0111 << 32 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0112 << QSize(0, 0) << QSize(1, 1) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0113 QTest::newRow("min/maxSize") << QPoint() << QSize() << QSize(1, 2) << QSize(3, 4) << QSize() << QSize() << QSize() << QSize() << 0 0114 << 48 << 0 << 0 << 0 << 0 << 1 << 2 << 3 << 4 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0115 << QSize(1, 2) << QSize(3, 4) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0116 QTest::newRow("resizeInc") << QPoint() << QSize() << QSize() << QSize() << QSize(1, 2) << QSize() << QSize() << QSize() << 0 0117 << 64 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 1 << 2 << 0 << 0 << 0 << 0 << 0 << 0 0118 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 2) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0119 QTest::newRow("resizeInc0") << QPoint() << QSize() << QSize() << QSize() << QSize(0, 0) << QSize() << QSize() << QSize() << 0 0120 << 64 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0121 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0122 QTest::newRow("aspect") << QPoint() << QSize() << QSize() << QSize() << QSize() << QSize(1, 2) << QSize(3, 4) << QSize() << 0 0123 << 128 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 1 << 2 << 3 << 4 << 0 << 0 0124 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, 2) << QSize(3, 4) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0125 QTest::newRow("aspectDivision0") << QPoint() << QSize() << QSize() << QSize() << QSize() << QSize(1, 0) << QSize(3, 0) << QSize() << 0 0126 << 128 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 1 << 0 << 3 << 0 << 0 << 0 0127 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, 1) << QSize(3, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_NORTH_WEST); 0128 QTest::newRow("baseSize") << QPoint() << QSize() << QSize() << QSize() << QSize() << QSize() << QSize() << QSize(1, 2) << 0 0129 << 256 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 1 << 2 0130 << QSize(1, 2) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(1, 2) << qint32(XCB_GRAVITY_NORTH_WEST); 0131 QTest::newRow("gravity") << QPoint() << QSize() << QSize() << QSize() << QSize() << QSize() << QSize() << QSize() << qint32(XCB_GRAVITY_STATIC) 0132 << 512 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 0133 << QSize(0, 0) << QSize(INT_MAX, INT_MAX) << QSize(1, 1) << QSize(1, INT_MAX) << QSize(INT_MAX, 1) << QSize(0, 0) << qint32(XCB_GRAVITY_STATIC); 0134 QTest::newRow("all") << QPoint(1, 2) << QSize(3, 4) << QSize(5, 6) << QSize(7, 8) << QSize(9, 10) << QSize(11, 12) << QSize(13, 14) << QSize(15, 16) << 1 0135 << 1011 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15 << 16 0136 << QSize(5, 6) << QSize(7, 8) << QSize(9, 10) << QSize(11, 12) << QSize(13, 14) << QSize(15, 16) << qint32(XCB_GRAVITY_NORTH_WEST); 0137 } 0138 0139 void TestXcbSizeHints::testSizeHints() 0140 { 0141 xcb_size_hints_t hints; 0142 memset(&hints, 0, sizeof(hints)); 0143 QFETCH(QPoint, userPos); 0144 if (!userPos.isNull()) { 0145 xcb_icccm_size_hints_set_position(&hints, 1, userPos.x(), userPos.y()); 0146 } 0147 QFETCH(QSize, userSize); 0148 if (userSize.isValid()) { 0149 xcb_icccm_size_hints_set_size(&hints, 1, userSize.width(), userSize.height()); 0150 } 0151 QFETCH(QSize, minSize); 0152 if (minSize.isValid()) { 0153 xcb_icccm_size_hints_set_min_size(&hints, minSize.width(), minSize.height()); 0154 } 0155 QFETCH(QSize, maxSize); 0156 if (maxSize.isValid()) { 0157 xcb_icccm_size_hints_set_max_size(&hints, maxSize.width(), maxSize.height()); 0158 } 0159 QFETCH(QSize, resizeInc); 0160 if (resizeInc.isValid()) { 0161 xcb_icccm_size_hints_set_resize_inc(&hints, resizeInc.width(), resizeInc.height()); 0162 } 0163 QFETCH(QSize, minAspect); 0164 QFETCH(QSize, maxAspect); 0165 if (minAspect.isValid() && maxAspect.isValid()) { 0166 xcb_icccm_size_hints_set_aspect(&hints, minAspect.width(), minAspect.height(), maxAspect.width(), maxAspect.height()); 0167 } 0168 QFETCH(QSize, baseSize); 0169 if (baseSize.isValid()) { 0170 xcb_icccm_size_hints_set_base_size(&hints, baseSize.width(), baseSize.height()); 0171 } 0172 QFETCH(qint32, gravity); 0173 if (gravity != 0) { 0174 xcb_icccm_size_hints_set_win_gravity(&hints, (xcb_gravity_t)gravity); 0175 } 0176 xcb_icccm_set_wm_normal_hints(QX11Info::connection(), m_testWindow, &hints); 0177 xcb_flush(QX11Info::connection()); 0178 0179 Xcb::GeometryHints geoHints; 0180 geoHints.init(m_testWindow); 0181 geoHints.read(); 0182 QCOMPARE(geoHints.hasAspect(), minAspect.isValid() && maxAspect.isValid()); 0183 QCOMPARE(geoHints.hasBaseSize(), baseSize.isValid()); 0184 QCOMPARE(geoHints.hasMaxSize(), maxSize.isValid()); 0185 QCOMPARE(geoHints.hasMinSize(), minSize.isValid()); 0186 QCOMPARE(geoHints.hasPosition(), !userPos.isNull()); 0187 QCOMPARE(geoHints.hasResizeIncrements(), resizeInc.isValid()); 0188 QCOMPARE(geoHints.hasSize(), userSize.isValid()); 0189 QCOMPARE(geoHints.hasWindowGravity(), gravity != 0); 0190 QTEST(geoHints.baseSize().toSize(), "expectedBaseSize"); 0191 QTEST(geoHints.maxAspect(), "expectedMaxAspect"); 0192 QTEST(geoHints.maxSize().toSize(), "expectedMaxSize"); 0193 QTEST(geoHints.minAspect(), "expectedMinAspect"); 0194 QTEST(geoHints.minSize().toSize(), "expectedMinSize"); 0195 QTEST(geoHints.resizeIncrements().toSize(), "expectedResizeIncrements"); 0196 QTEST(qint32(geoHints.windowGravity()), "expectedGravity"); 0197 0198 auto sizeHints = geoHints.m_sizeHints; 0199 QVERIFY(sizeHints); 0200 QTEST(sizeHints->flags, "expectedFlags"); 0201 QTEST(sizeHints->pad[0], "expectedPad0"); 0202 QTEST(sizeHints->pad[1], "expectedPad1"); 0203 QTEST(sizeHints->pad[2], "expectedPad2"); 0204 QTEST(sizeHints->pad[3], "expectedPad3"); 0205 QTEST(sizeHints->minWidth, "expectedMinWidth"); 0206 QTEST(sizeHints->minHeight, "expectedMinHeight"); 0207 QTEST(sizeHints->maxWidth, "expectedMaxWidth"); 0208 QTEST(sizeHints->maxHeight, "expectedMaxHeight"); 0209 QTEST(sizeHints->widthInc, "expectedWidthInc"); 0210 QTEST(sizeHints->heightInc, "expectedHeightInc"); 0211 QTEST(sizeHints->minAspect[0], "expectedMinAspectNum"); 0212 QTEST(sizeHints->minAspect[1], "expectedMinAspectDen"); 0213 QTEST(sizeHints->maxAspect[0], "expectedMaxAspectNum"); 0214 QTEST(sizeHints->maxAspect[1], "expectedMaxAspectDen"); 0215 QTEST(sizeHints->baseWidth, "expectedBaseWidth"); 0216 QTEST(sizeHints->baseHeight, "expectedBaseHeight"); 0217 QCOMPARE(sizeHints->winGravity, gravity); 0218 0219 // copy 0220 Xcb::GeometryHints::NormalHints::SizeHints sizeHints2 = *sizeHints; 0221 QTEST(sizeHints2.flags, "expectedFlags"); 0222 QTEST(sizeHints2.pad[0], "expectedPad0"); 0223 QTEST(sizeHints2.pad[1], "expectedPad1"); 0224 QTEST(sizeHints2.pad[2], "expectedPad2"); 0225 QTEST(sizeHints2.pad[3], "expectedPad3"); 0226 QTEST(sizeHints2.minWidth, "expectedMinWidth"); 0227 QTEST(sizeHints2.minHeight, "expectedMinHeight"); 0228 QTEST(sizeHints2.maxWidth, "expectedMaxWidth"); 0229 QTEST(sizeHints2.maxHeight, "expectedMaxHeight"); 0230 QTEST(sizeHints2.widthInc, "expectedWidthInc"); 0231 QTEST(sizeHints2.heightInc, "expectedHeightInc"); 0232 QTEST(sizeHints2.minAspect[0], "expectedMinAspectNum"); 0233 QTEST(sizeHints2.minAspect[1], "expectedMinAspectDen"); 0234 QTEST(sizeHints2.maxAspect[0], "expectedMaxAspectNum"); 0235 QTEST(sizeHints2.maxAspect[1], "expectedMaxAspectDen"); 0236 QTEST(sizeHints2.baseWidth, "expectedBaseWidth"); 0237 QTEST(sizeHints2.baseHeight, "expectedBaseHeight"); 0238 QCOMPARE(sizeHints2.winGravity, gravity); 0239 } 0240 0241 void TestXcbSizeHints::testSizeHintsEmpty() 0242 { 0243 xcb_size_hints_t xcbHints; 0244 memset(&xcbHints, 0, sizeof(xcbHints)); 0245 xcb_icccm_set_wm_normal_hints(QX11Info::connection(), m_testWindow, &xcbHints); 0246 xcb_flush(QX11Info::connection()); 0247 0248 Xcb::GeometryHints hints; 0249 hints.init(m_testWindow); 0250 hints.read(); 0251 QVERIFY(!hints.hasAspect()); 0252 QVERIFY(!hints.hasBaseSize()); 0253 QVERIFY(!hints.hasMaxSize()); 0254 QVERIFY(!hints.hasMinSize()); 0255 QVERIFY(!hints.hasPosition()); 0256 QVERIFY(!hints.hasResizeIncrements()); 0257 QVERIFY(!hints.hasSize()); 0258 QVERIFY(!hints.hasWindowGravity()); 0259 0260 QCOMPARE(hints.baseSize(), QSize(0, 0)); 0261 QCOMPARE(hints.maxAspect(), QSize(INT_MAX, 1)); 0262 QCOMPARE(hints.maxSize(), QSize(INT_MAX, INT_MAX)); 0263 QCOMPARE(hints.minAspect(), QSize(1, INT_MAX)); 0264 QCOMPARE(hints.minSize(), QSize(0, 0)); 0265 QCOMPARE(hints.resizeIncrements(), QSize(1, 1)); 0266 QCOMPARE(hints.windowGravity(), XCB_GRAVITY_NORTH_WEST); 0267 0268 auto sizeHints = hints.m_sizeHints; 0269 QVERIFY(sizeHints); 0270 QCOMPARE(sizeHints->flags, 0); 0271 QCOMPARE(sizeHints->pad[0], 0); 0272 QCOMPARE(sizeHints->pad[1], 0); 0273 QCOMPARE(sizeHints->pad[2], 0); 0274 QCOMPARE(sizeHints->pad[3], 0); 0275 QCOMPARE(sizeHints->minWidth, 0); 0276 QCOMPARE(sizeHints->minHeight, 0); 0277 QCOMPARE(sizeHints->maxWidth, 0); 0278 QCOMPARE(sizeHints->maxHeight, 0); 0279 QCOMPARE(sizeHints->widthInc, 0); 0280 QCOMPARE(sizeHints->heightInc, 0); 0281 QCOMPARE(sizeHints->minAspect[0], 0); 0282 QCOMPARE(sizeHints->minAspect[1], 0); 0283 QCOMPARE(sizeHints->maxAspect[0], 0); 0284 QCOMPARE(sizeHints->maxAspect[1], 0); 0285 QCOMPARE(sizeHints->baseWidth, 0); 0286 QCOMPARE(sizeHints->baseHeight, 0); 0287 QCOMPARE(sizeHints->winGravity, 0); 0288 } 0289 0290 void TestXcbSizeHints::testSizeHintsNotSet() 0291 { 0292 Xcb::GeometryHints hints; 0293 hints.init(m_testWindow); 0294 hints.read(); 0295 QVERIFY(!hints.m_sizeHints); 0296 QVERIFY(!hints.hasAspect()); 0297 QVERIFY(!hints.hasBaseSize()); 0298 QVERIFY(!hints.hasMaxSize()); 0299 QVERIFY(!hints.hasMinSize()); 0300 QVERIFY(!hints.hasPosition()); 0301 QVERIFY(!hints.hasResizeIncrements()); 0302 QVERIFY(!hints.hasSize()); 0303 QVERIFY(!hints.hasWindowGravity()); 0304 0305 QCOMPARE(hints.baseSize(), QSize(0, 0)); 0306 QCOMPARE(hints.maxAspect(), QSize(INT_MAX, 1)); 0307 QCOMPARE(hints.maxSize(), QSize(INT_MAX, INT_MAX)); 0308 QCOMPARE(hints.minAspect(), QSize(1, INT_MAX)); 0309 QCOMPARE(hints.minSize(), QSize(0, 0)); 0310 QCOMPARE(hints.resizeIncrements(), QSize(1, 1)); 0311 QCOMPARE(hints.windowGravity(), XCB_GRAVITY_NORTH_WEST); 0312 } 0313 0314 void TestXcbSizeHints::geometryHintsBeforeInit() 0315 { 0316 Xcb::GeometryHints hints; 0317 QVERIFY(!hints.hasAspect()); 0318 QVERIFY(!hints.hasBaseSize()); 0319 QVERIFY(!hints.hasMaxSize()); 0320 QVERIFY(!hints.hasMinSize()); 0321 QVERIFY(!hints.hasPosition()); 0322 QVERIFY(!hints.hasResizeIncrements()); 0323 QVERIFY(!hints.hasSize()); 0324 QVERIFY(!hints.hasWindowGravity()); 0325 0326 QCOMPARE(hints.baseSize(), QSize(0, 0)); 0327 QCOMPARE(hints.maxAspect(), QSize(INT_MAX, 1)); 0328 QCOMPARE(hints.maxSize(), QSize(INT_MAX, INT_MAX)); 0329 QCOMPARE(hints.minAspect(), QSize(1, INT_MAX)); 0330 QCOMPARE(hints.minSize(), QSize(0, 0)); 0331 QCOMPARE(hints.resizeIncrements(), QSize(1, 1)); 0332 QCOMPARE(hints.windowGravity(), XCB_GRAVITY_NORTH_WEST); 0333 } 0334 0335 void TestXcbSizeHints::geometryHintsBeforeRead() 0336 { 0337 xcb_size_hints_t xcbHints; 0338 memset(&xcbHints, 0, sizeof(xcbHints)); 0339 xcb_icccm_size_hints_set_position(&xcbHints, 1, 1, 2); 0340 xcb_icccm_set_wm_normal_hints(QX11Info::connection(), m_testWindow, &xcbHints); 0341 xcb_flush(QX11Info::connection()); 0342 0343 Xcb::GeometryHints hints; 0344 hints.init(m_testWindow); 0345 QVERIFY(!hints.hasAspect()); 0346 QVERIFY(!hints.hasBaseSize()); 0347 QVERIFY(!hints.hasMaxSize()); 0348 QVERIFY(!hints.hasMinSize()); 0349 QVERIFY(!hints.hasPosition()); 0350 QVERIFY(!hints.hasResizeIncrements()); 0351 QVERIFY(!hints.hasSize()); 0352 QVERIFY(!hints.hasWindowGravity()); 0353 0354 QCOMPARE(hints.baseSize(), QSize(0, 0)); 0355 QCOMPARE(hints.maxAspect(), QSize(INT_MAX, 1)); 0356 QCOMPARE(hints.maxSize(), QSize(INT_MAX, INT_MAX)); 0357 QCOMPARE(hints.minAspect(), QSize(1, INT_MAX)); 0358 QCOMPARE(hints.minSize(), QSize(0, 0)); 0359 QCOMPARE(hints.resizeIncrements(), QSize(1, 1)); 0360 QCOMPARE(hints.windowGravity(), XCB_GRAVITY_NORTH_WEST); 0361 } 0362 0363 Q_CONSTRUCTOR_FUNCTION(forceXcb) 0364 QTEST_MAIN(TestXcbSizeHints) 0365 #include "test_xcb_size_hints.moc"