From b15e01ff4e004fc89bcec205f0ee26e2e628b041 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 15 Feb 2022 15:17:43 +0100 Subject: [PATCH] Use LogElementType rather than int as test-element type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All callers do in fact pass members of the enum, so just making the defualt value be LET_Undefined rather than -1 eliminates any need for it to be an int. Change-Id: Ic1c9ae1522363666d1208aba60d4b4df5eff6ce0 Reviewed-by: Tor Arne Vestbø --- src/testlib/qtestcoreelement_p.h | 8 ++++---- src/testlib/qtestelement.cpp | 4 ++-- src/testlib/qtestelement_p.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/testlib/qtestcoreelement_p.h b/src/testlib/qtestcoreelement_p.h index a6a09aab529..a3d054349c7 100644 --- a/src/testlib/qtestcoreelement_p.h +++ b/src/testlib/qtestcoreelement_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtTest module of the Qt Toolkit. @@ -63,7 +63,7 @@ template class QTestCoreElement { public: - QTestCoreElement( int type = -1 ); + QTestCoreElement(QTest::LogElementType type = QTest::LET_Undefined); virtual ~QTestCoreElement(); void addAttribute(const QTest::AttributeIndex index, const char *value); @@ -81,8 +81,8 @@ class QTestCoreElement }; template -QTestCoreElement::QTestCoreElement(int t) - : type(QTest::LogElementType(t)) +QTestCoreElement::QTestCoreElement(QTest::LogElementType t) + : type(t) { } diff --git a/src/testlib/qtestelement.cpp b/src/testlib/qtestelement.cpp index e89accd82ca..9fcaa74187a 100644 --- a/src/testlib/qtestelement.cpp +++ b/src/testlib/qtestelement.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtTest module of the Qt Toolkit. @@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE -QTestElement::QTestElement(int type) +QTestElement::QTestElement(QTest::LogElementType type) : QTestCoreElement(type) { } diff --git a/src/testlib/qtestelement_p.h b/src/testlib/qtestelement_p.h index fe7bde68a01..8eae49d83d4 100644 --- a/src/testlib/qtestelement_p.h +++ b/src/testlib/qtestelement_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtTest module of the Qt Toolkit. @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE class QTestElement : public QTestCoreElement { public: - QTestElement(int type = -1); + QTestElement(QTest::LogElementType type = QTest::LET_Undefined); ~QTestElement(); bool addChild(QTestElement *element);