diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-02-15 15:17:43 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-03-14 20:16:35 +0100 |
commit | b15e01ff4e004fc89bcec205f0ee26e2e628b041 (patch) | |
tree | 9ea0ac95a1f1a1c1d6a72337793287efcb8b2630 /src/testlib | |
parent | d8545347899512ec0f57707d15545c561ff57eff (diff) |
Use LogElementType rather than int as test-element type
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcoreelement_p.h | 8 | ||||
-rw-r--r-- | src/testlib/qtestelement.cpp | 4 | ||||
-rw-r--r-- | 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 a6a09aab52..a3d054349c 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 ElementType> 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<class ElementType> -QTestCoreElement<ElementType>::QTestCoreElement(int t) - : type(QTest::LogElementType(t)) +QTestCoreElement<ElementType>::QTestCoreElement(QTest::LogElementType t) + : type(t) { } diff --git a/src/testlib/qtestelement.cpp b/src/testlib/qtestelement.cpp index e89accd82c..9fcaa74187 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<QTestElement>(type) { } diff --git a/src/testlib/qtestelement_p.h b/src/testlib/qtestelement_p.h index fe7bde68a0..8eae49d83d 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<QTestElement> { public: - QTestElement(int type = -1); + QTestElement(QTest::LogElementType type = QTest::LET_Undefined); ~QTestElement(); bool addChild(QTestElement *element); |