Index: Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp |
=================================================================== |
--- Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp (revision 116704) |
+++ Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp (working copy) |
@@ -83,6 +83,20 @@ |
EXPECT_EQ(expected, encodeByte(c)); |
} |
+TEST(IDBLevelDBCodingTest, EncodeBool) |
+{ |
+ { |
+ Vector<char> expected; |
+ expected.append(1); |
+ EXPECT_EQ(expected, encodeBool(true)); |
+ } |
+ { |
+ Vector<char> expected; |
+ expected.append(0); |
+ EXPECT_EQ(expected, encodeBool(false)); |
+ } |
+} |
+ |
TEST(IDBLevelDBCodingTest, MaxIDBKey) |
{ |
Vector<char> maxKey = maxIDBKey(); |
@@ -126,6 +140,20 @@ |
EXPECT_EQ(static_cast<size_t>(4), encodeInt(0xffffffff).size()); |
} |
+TEST(IDBLevelDBCodingTest, DecodeBool) |
+{ |
+ { |
+ Vector<char> encoded; |
+ encoded.append(1); |
+ EXPECT_TRUE(decodeBool(encoded.data(), encoded.data() + encoded.size())); |
+ } |
+ { |
+ Vector<char> encoded; |
+ encoded.append(0); |
+ EXPECT_FALSE(decodeBool(encoded.data(), encoded.data() + encoded.size())); |
+ } |
+} |
+ |
TEST(IDBLevelDBCodingTest, DecodeInt) |
{ |
Vector<int64_t> testCases; |