clang-tools
11.0.0
clang-tools-extra
clangd
unittests
xpc
ConversionTests.cpp
Go to the documentation of this file.
1
//===-- ConversionTests.cpp --------------------------*- C++ -*-----------===//
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 "
xpc/Conversion.h
"
10
#include "gtest/gtest.h"
11
12
#include <limits>
13
14
namespace
clang
{
15
namespace
clangd {
16
namespace
{
17
18
using namespace
llvm
;
19
20
TEST
(JsonXpcConversionTest, JsonToXpcToJson) {
21
22
for
(
auto
&testcase :
23
{
json::Value
(
false
),
json::Value
(3.14),
json::Value
(42),
24
json::Value
(-100),
json::Value
(
"foo"
),
json::Value
(
""
),
25
json::Value
(
"123"
),
json::Value
(
" "
),
26
json::Value
{
true
,
"foo"
,
nullptr
, 42},
27
json::Value
(
json::Object
{
28
{
"a"
,
true
}, {
"b"
,
"foo"
}, {
"c"
,
nullptr
}, {
"d"
, 42}})}) {
29
EXPECT_TRUE(testcase ==
xpcToJson
(
jsonToXpc
(testcase))) << testcase;
30
}
31
}
32
33
}
// namespace
34
}
// namespace clangd
35
}
// namespace clang
llvm
Some operations such as code completion produce a set of candidates.
Definition:
YAMLGenerator.cpp:28
clang::clangd::TEST
TEST(BackgroundQueueTest, Priority)
Definition:
BackgroundIndexTests.cpp:704
clang::clangd::SymbolKind::Object
clang::clangd::xpcToJson
json::Value xpcToJson(const xpc_object_t &XPCObject)
Definition:
Conversion.cpp:26
Conversion.h
clang::clangd::jsonToXpc
xpc_object_t jsonToXpc(const json::Value &JSON)
Definition:
Conversion.cpp:20
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition:
ApplyReplacements.h:27
clang::clangd::CompletionItemKind::Value
Generated on Tue Jul 28 2020 16:14:01 for clang-tools by
1.8.16