update storage testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-08-03 14:30:21 +08:00
parent 1d29dadf0a
commit 1326aae547
3 changed files with 16 additions and 1 deletions

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}