1 //===-- HostTest.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/Host.h"
11 #include "gtest/gtest.h"
12 
13 using namespace lldb_private;
14 using namespace llvm;
15 
16 TEST(Host, WaitStatusFormat) {
17   EXPECT_EQ("W01", formatv("{0:g}", WaitStatus{WaitStatus::Exit, 1}).str());
18   EXPECT_EQ("X02", formatv("{0:g}", WaitStatus{WaitStatus::Signal, 2}).str());
19   EXPECT_EQ("S03", formatv("{0:g}", WaitStatus{WaitStatus::Stop, 3}).str());
20   EXPECT_EQ("Exited with status 4",
21             formatv("{0}", WaitStatus{WaitStatus::Exit, 4}).str());
22 }
23