OLD | NEW |
(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.Or(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.And(rhs)[1]); |
| 27 } |
| 28 |
| 29 TEST(ByteVectorTest, TestNeg) { |
| 30 ByteVector lhs(2); |
| 31 lhs[1] = 0x12; |
| 32 |
| 33 ASSERT_EQ(0xED, lhs.Not()[1]); |
| 34 } |
| 35 |
| 36 } // namespace rappor |
OLD | NEW |