aboutsummaryrefslogtreecommitdiff
path: root/third_party/chromium/base/guid_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/chromium/base/guid_unittest.cc')
-rw-r--r--third_party/chromium/base/guid_unittest.cc31
1 files changed, 0 insertions, 31 deletions
diff --git a/third_party/chromium/base/guid_unittest.cc b/third_party/chromium/base/guid_unittest.cc
index acbd1a2..e53fda8 100644
--- a/third_party/chromium/base/guid_unittest.cc
+++ b/third_party/chromium/base/guid_unittest.cc
@@ -15,36 +15,8 @@
namespace base {
-#if defined(OS_POSIX)
-
namespace {
-template <typename Char>
-inline bool IsHexDigit(Char c) {
- return (c >= '0' && c <= '9') ||
- (c >= 'A' && c <= 'F') ||
- (c >= 'a' && c <= 'f');
-}
-
-bool IsValidGUID(const std::string& guid) {
- const size_t kGUIDLength = 36U;
- if (guid.length() != kGUIDLength)
- return false;
-
- for (size_t i = 0; i < guid.length(); ++i) {
- char current = guid[i];
- if (i == 8 || i == 13 || i == 18 || i == 23) {
- if (current != '-')
- return false;
- } else {
- if (!IsHexDigit(current))
- return false;
- }
- }
-
- return true;
-}
-
bool IsGUIDv4(const std::string& guid) {
// The format of GUID version 4 must be xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx,
// where y is one of [8, 9, A, B].
@@ -66,7 +38,6 @@ TEST(GUIDTest, GUIDGeneratesCorrectly) {
std::string clientid = RandomDataToGUIDString(bytes);
EXPECT_EQ("01234567-89AB-CDEF-FEDC-BA9876543210", clientid);
}
-#endif
TEST(GUIDTest, GUIDCorrectlyFormatted) {
const int kIterations = 10;
@@ -84,10 +55,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
}
}