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

Unified Diff: components/sync/base/ordinal_unittest.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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
« no previous file with comments | « components/sync/base/ordinal.h ('k') | components/sync/base/progress_marker_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/base/ordinal_unittest.cc
diff --git a/sync/internal_api/public/base/ordinal_unittest.cc b/components/sync/base/ordinal_unittest.cc
similarity index 91%
rename from sync/internal_api/public/base/ordinal_unittest.cc
rename to components/sync/base/ordinal_unittest.cc
index 02d77324fb12adebd4cc2c54e45b8c3289c41a80..ba25f709c4fcc67ad6b2e19e69254086d42cdca6 100644
--- a/sync/internal_api/public/base/ordinal_unittest.cc
+++ b/components/sync/base/ordinal_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 "sync/internal_api/public/base/ordinal.h"
+#include "components/sync/base/ordinal.h"
#include <stdint.h>
@@ -42,33 +42,25 @@ typedef Ordinal<LargeOrdinalTraits> LargeOrdinal;
static_assert(TestOrdinal::kZeroDigit == '0',
"incorrect TestOrdinal zero digit");
-static_assert(TestOrdinal::kOneDigit == '1',
- "incorrect TestOrdinal one digit");
-static_assert(TestOrdinal::kMidDigit == '2',
- "incorrect TestOrdinal min digit");
-static_assert(TestOrdinal::kMaxDigit == '3',
- "incorrect TestOrdinal max digit");
+static_assert(TestOrdinal::kOneDigit == '1', "incorrect TestOrdinal one digit");
+static_assert(TestOrdinal::kMidDigit == '2', "incorrect TestOrdinal min digit");
+static_assert(TestOrdinal::kMaxDigit == '3', "incorrect TestOrdinal max digit");
static_assert(TestOrdinal::kMidDigitValue == 2,
"incorrect TestOrdinal mid digit value");
static_assert(TestOrdinal::kMaxDigitValue == 3,
"incorrect TestOrdinal max digit value");
-static_assert(TestOrdinal::kRadix == 4,
- "incorrect TestOrdinal radix");
+static_assert(TestOrdinal::kRadix == 4, "incorrect TestOrdinal radix");
static_assert(LongOrdinal::kZeroDigit == '0',
"incorrect LongOrdinal zero digit");
-static_assert(LongOrdinal::kOneDigit == '1',
- "incorrect LongOrdinal one digit");
-static_assert(LongOrdinal::kMidDigit == '5',
- "incorrect LongOrdinal mid digit");
-static_assert(LongOrdinal::kMaxDigit == '9',
- "incorrect LongOrdinal max digit");
+static_assert(LongOrdinal::kOneDigit == '1', "incorrect LongOrdinal one digit");
+static_assert(LongOrdinal::kMidDigit == '5', "incorrect LongOrdinal mid digit");
+static_assert(LongOrdinal::kMaxDigit == '9', "incorrect LongOrdinal max digit");
static_assert(LongOrdinal::kMidDigitValue == 5,
"incorrect LongOrdinal mid digit value");
static_assert(LongOrdinal::kMaxDigitValue == 9,
"incorrect LongOrdinal max digit value");
-static_assert(LongOrdinal::kRadix == 10,
- "incorrect LongOrdinal radix");
+static_assert(LongOrdinal::kRadix == 10, "incorrect LongOrdinal radix");
static_assert(static_cast<char>(LargeOrdinal::kZeroDigit) == '\x00',
"incorrect LargeOrdinal zero digit");
@@ -82,8 +74,7 @@ static_assert(LargeOrdinal::kMidDigitValue == 128,
"incorrect LargeOrdinal mid digit value");
static_assert(LargeOrdinal::kMaxDigitValue == 255,
"incorrect LargeOrdinal max digit value");
-static_assert(LargeOrdinal::kRadix == 256,
- "incorrect LargeOrdinal radix");
+static_assert(LargeOrdinal::kRadix == 256, "incorrect LargeOrdinal radix");
// Create Ordinals that satisfy all but one criterion for validity.
// IsValid() should return false for all of them.
@@ -92,8 +83,8 @@ TEST(Ordinal, Invalid) {
EXPECT_FALSE(TestOrdinal(std::string()).IsValid());
EXPECT_FALSE(LongOrdinal("0001").IsValid());
- const char kBeforeZero[] = { '0' - 1, '\0' };
- const char kAfterNine[] = { '9' + 1, '\0' };
+ const char kBeforeZero[] = {'0' - 1, '\0'};
+ const char kAfterNine[] = {'9' + 1, '\0'};
// Character criterion.
EXPECT_FALSE(TestOrdinal(kBeforeZero).IsValid());
@@ -225,14 +216,11 @@ bool IsNonEmptyPrintableString(const std::string& str) {
// Create some invalid/valid ordinals. ToDebugString() should always
// return a non-empty printable string.
TEST(OrdinalTest, ToDebugString) {
- EXPECT_TRUE(
- IsNonEmptyPrintableString(TestOrdinal().ToDebugString()));
+ EXPECT_TRUE(IsNonEmptyPrintableString(TestOrdinal().ToDebugString()));
EXPECT_TRUE(
IsNonEmptyPrintableString(TestOrdinal("invalid string").ToDebugString()));
- EXPECT_TRUE(
- IsNonEmptyPrintableString(TestOrdinal("2").ToDebugString()));
- EXPECT_TRUE(
- IsNonEmptyPrintableString(LongOrdinal("12345").ToDebugString()));
+ EXPECT_TRUE(IsNonEmptyPrintableString(TestOrdinal("2").ToDebugString()));
+ EXPECT_TRUE(IsNonEmptyPrintableString(LongOrdinal("12345").ToDebugString()));
EXPECT_TRUE(
IsNonEmptyPrintableString(LargeOrdinal("\1\2\3\4\5").ToDebugString()));
}
« no previous file with comments | « components/sync/base/ordinal.h ('k') | components/sync/base/progress_marker_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698