OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (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 |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_TEST_UTIL_H_ |
| 16 #define CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_TEST_UTIL_H_ |
| 17 |
| 18 #include <stdint.h> |
| 19 |
| 20 #include "minidump/minidump_context.h" |
| 21 |
| 22 namespace crashpad { |
| 23 namespace test { |
| 24 |
| 25 //! \brief Initializes a context structure for testing. |
| 26 //! |
| 27 //! \param[out] context The structure to initialize. |
| 28 //! \param[in] seed The seed value. Initializing two context structures of the |
| 29 //! same type with identical seed values should produce identical context |
| 30 //! structures. Initialization with a different seed value should produce |
| 31 //! a different context structure. If \a seed is `0`, \a context is zeroed |
| 32 //! out entirely except for the flags field, which will identify the context |
| 33 //! type. If \a seed is nonzero \a context will be populated entirely with |
| 34 //! nonzero values. |
| 35 //! |
| 36 //! \{ |
| 37 void InitializeMinidumpContextX86(MinidumpContextX86* context, uint32_t seed); |
| 38 void InitializeMinidumpContextAMD64(MinidumpContextAMD64* context, |
| 39 uint32_t seed); |
| 40 //! \} |
| 41 |
| 42 //! \brief Verifies, via gtest assertions, that a context structure contains |
| 43 //! expected values. |
| 44 //! |
| 45 //! \param[in] expect_seed The seed value used to initialize a context |
| 46 //! structure. This is the seed value used with |
| 47 //! InitializeMinidumpContext*(). |
| 48 //! \param[in] observed The context structure to check. All fields of this |
| 49 //! structure will be compared against the expected context structure, one |
| 50 //! initialized with \a expect_seed. |
| 51 //! \{ |
| 52 void ExpectMinidumpContextX86(uint32_t expect_seed, |
| 53 const MinidumpContextX86* observed); |
| 54 void ExpectMinidumpContextAMD64(uint32_t expect_seed, |
| 55 const MinidumpContextAMD64* observed); |
| 56 //! \} |
| 57 |
| 58 } // namespace test |
| 59 } // namespace crashpad |
| 60 |
| 61 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_TEST_UTIL_H_ |
OLD | NEW |