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

Unified Diff: components/rappor/bytevector_unittest.cc

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
Index: components/rappor/bytevector_unittest.cc
diff --git a/components/rappor/bytevector_unittest.cc b/components/rappor/bytevector_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6467c828e3750eabfb5d2558cfd56302c6aac4af
--- /dev/null
+++ b/components/rappor/bytevector_unittest.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 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 "components/rappor/bytevector.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace rappor {
+
+TEST(ByteVectorTest, TestOr) {
+ ByteVector lhs(2);
+ lhs[1] = 0x12;
+ ByteVector rhs(2);
+ rhs[1] = 0x03;
+
+ ASSERT_EQ(0x13, lhs.Or(rhs)[1]);
+}
+
+TEST(ByteVectorTest, TestAnd) {
+ ByteVector lhs(2);
+ lhs[1] = 0x12;
+ ByteVector rhs(2);
+ rhs[1] = 0x03;
+
+ ASSERT_EQ(0x02, lhs.And(rhs)[1]);
+}
+
+TEST(ByteVectorTest, TestNeg) {
+ ByteVector lhs(2);
+ lhs[1] = 0x12;
+
+ ASSERT_EQ(0xED, lhs.Not()[1]);
+}
+
+} // namespace rappor

Powered by Google App Engine
This is Rietveld 408576698