]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - unittests/Host/linux/SupportTest.cpp
Vendor import of lldb trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / unittests / Host / linux / SupportTest.cpp
1 //===-- SupportTest.cpp -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "lldb/Host/linux/Support.h"
11 #include "llvm/Support/Threading.h"
12 #include "gtest/gtest.h"
13
14 using namespace lldb_private;
15
16 TEST(Support, getProcFile_Pid) {
17   auto BufferOrError = getProcFile(getpid(), "maps");
18   ASSERT_TRUE(BufferOrError);
19   ASSERT_TRUE(*BufferOrError);
20 }
21
22 TEST(Support, getProcFile_Tid) {
23   auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(), "comm");
24   ASSERT_TRUE(BufferOrError);
25   ASSERT_TRUE(*BufferOrError);
26 }