llvm-project
36 строк · 1.5 Кб
1//===-- FormatManagerTests.cpp --------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/DataFormatters/FormatManager.h"
10
11#include "gtest/gtest.h"
12
13using namespace lldb;
14using namespace lldb_private;
15
16TEST(FormatManagerTests, CompatibleLangs) {
17std::vector<LanguageType> candidates = {eLanguageTypeC_plus_plus,
18eLanguageTypeObjC};
19EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC), candidates);
20EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC89), candidates);
21EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC99), candidates);
22EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC11), candidates);
23
24EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC_plus_plus),
25candidates);
26EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC_plus_plus_03),
27candidates);
28EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC_plus_plus_11),
29candidates);
30EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeC_plus_plus_14),
31candidates);
32
33candidates = {eLanguageTypeObjC};
34EXPECT_EQ(FormatManager::GetCandidateLanguages(eLanguageTypeObjC),
35candidates);
36}
37