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

Unified Diff: base/guid_unittest.cc

Issue 5849001: Move GUID utils to src/chrome/common. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - 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 side-by-side diff with in-line comments
Download patch
« base/guid.h ('K') | « base/guid_posix.cc ('k') | base/guid_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/guid_unittest.cc
diff --git a/chrome/browser/guid_unittest.cc b/base/guid_unittest.cc
similarity index 73%
rename from chrome/browser/guid_unittest.cc
rename to base/guid_unittest.cc
index 1951ca1f0a3e0640c19a5c6676af22b850320ac3..47363f7570a1a939a6426950af5d4c391c252acd 100644
--- a/chrome/browser/guid_unittest.cc
+++ b/base/guid_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guid.h"
+#include "base/guid.h"
#include <limits>
@@ -11,13 +11,13 @@
#if defined(OS_POSIX)
TEST(GUIDTest, GUIDGeneratesAllZeroes) {
uint64 bytes[] = { 0, 0 };
- std::string clientid = guid::RandomDataToGUIDString(bytes);
+ std::string clientid = base::RandomDataToGUIDString(bytes);
EXPECT_EQ("00000000-0000-0000-0000-000000000000", clientid);
}
TEST(GUIDTest, GUIDGeneratesCorrectly) {
uint64 bytes[] = { 0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL };
- std::string clientid = guid::RandomDataToGUIDString(bytes);
+ std::string clientid = base::RandomDataToGUIDString(bytes);
EXPECT_EQ("01234567-89AB-CDEF-FEDC-BA9876543210", clientid);
}
#endif
@@ -25,16 +25,16 @@ TEST(GUIDTest, GUIDGeneratesCorrectly) {
TEST(GUIDTest, GUIDCorrectlyFormatted) {
const int kIterations = 10;
for (int it = 0; it < kIterations; ++it) {
- std::string guid = guid::GenerateGUID();
- EXPECT_TRUE(guid::IsValidGUID(guid));
+ std::string guid = base::GenerateGUID();
+ EXPECT_TRUE(base::IsValidGUID(guid));
}
}
TEST(GUIDTest, GUIDBasicUniqueness) {
const int kIterations = 10;
for (int it = 0; it < kIterations; ++it) {
- std::string guid1 = guid::GenerateGUID();
- std::string guid2 = guid::GenerateGUID();
+ std::string guid1 = base::GenerateGUID();
+ std::string guid2 = base::GenerateGUID();
EXPECT_EQ(36U, guid1.length());
EXPECT_EQ(36U, guid2.length());
EXPECT_NE(guid1, guid2);
« base/guid.h ('K') | « base/guid_posix.cc ('k') | base/guid_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698