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

Unified Diff: base/guid_unittest.cc

Issue 1906723003: Unify UUID/GUID generation code across base and blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ASSERT, use StringPiece Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: base/guid_unittest.cc
diff --git a/base/guid_unittest.cc b/base/guid_unittest.cc
index b6d976d8e0d3f7d85f921080d0b23fb0846f5794..70dad674d3fdc9a95decf6b00c87df76188c4d7e 100644
--- a/base/guid_unittest.cc
+++ b/base/guid_unittest.cc
@@ -14,8 +14,6 @@
namespace base {
-#if defined(OS_POSIX)
-
namespace {
bool IsGUIDv4(const std::string& guid) {
@@ -37,15 +35,15 @@ TEST(GUIDTest, GUIDGeneratesAllZeroes) {
TEST(GUIDTest, GUIDGeneratesCorrectly) {
uint64_t bytes[] = {0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL};
std::string clientid = RandomDataToGUIDString(bytes);
- EXPECT_EQ("01234567-89AB-CDEF-FEDC-BA9876543210", clientid);
+ EXPECT_EQ("01234567-89ab-cdef-fedc-ba9876543210", clientid);
}
-#endif
TEST(GUIDTest, GUIDCorrectlyFormatted) {
const int kIterations = 10;
for (int it = 0; it < kIterations; ++it) {
std::string guid = GenerateGUID();
EXPECT_TRUE(IsValidGUID(guid));
+ EXPECT_TRUE(IsValidGUIDOutputString(guid));
EXPECT_TRUE(IsValidGUID(ToLowerASCII(guid)));
EXPECT_TRUE(IsValidGUID(ToUpperASCII(guid)));
}
@@ -59,10 +57,8 @@ TEST(GUIDTest, GUIDBasicUniqueness) {
EXPECT_EQ(36U, guid1.length());
EXPECT_EQ(36U, guid2.length());
EXPECT_NE(guid1, guid2);
-#if defined(OS_POSIX)
EXPECT_TRUE(IsGUIDv4(guid1));
EXPECT_TRUE(IsGUIDv4(guid2));
-#endif
}
}

Powered by Google App Engine
This is Rietveld 408576698