diff --git a/storage/boltdb/boltdb_test.go b/storage/boltdb/boltdb_test.go index cb24af8..265977b 100644 --- a/storage/boltdb/boltdb_test.go +++ b/storage/boltdb/boltdb_test.go @@ -6,7 +6,7 @@ import ( "testing" ) -func TestRedisEngine(t *testing.T) { +func TestBoltDBEngine(t *testing.T) { var val int64 config := c.BuildDefaultPushConf() @@ -37,4 +37,9 @@ func TestRedisEngine(t *testing.T) { boltDB.AddAndroidError(50) val = boltDB.GetAndroidError() assert.Equal(t, int64(50), val) + + // test reset db + boltDB.Reset() + val = boltDB.GetAndroidError() + assert.Equal(t, int64(0), val) } diff --git a/storage/memory/memory_test.go b/storage/memory/memory_test.go index 7957177..cf7800b 100644 --- a/storage/memory/memory_test.go +++ b/storage/memory/memory_test.go @@ -31,4 +31,9 @@ func TestMemoryEngine(t *testing.T) { memory.AddAndroidError(5) val = memory.GetAndroidError() assert.Equal(t, int64(5), val) + + // test reset db + memory.Reset() + val = memory.GetAndroidError() + assert.Equal(t, int64(0), val) } diff --git a/storage/redis/redis_test.go b/storage/redis/redis_test.go index 41a5149..e53b755 100644 --- a/storage/redis/redis_test.go +++ b/storage/redis/redis_test.go @@ -48,4 +48,9 @@ func TestRedisEngine(t *testing.T) { redis.AddAndroidError(50) val = redis.GetAndroidError() assert.Equal(t, int64(50), val) + + // test reset db + redis.Reset() + val = redis.GetAndroidError() + assert.Equal(t, int64(0), val) }