Add some unit tests for the mac MinidumpGenerator

R=mark at http://breakpad.appspot.com/240001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@742 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek 2010-12-13 22:10:32 +00:00
parent ef7262d477
commit efbe428d83
4 changed files with 291 additions and 90 deletions

View file

@ -155,7 +155,7 @@ TEST_F(ExceptionHandlerTest, DumpChildProcess) {
pid_t pid = fork();
if (pid == 0) {
// In the child process
close(fds[0]);
close(fds[1]);
// Send parent process the task and thread ports.
MachSendMessage child_message(0);
@ -168,12 +168,12 @@ TEST_F(ExceptionHandlerTest, DumpChildProcess) {
// Wait for the parent process.
uint8_t data;
read(fds[1], &data, 1);
read(fds[0], &data, 1);
exit(0);
}
// In the parent process.
ASSERT_NE(-1, pid);
close(fds[1]);
close(fds[0]);
// Read the child's task and thread ports.
MachReceiveMessage child_message;
@ -200,7 +200,7 @@ TEST_F(ExceptionHandlerTest, DumpChildProcess) {
// Unblock child process
uint8_t data = 1;
(void)write(fds[0], &data, 1);
(void)write(fds[1], &data, 1);
// Child process should have exited with a zero status.
int ret;