Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: util/misc/uuid_test.cc

Issue 440603002: Put back the standard-layout checks lost in 5bbb7e8abbe0 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « util/misc/uuid.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 EXPECT_EQ(0x9988u, uuid.data_3); 92 EXPECT_EQ(0x9988u, uuid.data_3);
93 EXPECT_EQ(0x77u, uuid.data_4[0]); 93 EXPECT_EQ(0x77u, uuid.data_4[0]);
94 EXPECT_EQ(0x66u, uuid.data_4[1]); 94 EXPECT_EQ(0x66u, uuid.data_4[1]);
95 EXPECT_EQ(0x55u, uuid.data_5[0]); 95 EXPECT_EQ(0x55u, uuid.data_5[0]);
96 EXPECT_EQ(0x44u, uuid.data_5[1]); 96 EXPECT_EQ(0x44u, uuid.data_5[1]);
97 EXPECT_EQ(0x33u, uuid.data_5[2]); 97 EXPECT_EQ(0x33u, uuid.data_5[2]);
98 EXPECT_EQ(0x22u, uuid.data_5[3]); 98 EXPECT_EQ(0x22u, uuid.data_5[3]);
99 EXPECT_EQ(0x11u, uuid.data_5[4]); 99 EXPECT_EQ(0x11u, uuid.data_5[4]);
100 EXPECT_EQ(0x00u, uuid.data_5[5]); 100 EXPECT_EQ(0x00u, uuid.data_5[5]);
101 EXPECT_EQ("ffeeddcc-bbaa-9988-7766-554433221100", uuid.ToString()); 101 EXPECT_EQ("ffeeddcc-bbaa-9988-7766-554433221100", uuid.ToString());
102
103 // Test that UUID is standard layout.
104 memset(&uuid, 0x45, 16);
105 EXPECT_EQ(0x45454545u, uuid.data_1);
106 EXPECT_EQ(0x4545u, uuid.data_2);
107 EXPECT_EQ(0x4545u, uuid.data_3);
108 EXPECT_EQ(0x45u, uuid.data_4[0]);
109 EXPECT_EQ(0x45u, uuid.data_4[1]);
110 EXPECT_EQ(0x45u, uuid.data_5[0]);
111 EXPECT_EQ(0x45u, uuid.data_5[1]);
112 EXPECT_EQ(0x45u, uuid.data_5[2]);
113 EXPECT_EQ(0x45u, uuid.data_5[3]);
114 EXPECT_EQ(0x45u, uuid.data_5[4]);
115 EXPECT_EQ(0x45u, uuid.data_5[5]);
116 EXPECT_EQ("45454545-4545-4545-4545-454545454545", uuid.ToString());
102 } 117 }
103 118
104 } // namespace 119 } // namespace
OLDNEW
« no previous file with comments | « util/misc/uuid.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698