@@ -74,7 +74,7 @@ func TestConnectionWithInvalidQuery(t *testing.T) {
74
74
return tx .Exec ("SELECT * FROM non_existent_table" ).Error
75
75
})
76
76
if err == nil {
77
- t .Errorf ("Expected error for invalid query in Connection, got nil" )
77
+ t .Fatalf ("Expected error for invalid query in Connection, got nil" )
78
78
}
79
79
}
80
80
@@ -107,7 +107,7 @@ func TestConnectionAfterDBClose(t *testing.T) {
107
107
return tx .Raw ("SELECT 1 FROM dual" ).Scan (& v ).Error
108
108
})
109
109
if cerr == nil {
110
- t .Errorf ("Expected error when calling Connection after DB closed, got nil" )
110
+ t .Fatalf ("Expected error when calling Connection after DB closed, got nil" )
111
111
}
112
112
if DB , err = OpenTestConnection (& gorm.Config {Logger : newLogger }); err != nil {
113
113
log .Printf ("failed to connect database, got error %v" , err )
@@ -118,13 +118,13 @@ func TestConnectionAfterDBClose(t *testing.T) {
118
118
func TestConnectionHandlesPanic (t * testing.T ) {
119
119
defer func () {
120
120
if r := recover (); r == nil {
121
- t .Errorf ("Expected panic inside Connection, but none occurred" )
121
+ t .Fatalf ("Expected panic inside Connection, but none occurred" )
122
122
}
123
123
}()
124
124
DB .Connection (func (tx * gorm.DB ) error {
125
125
panic ("panic in connection callback" )
126
126
})
127
- t .Errorf ("Should have panicked inside connection callback" )
127
+ t .Fatalf ("Should have panicked inside connection callback" )
128
128
}
129
129
130
130
func TestConcurrentConnections (t * testing.T ) {
0 commit comments