Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: util/mach/mach_message_util_test.cc

Issue 755313004: Pass Mach message trailers to server handler functions (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/mach_message_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_message_util_test.cc
diff --git a/util/mach/mach_message_util_test.cc b/util/mach/mach_message_util_test.cc
index b8ecbbd741fd0c19883a948dca693123d4731624..66543067b407b1771b220d51d88a8e83fde0ba15 100644
--- a/util/mach/mach_message_util_test.cc
+++ b/util/mach/mach_message_util_test.cc
@@ -63,6 +63,29 @@ TEST(MachMessageUtil, PrepareMIGReplyFromRequest_SetMIGReplyError) {
EXPECT_EQ(MIG_BAD_ID, reply.RetCode);
}
+TEST(MachMessageUtil, MachMessageTrailerFromHeader) {
+ mach_msg_empty_t empty;
+ empty.send.header.msgh_size = sizeof(mach_msg_empty_send_t);
+ EXPECT_EQ(&empty.rcv.trailer,
+ MachMessageTrailerFromHeader(&empty.rcv.header));
+
+ struct TestSendMessage : public mach_msg_header_t {
+ uint8_t data[126];
+ };
+ struct TestReceiveMessage : public TestSendMessage {
+ mach_msg_trailer_t trailer;
+ };
+ union TestMessage {
+ TestSendMessage send;
+ TestReceiveMessage receive;
+ };
+
+ TestMessage test;
+ test.send.msgh_size = sizeof(TestSendMessage);
+ EXPECT_EQ(&test.receive.trailer,
+ MachMessageTrailerFromHeader(&test.receive));
+}
+
} // namespace
} // namespace test
} // namespace crashpad
« no previous file with comments | « util/mach/mach_message_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698