From 85cd40d108d8f8d91f58fd263c0f8428d11c34d5 Mon Sep 17 00:00:00 2001 From: Chris Mumford Date: Thu, 9 May 2019 13:17:39 -0700 Subject: [PATCH] Added unit test for InternalKey::DecodeFrom with empty string. PiperOrigin-RevId: 247483339 --- db/dbformat_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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),