From 82b1f4b90d05d74fc0ed38421d1d832355452d08 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 12 Dec 2022 10:41:36 +0100 Subject: [PATCH] Fix compiler warning when comparing integers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cocoa's columnArray::count is an unsiged int, resulting in a compile warning when QCOMPARE'ed with a signed integer literal. Change-Id: I420a9e89bba5feeb9d8a040a06e6ba0e209c82f3 Reviewed-by: Tor Arne Vestbø --- .../auto/other/qaccessibilitymac/tst_qaccessibilitymac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.mm index 3b1979c030e..22ae50eb198 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.mm @@ -705,12 +705,14 @@ void tst_QAccessibilityMac::tableViewTest() // here start actual tableview tests // Should have 2 columns + const unsigned int columnCount = 2; NSArray *columnArray = [tv tableColumns]; - QCOMPARE([columnArray count], 2); + QCOMPARE([columnArray count], columnCount); // should have 3 rows + const unsigned int rowCount = 3; NSArray *rowArray = [tv tableRows]; - QCOMPARE([rowArray count], 3); + QCOMPARE([rowArray count], rowCount); // The individual cells are children of the rows TestAXObject *row = [[TestAXObject alloc] initWithAXUIElementRef:(AXUIElementRef)rowArray[0]]; @@ -722,7 +724,7 @@ void tst_QAccessibilityMac::tableViewTest() // both rows and columns are direct children of the table NSArray *childList = [tv childList]; - QCOMPARE([childList count], 5); // 3 rows + 2 columns + QCOMPARE([childList count], columnCount + rowCount); for (id child in childList) { TestAXObject *childObject = [[TestAXObject alloc] initWithAXUIElementRef:(AXUIElementRef)child]; QVERIFY([childObject.role isEqualToString:NSAccessibilityRowRole] ||