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

Side by Side Diff: chrome/common/guid_unittest.cc

Issue 5849001: Move GUID utils to src/chrome/common. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: chrome/common Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/guid_posix.cc ('k') | chrome/common/guid_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/guid.h" 5 #include "chrome/common/guid.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 #if defined(OS_POSIX) 11 #if defined(OS_POSIX)
12 TEST(GUIDTest, GUIDGeneratesAllZeroes) { 12 TEST(GUIDTest, GUIDGeneratesAllZeroes) {
13 uint64 bytes[] = { 0, 0 }; 13 uint64 bytes[] = { 0, 0 };
14 std::string clientid = guid::RandomDataToGUIDString(bytes); 14 std::string clientid = guid::RandomDataToGUIDString(bytes);
15 EXPECT_EQ("00000000-0000-0000-0000-000000000000", clientid); 15 EXPECT_EQ("00000000-0000-0000-0000-000000000000", clientid);
(...skipping 17 matching lines...) Expand all
33 TEST(GUIDTest, GUIDBasicUniqueness) { 33 TEST(GUIDTest, GUIDBasicUniqueness) {
34 const int kIterations = 10; 34 const int kIterations = 10;
35 for (int it = 0; it < kIterations; ++it) { 35 for (int it = 0; it < kIterations; ++it) {
36 std::string guid1 = guid::GenerateGUID(); 36 std::string guid1 = guid::GenerateGUID();
37 std::string guid2 = guid::GenerateGUID(); 37 std::string guid2 = guid::GenerateGUID();
38 EXPECT_EQ(36U, guid1.length()); 38 EXPECT_EQ(36U, guid1.length());
39 EXPECT_EQ(36U, guid2.length()); 39 EXPECT_EQ(36U, guid2.length());
40 EXPECT_NE(guid1, guid2); 40 EXPECT_NE(guid1, guid2);
41 } 41 }
42 } 42 }
OLDNEW
« no previous file with comments | « chrome/common/guid_posix.cc ('k') | chrome/common/guid_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698