diff options
author | costan <costan@google.com> | 2018-03-12 09:02:38 -0700 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2018-03-12 09:24:25 -0700 |
commit | ddab751002588fe58955357d68d12b062e038d0d (patch) | |
tree | be16f2b827fa4ebbdf87fcfbe2825e1e56ab13cf /db | |
parent | 7fd7c0072159abbca2660d91fc0667d5c17c4d16 (diff) | |
download | leveldb-ddab751002588fe58955357d68d12b062e038d0d.tar.gz |
Add tests for {Old}InfoLogFileName().
This change was contributed by GitHub user @LopatkinEvgeniy in
https://github.com/google/leveldb/pull/559.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188728845
Diffstat (limited to 'db')
-rw-r--r-- | db/filename_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/filename_test.cc b/db/filename_test.cc index a32556d..0bde538 100644 --- a/db/filename_test.cc +++ b/db/filename_test.cc @@ -114,6 +114,18 @@ TEST(FileNameTest, Construction) { ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type)); ASSERT_EQ(999, number); ASSERT_EQ(kTempFile, type); + + fname = InfoLogFileName("foo"); + ASSERT_EQ("foo/", std::string(fname.data(), 4)); + ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type)); + ASSERT_EQ(0, number); + ASSERT_EQ(kInfoLogFile, type); + + fname = OldInfoLogFileName("foo"); + ASSERT_EQ("foo/", std::string(fname.data(), 4)); + ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type)); + ASSERT_EQ(0, number); + ASSERT_EQ(kInfoLogFile, type); } } // namespace leveldb |