@@ -74,7 +74,7 @@ func TestConnectionWithInvalidQuery(t *testing.T) {
7474 return tx .Exec ("SELECT * FROM non_existent_table" ).Error
7575 })
7676 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" )
7878 }
7979}
8080
@@ -107,7 +107,7 @@ func TestConnectionAfterDBClose(t *testing.T) {
107107 return tx .Raw ("SELECT 1 FROM dual" ).Scan (& v ).Error
108108 })
109109 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" )
111111 }
112112 if DB , err = OpenTestConnection (& gorm.Config {Logger : newLogger }); err != nil {
113113 log .Printf ("failed to connect database, got error %v" , err )
@@ -118,13 +118,13 @@ func TestConnectionAfterDBClose(t *testing.T) {
118118func TestConnectionHandlesPanic (t * testing.T ) {
119119 defer func () {
120120 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" )
122122 }
123123 }()
124124 DB .Connection (func (tx * gorm.DB ) error {
125125 panic ("panic in connection callback" )
126126 })
127- t .Errorf ("Should have panicked inside connection callback" )
127+ t .Fatalf ("Should have panicked inside connection callback" )
128128}
129129
130130func TestConcurrentConnections (t * testing.T ) {
0 commit comments