| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 EXPECT_EQ(0x4545u, uuid.data_3); | 146 EXPECT_EQ(0x4545u, uuid.data_3); |
| 147 EXPECT_EQ(0x45u, uuid.data_4[0]); | 147 EXPECT_EQ(0x45u, uuid.data_4[0]); |
| 148 EXPECT_EQ(0x45u, uuid.data_4[1]); | 148 EXPECT_EQ(0x45u, uuid.data_4[1]); |
| 149 EXPECT_EQ(0x45u, uuid.data_5[0]); | 149 EXPECT_EQ(0x45u, uuid.data_5[0]); |
| 150 EXPECT_EQ(0x45u, uuid.data_5[1]); | 150 EXPECT_EQ(0x45u, uuid.data_5[1]); |
| 151 EXPECT_EQ(0x45u, uuid.data_5[2]); | 151 EXPECT_EQ(0x45u, uuid.data_5[2]); |
| 152 EXPECT_EQ(0x45u, uuid.data_5[3]); | 152 EXPECT_EQ(0x45u, uuid.data_5[3]); |
| 153 EXPECT_EQ(0x45u, uuid.data_5[4]); | 153 EXPECT_EQ(0x45u, uuid.data_5[4]); |
| 154 EXPECT_EQ(0x45u, uuid.data_5[5]); | 154 EXPECT_EQ(0x45u, uuid.data_5[5]); |
| 155 EXPECT_EQ("45454545-4545-4545-4545-454545454545", uuid.ToString()); | 155 EXPECT_EQ("45454545-4545-4545-4545-454545454545", uuid.ToString()); |
| 156 |
| 157 UUID initialized_generated(UUID::InitializeWithNewTag{}); |
| 158 EXPECT_NE(initialized_generated, uuid_zero); |
| 156 } | 159 } |
| 157 | 160 |
| 158 TEST(UUID, FromString) { | 161 TEST(UUID, FromString) { |
| 159 const struct TestCase { | 162 const struct TestCase { |
| 160 const char* uuid_string; | 163 const char* uuid_string; |
| 161 bool success; | 164 bool success; |
| 162 } kCases[] = { | 165 } kCases[] = { |
| 163 // Valid: | 166 // Valid: |
| 164 {"c6849cb5-fe14-4a79-8978-9ae6034c521d", true}, | 167 {"c6849cb5-fe14-4a79-8978-9ae6034c521d", true}, |
| 165 {"00000000-0000-0000-0000-000000000000", true}, | 168 {"00000000-0000-0000-0000-000000000000", true}, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 ScopedRpcString scoped_system_string(&system_string); | 231 ScopedRpcString scoped_system_string(&system_string); |
| 229 | 232 |
| 230 EXPECT_EQ(reinterpret_cast<wchar_t*>(system_string), uuid.ToString16()); | 233 EXPECT_EQ(reinterpret_cast<wchar_t*>(system_string), uuid.ToString16()); |
| 231 } | 234 } |
| 232 | 235 |
| 233 #endif // OS_WIN | 236 #endif // OS_WIN |
| 234 | 237 |
| 235 } // namespace | 238 } // namespace |
| 236 } // namespace test | 239 } // namespace test |
| 237 } // namespace crashpad | 240 } // namespace crashpad |
| OLD | NEW |