7
7
// ===----------------------------------------------------------------------===//
8
8
9
9
#include " lldb/Host/Host.h"
10
+ #include " lldb/Utility/ProcessInfo.h"
10
11
#include " gtest/gtest.h"
11
12
12
13
using namespace lldb_private ;
@@ -25,3 +26,23 @@ TEST(Host, GetEnvironment) {
25
26
ASSERT_EQ (" Host::GetEnvironment" ,
26
27
Host::GetEnvironment ().lookup (" LLDB_TEST_ENVIRONMENT_VAR" ));
27
28
}
29
+
30
+ TEST (Host, ProcessInstanceInfoCumulativeUserTimeIsValid) {
31
+ ProcessInstanceInfo info;
32
+ info.SetCumulativeUserTime (ProcessInstanceInfo::timespec {0 , 0 });
33
+ EXPECT_FALSE (info.CumulativeUserTimeIsValid ());
34
+ info.SetCumulativeUserTime (ProcessInstanceInfo::timespec {0 , 1 });
35
+ EXPECT_TRUE (info.CumulativeUserTimeIsValid ());
36
+ info.SetCumulativeUserTime (ProcessInstanceInfo::timespec {1 , 0 });
37
+ EXPECT_TRUE (info.CumulativeUserTimeIsValid ());
38
+ }
39
+
40
+ TEST (Host, ProcessInstanceInfoCumulativeSystemTimeIsValid) {
41
+ ProcessInstanceInfo info;
42
+ info.SetCumulativeSystemTime (ProcessInstanceInfo::timespec {0 , 0 });
43
+ EXPECT_FALSE (info.CumulativeSystemTimeIsValid ());
44
+ info.SetCumulativeSystemTime (ProcessInstanceInfo::timespec {0 , 1 });
45
+ EXPECT_TRUE (info.CumulativeSystemTimeIsValid ());
46
+ info.SetCumulativeSystemTime (ProcessInstanceInfo::timespec {1 , 0 });
47
+ EXPECT_TRUE (info.CumulativeSystemTimeIsValid ());
48
+ }
0 commit comments