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

Side by Side Diff: components/rappor/bytevector_unittest.cc

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BrowserProcess member 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/rappor/bytevector.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace rappor {
10
11 TEST(ByteVectorTest, TestOr) {
12 ByteVector lhs(2);
13 lhs[1] = 0x12;
14 ByteVector rhs(2);
15 rhs[1] = 0x03;
16
17 ASSERT_EQ(0x13, (lhs | rhs)[1]);
18 }
19
20 TEST(ByteVectorTest, TestAnd) {
21 ByteVector lhs(2);
22 lhs[1] = 0x12;
23 ByteVector rhs(2);
24 rhs[1] = 0x03;
25
26 ASSERT_EQ(0x02, (lhs & rhs)[1]);
27 }
28
29 TEST(ByteVectorTest, TestNeg) {
30 ByteVector lhs(2);
31 lhs[1] = 0x12;
32
33 ASSERT_EQ(0xED, (~lhs)[1]);
34 }
35
36 } // namespace rappor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698