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

Unified Diff: components/safe_browsing_db/safe_browsing_db_util_unittest.cc

Issue 1399843003: Move prefix_set and parts of s_b_util into a new component safe_browsing_db. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use group instead of a static_library for targets that have no sources. Created 5 years, 2 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: components/safe_browsing_db/safe_browsing_db_util_unittest.cc
diff --git a/components/safe_browsing_db/safe_browsing_db_util_unittest.cc b/components/safe_browsing_db/safe_browsing_db_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9af7d58cff9bb1fa0772c65180c57405ea02a79e
--- /dev/null
+++ b/components/safe_browsing_db/safe_browsing_db_util_unittest.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <algorithm>
+
+#include "components/safe_browsing_db/safe_browsing_db_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+TEST(SafeBrowsingDbUtilTest, FullHashOperators) {
+ const SBFullHash kHash1 = SBFullHashForString("one");
+ const SBFullHash kHash2 = SBFullHashForString("two");
+
+ EXPECT_TRUE(SBFullHashEqual(kHash1, kHash1));
+ EXPECT_TRUE(SBFullHashEqual(kHash2, kHash2));
+ EXPECT_FALSE(SBFullHashEqual(kHash1, kHash2));
+ EXPECT_FALSE(SBFullHashEqual(kHash2, kHash1));
+
+ EXPECT_FALSE(SBFullHashLess(kHash1, kHash2));
+ EXPECT_TRUE(SBFullHashLess(kHash2, kHash1));
+
+ EXPECT_FALSE(SBFullHashLess(kHash1, kHash1));
+ EXPECT_FALSE(SBFullHashLess(kHash2, kHash2));
+}
+
+} // namespace
« no previous file with comments | « components/safe_browsing_db/safe_browsing_db_util.cc ('k') | components/test/data/SafeBrowsingDb/PrefixSetRef » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698