@ -1844,6 +1844,8 @@ TEST_F(DBTest, Snapshot) {
uint64_t time_snap1 = GetTimeOldestSnapshots ( ) ;
uint64_t time_snap1 = GetTimeOldestSnapshots ( ) ;
ASSERT_GT ( time_snap1 , 0U ) ;
ASSERT_GT ( time_snap1 , 0U ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetTimeOldestSnapshots ( ) ,
static_cast < uint64_t > ( s1 - > GetUnixTime ( ) ) ) ;
ASSERT_OK ( Put ( 0 , " foo " , " 0v2 " ) ) ;
ASSERT_OK ( Put ( 0 , " foo " , " 0v2 " ) ) ;
ASSERT_OK ( Put ( 1 , " foo " , " 1v2 " ) ) ;
ASSERT_OK ( Put ( 1 , " foo " , " 1v2 " ) ) ;
@ -1853,6 +1855,8 @@ TEST_F(DBTest, Snapshot) {
ASSERT_EQ ( 2U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( 2U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetTimeOldestSnapshots ( ) ,
static_cast < uint64_t > ( s1 - > GetUnixTime ( ) ) ) ;
ASSERT_OK ( Put ( 0 , " foo " , " 0v3 " ) ) ;
ASSERT_OK ( Put ( 0 , " foo " , " 0v3 " ) ) ;
ASSERT_OK ( Put ( 1 , " foo " , " 1v3 " ) ) ;
ASSERT_OK ( Put ( 1 , " foo " , " 1v3 " ) ) ;
@ -1861,6 +1865,8 @@ TEST_F(DBTest, Snapshot) {
ASSERT_EQ ( 3U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( 3U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetTimeOldestSnapshots ( ) ,
static_cast < uint64_t > ( s1 - > GetUnixTime ( ) ) ) ;
ASSERT_OK ( Put ( 0 , " foo " , " 0v4 " ) ) ;
ASSERT_OK ( Put ( 0 , " foo " , " 0v4 " ) ) ;
ASSERT_OK ( Put ( 1 , " foo " , " 1v4 " ) ) ;
ASSERT_OK ( Put ( 1 , " foo " , " 1v4 " ) ) ;
@ -1877,6 +1883,8 @@ TEST_F(DBTest, Snapshot) {
ASSERT_EQ ( 2U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( 2U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s1 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetTimeOldestSnapshots ( ) ,
static_cast < uint64_t > ( s1 - > GetUnixTime ( ) ) ) ;
ASSERT_EQ ( " 0v1 " , Get ( 0 , " foo " , s1 ) ) ;
ASSERT_EQ ( " 0v1 " , Get ( 0 , " foo " , s1 ) ) ;
ASSERT_EQ ( " 1v1 " , Get ( 1 , " foo " , s1 ) ) ;
ASSERT_EQ ( " 1v1 " , Get ( 1 , " foo " , s1 ) ) ;
ASSERT_EQ ( " 0v2 " , Get ( 0 , " foo " , s2 ) ) ;
ASSERT_EQ ( " 0v2 " , Get ( 0 , " foo " , s2 ) ) ;
@ -1892,6 +1900,8 @@ TEST_F(DBTest, Snapshot) {
ASSERT_EQ ( 1U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( 1U , GetNumSnapshots ( ) ) ;
ASSERT_LT ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_LT ( time_snap1 , GetTimeOldestSnapshots ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s2 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetSequenceOldestSnapshots ( ) , s2 - > GetSequenceNumber ( ) ) ;
ASSERT_EQ ( GetTimeOldestSnapshots ( ) ,
static_cast < uint64_t > ( s2 - > GetUnixTime ( ) ) ) ;
db_ - > ReleaseSnapshot ( s2 ) ;
db_ - > ReleaseSnapshot ( s2 ) ;
ASSERT_EQ ( 0U , GetNumSnapshots ( ) ) ;
ASSERT_EQ ( 0U , GetNumSnapshots ( ) ) ;
@ -2859,6 +2869,12 @@ class ModelDB : public DB {
assert ( false ) ;
assert ( false ) ;
return 0 ;
return 0 ;
}
}
int64_t GetUnixTime ( ) const override {
// no need to call this
assert ( false ) ;
return 0 ;
}
} ;
} ;
explicit ModelDB ( const Options & options ) : options_ ( options ) { }
explicit ModelDB ( const Options & options ) : options_ ( options ) { }