Index: util/mach/mach_message_test.cc |
diff --git a/util/mach/mach_message_test.cc b/util/mach/mach_message_test.cc |
index b807b7ed5205f098b788936f56cf0616d61ba18c..eed6c8e21820deaef30e10a2100bef89e7546c39 100644 |
--- a/util/mach/mach_message_test.cc |
+++ b/util/mach/mach_message_test.cc |
@@ -22,6 +22,20 @@ namespace crashpad { |
namespace test { |
namespace { |
+TEST(MachMessage, MachMessageDeadlineFromTimeout) { |
+ MachMessageDeadline deadline_0 = MachMessageDeadlineFromTimeout(0); |
+ EXPECT_EQ(kMachMessageNonblocking, deadline_0); |
+ |
+ deadline_0 = MachMessageDeadlineFromTimeout(1); |
+ MachMessageDeadline deadline_1 = MachMessageDeadlineFromTimeout(100); |
+ |
+ EXPECT_NE(kMachMessageNonblocking, deadline_0); |
+ EXPECT_NE(kMachMessageWaitIndefinitely, deadline_0); |
+ EXPECT_NE(kMachMessageNonblocking, deadline_1); |
+ EXPECT_NE(kMachMessageWaitIndefinitely, deadline_1); |
+ EXPECT_GE(deadline_1, deadline_0); |
+} |
+ |
TEST(MachMessage, PrepareMIGReplyFromRequest_SetMIGReplyError) { |
mach_msg_header_t request; |
request.msgh_bits = |