| 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, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #include "util/misc/initialization_state.h" | 15 #include "util/misc/initialization_state.h" |
| 16 | 16 |
| 17 #include "gtest/gtest.h" | 17 #include "gtest/gtest.h" |
| 18 | 18 |
| 19 namespace crashpad { |
| 20 namespace test { |
| 19 namespace { | 21 namespace { |
| 20 | 22 |
| 21 using namespace crashpad; | |
| 22 | |
| 23 TEST(InitializationState, InitializationState) { | 23 TEST(InitializationState, InitializationState) { |
| 24 InitializationState* initialization_state_pointer; | 24 InitializationState* initialization_state_pointer; |
| 25 { | 25 { |
| 26 InitializationState initialization_state; | 26 InitializationState initialization_state; |
| 27 initialization_state_pointer = &initialization_state; | 27 initialization_state_pointer = &initialization_state; |
| 28 | 28 |
| 29 EXPECT_TRUE(initialization_state.is_uninitialized()); | 29 EXPECT_TRUE(initialization_state.is_uninitialized()); |
| 30 EXPECT_FALSE(initialization_state.is_valid()); | 30 EXPECT_FALSE(initialization_state.is_valid()); |
| 31 | 31 |
| 32 initialization_state.set_invalid(); | 32 initialization_state.set_invalid(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 47 // former home in memory. | 47 // former home in memory. |
| 48 // | 48 // |
| 49 // This portion of the test is technically not valid C++, but it exists to | 49 // This portion of the test is technically not valid C++, but it exists to |
| 50 // test that the behavior is as desired when other code uses the language | 50 // test that the behavior is as desired when other code uses the language |
| 51 // improperly. | 51 // improperly. |
| 52 EXPECT_FALSE(initialization_state_pointer->is_uninitialized()); | 52 EXPECT_FALSE(initialization_state_pointer->is_uninitialized()); |
| 53 EXPECT_FALSE(initialization_state_pointer->is_valid()); | 53 EXPECT_FALSE(initialization_state_pointer->is_valid()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 } // namespace test |
| 58 } // namespace crashpad |
| OLD | NEW |