OLD | NEW |
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 EXPECT_NE(nullptr, old_state); | 108 EXPECT_NE(nullptr, old_state); |
109 EXPECT_EQ(implicit_cast<mach_msg_type_number_t>(THREAD_STATE_MAX), | 109 EXPECT_EQ(implicit_cast<mach_msg_type_number_t>(THREAD_STATE_MAX), |
110 *new_state_count); | 110 *new_state_count); |
111 EXPECT_NE(nullptr, new_state); | 111 EXPECT_NE(nullptr, new_state); |
112 | 112 |
113 for (size_t index = 0; index < old_state_count; ++index) { | 113 for (size_t index = 0; index < old_state_count; ++index) { |
114 EXPECT_EQ(index, old_state[index]); | 114 EXPECT_EQ(index, old_state[index]); |
115 } | 115 } |
116 | 116 |
117 // Use a flavor known to be different from the incoming flavor, for a test | 117 // Use a flavor known to be different from the incoming flavor, for a test |
118 // of the “out” side of the inout flavor parameter. | 118 // of the “out” side of the in-out flavor parameter. |
119 *flavor = exception_ + 20; | 119 *flavor = exception_ + 20; |
120 *new_state_count = MACHINE_THREAD_STATE_COUNT; | 120 *new_state_count = MACHINE_THREAD_STATE_COUNT; |
121 | 121 |
122 // Send a new state back to the client. | 122 // Send a new state back to the client. |
123 for (size_t index = 0; index < *new_state_count; ++index) { | 123 for (size_t index = 0; index < *new_state_count; ++index) { |
124 new_state[index] = MACHINE_THREAD_STATE_COUNT - index; | 124 new_state[index] = MACHINE_THREAD_STATE_COUNT - index; |
125 } | 125 } |
126 } else { | 126 } else { |
127 EXPECT_EQ(THREAD_STATE_NONE, *flavor); | 127 EXPECT_EQ(THREAD_STATE_NONE, *flavor); |
128 EXPECT_EQ(0u, old_state_count); | 128 EXPECT_EQ(0u, old_state_count); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 TestExcClientVariants test_exc_client_variants(behavior, true); | 289 TestExcClientVariants test_exc_client_variants(behavior, true); |
290 test_exc_client_variants.Run(); | 290 test_exc_client_variants.Run(); |
291 } | 291 } |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 } // namespace | 295 } // namespace |
296 } // namespace test | 296 } // namespace test |
297 } // namespace crashpad | 297 } // namespace crashpad |
OLD | NEW |