Просмотр исходного кода

Fix 'non-constant format string' cases

Rod Hynes 9 месяцев назад
Родитель
Сommit
fcd3248e7a

+ 2 - 2
psiphon/common/fragmentor/fragmentor_test.go

@@ -94,7 +94,7 @@ func TestFragmentor(t *testing.T) {
 		}
 		fragConn := NewConn(
 			NewDownstreamConfig(params.Get(), tunnelProtocol, nil),
-			func(message string) { t.Logf(message) },
+			func(message string) { t.Log(message) },
 			conn)
 		defer fragConn.Close()
 
@@ -138,7 +138,7 @@ func TestFragmentor(t *testing.T) {
 		}
 		fragConn := NewConn(
 			NewUpstreamConfig(params.Get(), tunnelProtocol, seed),
-			func(message string) { t.Logf(message) },
+			func(message string) { t.Log(message) },
 			conn)
 		defer fragConn.Close()
 

+ 2 - 2
psiphon/common/inproxy/quality_test.go

@@ -31,14 +31,14 @@ import (
 func TestProxyQualityState(t *testing.T) {
 	err := runTestProxyQualityState()
 	if err != nil {
-		t.Errorf(errors.Trace(err).Error())
+		t.Error(errors.Trace(err).Error())
 	}
 }
 
 func TestProxyQualityReporter(t *testing.T) {
 	err := runTestProxyQualityReporter()
 	if err != nil {
-		t.Errorf(errors.Trace(err).Error())
+		t.Error(errors.Trace(err).Error())
 	}
 }
 

+ 1 - 1
psiphon/common/prng/prng_test.go

@@ -389,7 +389,7 @@ func TestExpFloat64Range(t *testing.T) {
 				strs = append(strs, fmt.Sprintf("%0.2f: %d", k, buckets[k]))
 			}
 
-			t.Logf(strings.Join(strs, ","))
+			t.Log(strings.Join(strs, ","))
 
 			for i := 0; i < len(keys)-1; i++ {
 				if buckets[keys[i]] <= buckets[keys[i+1]] {

+ 3 - 3
psiphon/common/resolver/resolver_test.go

@@ -39,21 +39,21 @@ import (
 func TestMakeResolveParameters(t *testing.T) {
 	err := runTestMakeResolveParameters()
 	if err != nil {
-		t.Fatalf(errors.Trace(err).Error())
+		t.Fatal(errors.Trace(err).Error())
 	}
 }
 
 func TestResolver(t *testing.T) {
 	err := runTestResolver()
 	if err != nil {
-		t.Fatalf(errors.Trace(err).Error())
+		t.Fatal(errors.Trace(err).Error())
 	}
 }
 
 func TestPublicDNSServers(t *testing.T) {
 	IPs, metrics, err := runTestPublicDNSServers()
 	if err != nil {
-		t.Fatalf(errors.Trace(err).Error())
+		t.Fatal(errors.Trace(err).Error())
 	}
 	t.Logf("IPs: %v", IPs)
 	t.Logf("Metrics: %v", metrics)

+ 1 - 1
psiphon/common/transforms/transforms_test.go

@@ -31,7 +31,7 @@ import (
 func TestTransforms(t *testing.T) {
 	err := runTestTransforms()
 	if err != nil {
-		t.Fatalf(errors.Trace(err).Error())
+		t.Fatal(errors.Trace(err).Error())
 	}
 }
 

+ 1 - 1
psiphon/common/tun/tun_test.go

@@ -263,7 +263,7 @@ func testTunneledTCP(t *testing.T, useIPv6 bool) {
 	for i := 0; i < CONCURRENT_CLIENT_COUNT; i++ {
 		result := <-results
 		if result != nil {
-			t.Fatalf(result.Error())
+			t.Fatal(result.Error())
 		}
 	}