summaryrefslogtreecommitdiff
path: root/db/dbformat_test.cc
diff options
context:
space:
mode:
authorChris Mumford <cmumford@google.com>2019-05-09 13:17:39 -0700
committerChris Mumford <cmumford@google.com>2019-05-09 14:10:55 -0700
commit85cd40d108d8f8d91f58fd263c0f8428d11c34d5 (patch)
treea34f24c42c109437f6621cbc249bcd727ec9ae9c /db/dbformat_test.cc
parent1aae5c9f29ea43ceca745efae012c4aa731e9374 (diff)
downloadleveldb-85cd40d108d8f8d91f58fd263c0f8428d11c34d5.tar.gz
Added unit test for InternalKey::DecodeFrom with empty string.
PiperOrigin-RevId: 247483339
Diffstat (limited to 'db/dbformat_test.cc')
-rw-r--r--db/dbformat_test.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/db/dbformat_test.cc b/db/dbformat_test.cc
index f75d850..1209369 100644
--- a/db/dbformat_test.cc
+++ b/db/dbformat_test.cc
@@ -65,6 +65,12 @@ TEST(FormatTest, InternalKey_EncodeDecode) {
}
}
+TEST(FormatTest, InternalKey_DecodeFromEmpty) {
+ InternalKey internal_key;
+
+ ASSERT_TRUE(!internal_key.DecodeFrom(""));
+}
+
TEST(FormatTest, InternalKeyShortSeparator) {
// When user keys are same
ASSERT_EQ(IKey("foo", 100, kTypeValue),