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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } else { | 117 } else { |
118 EXPECT_EQ(flavor_, *flavor); | 118 EXPECT_EQ(flavor_, *flavor); |
119 switch (*flavor) { | 119 switch (*flavor) { |
120 #if defined(ARCH_CPU_X86_FAMILY) | 120 #if defined(ARCH_CPU_X86_FAMILY) |
121 case x86_THREAD_STATE: { | 121 case x86_THREAD_STATE: { |
122 EXPECT_EQ(x86_THREAD_STATE_COUNT, old_state_count); | 122 EXPECT_EQ(x86_THREAD_STATE_COUNT, old_state_count); |
123 const x86_thread_state* state = | 123 const x86_thread_state* state = |
124 reinterpret_cast<const x86_thread_state*>(old_state); | 124 reinterpret_cast<const x86_thread_state*>(old_state); |
125 switch (state->tsh.flavor) { | 125 switch (state->tsh.flavor) { |
126 case x86_THREAD_STATE32: | 126 case x86_THREAD_STATE32: |
127 EXPECT_EQ(static_cast<int>(x86_THREAD_STATE32_COUNT), | 127 EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT), |
128 state->tsh.count); | 128 state->tsh.count); |
129 break; | 129 break; |
130 case x86_THREAD_STATE64: | 130 case x86_THREAD_STATE64: |
131 EXPECT_EQ(static_cast<int>(x86_THREAD_STATE64_COUNT), | 131 EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT), |
132 state->tsh.count); | 132 state->tsh.count); |
133 break; | 133 break; |
134 default: | 134 default: |
135 ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor; | 135 ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor; |
136 break; | 136 break; |
137 } | 137 } |
138 break; | 138 break; |
139 } | 139 } |
140 case x86_FLOAT_STATE: { | 140 case x86_FLOAT_STATE: { |
141 EXPECT_EQ(x86_FLOAT_STATE_COUNT, old_state_count); | 141 EXPECT_EQ(x86_FLOAT_STATE_COUNT, old_state_count); |
142 const x86_float_state* state = | 142 const x86_float_state* state = |
143 reinterpret_cast<const x86_float_state*>(old_state); | 143 reinterpret_cast<const x86_float_state*>(old_state); |
144 switch (state->fsh.flavor) { | 144 switch (state->fsh.flavor) { |
145 case x86_FLOAT_STATE32: | 145 case x86_FLOAT_STATE32: |
146 EXPECT_EQ(static_cast<int>(x86_FLOAT_STATE32_COUNT), | 146 EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE32_COUNT), |
147 state->fsh.count); | 147 state->fsh.count); |
148 break; | 148 break; |
149 case x86_FLOAT_STATE64: | 149 case x86_FLOAT_STATE64: |
150 EXPECT_EQ(static_cast<int>(x86_FLOAT_STATE64_COUNT), | 150 EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE64_COUNT), |
151 state->fsh.count); | 151 state->fsh.count); |
152 break; | 152 break; |
153 default: | 153 default: |
154 ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor; | 154 ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor; |
155 break; | 155 break; |
156 } | 156 } |
157 break; | 157 break; |
158 } | 158 } |
159 case x86_DEBUG_STATE: { | 159 case x86_DEBUG_STATE: { |
160 EXPECT_EQ(x86_DEBUG_STATE_COUNT, old_state_count); | 160 EXPECT_EQ(x86_DEBUG_STATE_COUNT, old_state_count); |
161 const x86_debug_state* state = | 161 const x86_debug_state* state = |
162 reinterpret_cast<const x86_debug_state*>(old_state); | 162 reinterpret_cast<const x86_debug_state*>(old_state); |
163 switch (state->dsh.flavor) { | 163 switch (state->dsh.flavor) { |
164 case x86_DEBUG_STATE32: | 164 case x86_DEBUG_STATE32: |
165 EXPECT_EQ(static_cast<int>(x86_DEBUG_STATE32_COUNT), | 165 EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE32_COUNT), |
166 state->dsh.count); | 166 state->dsh.count); |
167 break; | 167 break; |
168 case x86_DEBUG_STATE64: | 168 case x86_DEBUG_STATE64: |
169 EXPECT_EQ(static_cast<int>(x86_DEBUG_STATE64_COUNT), | 169 EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE64_COUNT), |
170 state->dsh.count); | 170 state->dsh.count); |
171 break; | 171 break; |
172 default: | 172 default: |
173 ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor; | 173 ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor; |
174 break; | 174 break; |
175 } | 175 } |
176 break; | 176 break; |
177 } | 177 } |
178 case x86_THREAD_STATE32: | 178 case x86_THREAD_STATE32: |
179 EXPECT_EQ(x86_THREAD_STATE32_COUNT, old_state_count); | 179 EXPECT_EQ(x86_THREAD_STATE32_COUNT, old_state_count); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 test_simulate_crash_mac.Run(); | 368 test_simulate_crash_mac.Run(); |
369 } | 369 } |
370 } | 370 } |
371 } | 371 } |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 } // namespace | 375 } // namespace |
376 } // namespace test | 376 } // namespace test |
377 } // namespace crashpad | 377 } // namespace crashpad |
OLD | NEW |