diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-07-11 10:51:33 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-07-11 10:25:47 +0000 |
commit | 391c68cddcc2d36df231939217abfb7f2e0e2951 (patch) | |
tree | 7bae6791563e61e2ea69dcaf6bbae5bda021aea0 /tests | |
parent | ba70df8be7481a0b9fee466238f78ca53a517c9a (diff) |
Unit-tests: Fix compilation and failing tests
Change-Id: I061dbd01e3838721e259df619016be1fc66987b0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/mockup/projectexplorer/abi.h | 68 | ||||
-rw-r--r-- | tests/unit/unittest/tokenprocessor-test.cpp | 15 |
2 files changed, 78 insertions, 5 deletions
diff --git a/tests/unit/mockup/projectexplorer/abi.h b/tests/unit/mockup/projectexplorer/abi.h new file mode 100644 index 00000000000..25baca234a6 --- /dev/null +++ b/tests/unit/mockup/projectexplorer/abi.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +namespace ProjectExplorer { +class Abi +{ +public: + enum OSFlavor { + // BSDs + FreeBsdFlavor, + NetBsdFlavor, + OpenBsdFlavor, + + // Linux + AndroidLinuxFlavor, + + // Unix + SolarisUnixFlavor, + + // Windows + WindowsMsvc2005Flavor, + WindowsMsvc2008Flavor, + WindowsMsvc2010Flavor, + WindowsMsvc2012Flavor, + WindowsMsvc2013Flavor, + WindowsMsvc2015Flavor, + WindowsMsvc2017Flavor, + WindowsMSysFlavor, + WindowsCEFlavor, + + // Embedded + VxWorksFlavor, + + // Generic: + RtosFlavor, + GenericFlavor, + + UnknownFlavor // keep last in this enum! + }; + + OSFlavor osFlavor() const { return UnknownFlavor; } + unsigned char wordWidth() const { return 64; } +}; +} diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index 50ee2cd9d03..e618104af04 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -959,7 +959,8 @@ TEST_F(TokenProcessor, TemplateTypeParameter) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); - ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); + ASSERT_THAT(infos[3], HasTwoTypes(HighlightingType::Type, + HighlightingType::TemplateTypeParameter)); } TEST_F(TokenProcessor, TemplateDefaultParameter) @@ -987,7 +988,8 @@ TEST_F(TokenProcessor, TemplateTemplateParameter) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); - ASSERT_THAT(infos[17], HasOnlyType(HighlightingType::Type)); + ASSERT_THAT(infos[17], HasTwoTypes(HighlightingType::Type, + HighlightingType::TemplateTemplateParameter)); } TEST_F(TokenProcessor, TemplateTemplateParameterDefaultArgument) @@ -1008,7 +1010,8 @@ TEST_F(TokenProcessor, TemplateTypeParameterReference) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(268, 58)); - ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); + ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, + HighlightingType::TemplateTypeParameter)); } TEST_F(TokenProcessor, TemplateTypeParameterDeclarationReference) @@ -1036,14 +1039,16 @@ TEST_F(TokenProcessor, TemplateTemplateParameterReference) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(270, 89)); - ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); + ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, + HighlightingType::TemplateTemplateParameter)); } TEST_F(TokenProcessor, TemplateTemplateContainerParameterReference) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(270, 89)); - ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type)); + ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Type, + HighlightingType::TemplateTypeParameter)); } TEST_F(TokenProcessor, TemplateTemplateParameterReferenceVariable) |