OLD | NEW |
1 // Copyright 2009, Google Inc. | 1 // Copyright 2009, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 &dump_path); | 156 &dump_path); |
157 | 157 |
158 // This HAS to be EXPECT_, because when this test case is executed in the | 158 // This HAS to be EXPECT_, because when this test case is executed in the |
159 // child process, the server registration will fail due to the named pipe | 159 // child process, the server registration will fail due to the named pipe |
160 // being the same. | 160 // being the same. |
161 EXPECT_TRUE(server.Start()); | 161 EXPECT_TRUE(server.Start()); |
162 EXPECT_FALSE(gDumpCallbackCalled); | 162 EXPECT_FALSE(gDumpCallbackCalled); |
163 ASSERT_DEATH(this->DoCrash(), ""); | 163 ASSERT_DEATH(this->DoCrash(), ""); |
164 EXPECT_TRUE(gDumpCallbackCalled); | 164 EXPECT_TRUE(gDumpCallbackCalled); |
165 } | 165 } |
| 166 |
| 167 TEST_F(ExceptionHandlerDeathTest, InvalidParameterTest) { |
| 168 using google_breakpad::ExceptionHandler; |
| 169 |
| 170 ASSERT_TRUE(DoesPathExist(temp_path_)); |
| 171 ExceptionHandler handler(temp_path_, NULL, NULL, NULL, |
| 172 ExceptionHandler::HANDLER_INVALID_PARAMETER); |
| 173 |
| 174 // Disable the message box for assertions |
| 175 _CrtSetReportMode(_CRT_ASSERT, 0); |
| 176 |
| 177 // Call with a bad argument. The invalid parameter will be swallowed |
| 178 // and a dump will be generated, the process will exit(0). |
| 179 ASSERT_EXIT(printf(NULL), ::testing::ExitedWithCode(0), ""); |
166 } | 180 } |
| 181 } |
OLD | NEW |