File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ func TestMysql(t *testing.T) {
17
17
db , err := sql .Open ("mysql" , mysqlDsn )
18
18
assert .Nil (t , err )
19
19
20
- testSqlDb (t , db )
20
+ testSqlDb (t , db , 30 )
21
21
}
22
22
23
23
func TestPostgreSQL (t * testing.T ) {
@@ -27,7 +27,7 @@ func TestPostgreSQL(t *testing.T) {
27
27
db , err := sql .Open ("postgres" , postgresqlDsn )
28
28
assert .Nil (t , err )
29
29
30
- testSqlDb (t , db )
30
+ testSqlDb (t , db , 30 )
31
31
}
32
32
33
33
func TestSqlite3 (t * testing.T ) {
@@ -37,17 +37,17 @@ func TestSqlite3(t *testing.T) {
37
37
db , err := sql .Open ("sqlite3" , dbPath )
38
38
assert .Nil (t , err )
39
39
40
- testSqlDb (t , db )
40
+ testSqlDb (t , db , 3 )
41
41
}
42
42
43
43
// 单元测试的公共逻辑提取
44
- func testSqlDb (t * testing.T , db * sql.DB ) {
44
+ func testSqlDb (t * testing.T , db * sql.DB , playNum int ) {
45
45
dbMap := & gorp.DbMap {Db : db , Dialect : gorp.SqliteDialect {}}
46
46
47
47
factory , err := GetGorpLockFactory (context .Background (), dbMap )
48
48
assert .Nil (t , err )
49
49
50
- storage_lock_test_helper .PlayerNum = 10
50
+ storage_lock_test_helper .PlayerNum = playNum
51
51
storage_lock_test_helper .EveryOnePlayTimes = 100
52
52
storage_lock_test_helper .TestStorageLock (t , factory )
53
53
}
You can’t perform that action at this time.
0 commit comments