@ -35,23 +35,23 @@ TEST_F(FileNameTest, Parse) {
FileType type ;
char mode ;
} cases [ ] = {
{ " 100.log " , 100 , kLog File , kAllMode } ,
{ " 0.log " , 0 , kLog File , kAllMode } ,
{ " 0.sst " , 0 , kTableFile , kAllMode } ,
{ " CURRENT " , 0 , kCurrentFile , kAllMode } ,
{ " LOCK " , 0 , kDBLockFile , kAllMode } ,
{ " MANIFEST-2 " , 2 , kDescriptorFile , kAllMode } ,
{ " MANIFEST-7 " , 7 , kDescriptorFile , kAllMode } ,
{ " METADB-2 " , 2 , kMetaDatabase , kAllMode } ,
{ " METADB-7 " , 7 , kMetaDatabase , kAllMode } ,
{ " LOG " , 0 , kInfoLogFile , kDefautInfoLogDir } ,
{ " LOG.old " , 0 , kInfoLogFile , kDefautInfoLogDir } ,
{ " LOG.old.6688 " , 6688 , kInfoLogFile , kDefautInfoLogDir } ,
{ " rocksdb_dir_LOG " , 0 , kInfoLogFile , kDifferentInfoLogDir } ,
{ " rocksdb_dir_LOG.old " , 0 , kInfoLogFile , kDifferentInfoLogDir } ,
{ " rocksdb_dir_LOG.old.6688 " , 6688 , kInfoLogFile , kDifferentInfoLogDir } ,
{ " 18446744073709551615.log " , 18446744073709551615ull , kLogFile ,
kAllMode } , } ;
{ " 100.log " , 100 , kWal File , kAllMode } ,
{ " 0.log " , 0 , kWal File , kAllMode } ,
{ " 0.sst " , 0 , kTableFile , kAllMode } ,
{ " CURRENT " , 0 , kCurrentFile , kAllMode } ,
{ " LOCK " , 0 , kDBLockFile , kAllMode } ,
{ " MANIFEST-2 " , 2 , kDescriptorFile , kAllMode } ,
{ " MANIFEST-7 " , 7 , kDescriptorFile , kAllMode } ,
{ " METADB-2 " , 2 , kMetaDatabase , kAllMode } ,
{ " METADB-7 " , 7 , kMetaDatabase , kAllMode } ,
{ " LOG " , 0 , kInfoLogFile , kDefautInfoLogDir } ,
{ " LOG.old " , 0 , kInfoLogFile , kDefautInfoLogDir } ,
{ " LOG.old.6688 " , 6688 , kInfoLogFile , kDefautInfoLogDir } ,
{ " rocksdb_dir_LOG " , 0 , kInfoLogFile , kDifferentInfoLogDir } ,
{ " rocksdb_dir_LOG.old " , 0 , kInfoLogFile , kDifferentInfoLogDir } ,
{ " rocksdb_dir_LOG.old.6688 " , 6688 , kInfoLogFile , kDifferentInfoLogDir } ,
{ " 18446744073709551615.log " , 18446744073709551615ull , kWalFile , kAllMode } ,
} ;
for ( char mode : { kDifferentInfoLogDir , kDefautInfoLogDir , kNoCheckLogDir } ) {
for ( unsigned int i = 0 ; i < sizeof ( cases ) / sizeof ( cases [ 0 ] ) ; i + + ) {
InfoLogPrefix info_log_prefix ( mode ! = kDefautInfoLogDir , " /rocksdb/dir " ) ;
@ -142,7 +142,7 @@ TEST_F(FileNameTest, Construction) {
ASSERT_EQ ( " foo/ " , std : : string ( fname . data ( ) , 4 ) ) ;
ASSERT_TRUE ( ParseFileName ( fname . c_str ( ) + 4 , & number , & type ) ) ;
ASSERT_EQ ( 192U , number ) ;
ASSERT_EQ ( kLog File , type ) ;
ASSERT_EQ ( kWal File , type ) ;
fname = TableFileName ( { DbPath ( " bar " , 0 ) } , 200 , 0 ) ;
std : : string fname1 =