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

Side by Side Diff: util/mach/exc_client_variants_test.cc

Issue 779633004: MachMessageServer: scribble over memory allocations in debug mode (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | util/mach/mach_message_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 EXPECT_EQ(index, old_state[index]); 110 EXPECT_EQ(index, old_state[index]);
111 } 111 }
112 112
113 // Use a flavor known to be different from the incoming flavor, for a test 113 // Use a flavor known to be different from the incoming flavor, for a test
114 // of the “out” side of the inout flavor parameter. 114 // of the “out” side of the inout flavor parameter.
115 *flavor = exception_ + 20; 115 *flavor = exception_ + 20;
116 *new_state_count = MACHINE_THREAD_STATE_COUNT; 116 *new_state_count = MACHINE_THREAD_STATE_COUNT;
117 117
118 // Send a new state back to the client. 118 // Send a new state back to the client.
119 for (size_t index = 0; index < *new_state_count; ++index) { 119 for (size_t index = 0; index < *new_state_count; ++index) {
120 EXPECT_EQ(0u, new_state[index]);
121 new_state[index] = MACHINE_THREAD_STATE_COUNT - index; 120 new_state[index] = MACHINE_THREAD_STATE_COUNT - index;
122 } 121 }
123 } else { 122 } else {
124 EXPECT_EQ(THREAD_STATE_NONE, *flavor); 123 EXPECT_EQ(THREAD_STATE_NONE, *flavor);
125 EXPECT_EQ(0u, old_state_count); 124 EXPECT_EQ(0u, old_state_count);
126 EXPECT_EQ(nullptr, old_state); 125 EXPECT_EQ(nullptr, old_state);
127 EXPECT_EQ(0u, *new_state_count); 126 EXPECT_EQ(0u, *new_state_count);
128 EXPECT_EQ(nullptr, new_state); 127 EXPECT_EQ(nullptr, new_state);
129 } 128 }
130 129
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 283
285 TestExcClientVariants test_exc_client_variants(behavior, true); 284 TestExcClientVariants test_exc_client_variants(behavior, true);
286 test_exc_client_variants.Run(); 285 test_exc_client_variants.Run();
287 } 286 }
288 } 287 }
289 } 288 }
290 289
291 } // namespace 290 } // namespace
292 } // namespace test 291 } // namespace test
293 } // namespace crashpad 292 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | util/mach/mach_message_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698