Debian Codegraph @

llvm-project/lldb/unittests/Host/linux/SupportTest.cpp

raw
1 //===-- SupportTest.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/Host/linux/Support.h"
10 #include "llvm/Support/Threading.h"
11 #include "gtest/gtest.h"
12
13 using namespace lldb_private;
14
15 TEST(Support, getProcFile_Pid) {
16 auto BufferOrError = getProcFile(getpid(), "maps");
17 ASSERT_TRUE(BufferOrError);
18 ASSERT_TRUE(*BufferOrError);
19 }
20
21 TEST(Support, getProcFile_Tid) {
22 auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(), "comm");
23 ASSERT_TRUE(BufferOrError);
24 ASSERT_TRUE(*BufferOrError);
25 }