1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fix t.Errorf to t.Error in serveral _test.go

Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
This commit is contained in:
wefine 2016-11-14 17:01:17 +08:00
parent 0f20d6f5ab
commit f78f7de96a
8 changed files with 14 additions and 14 deletions

View file

@ -23,10 +23,10 @@ func TestParseArgs(t *testing.T) {
} }
} }
if len(args.Get("created")) != 1 { if len(args.Get("created")) != 1 {
t.Errorf("failed to set this arg") t.Error("failed to set this arg")
} }
if len(args.Get("image.name")) != 2 { if len(args.Get("image.name")) != 2 {
t.Errorf("the args should have collapsed") t.Error("the args should have collapsed")
} }
} }
@ -147,7 +147,7 @@ func TestEmpty(t *testing.T) {
t.Errorf("%s", err) t.Errorf("%s", err)
} }
if a.Len() != v1.Len() { if a.Len() != v1.Len() {
t.Errorf("these should both be empty sets") t.Error("these should both be empty sets")
} }
} }

View file

@ -102,11 +102,11 @@ func TestNewEnvClient(t *testing.T) {
// pedantic checking that this is handled correctly // pedantic checking that this is handled correctly
tr := apiclient.client.Transport.(*http.Transport) tr := apiclient.client.Transport.(*http.Transport)
if tr.TLSClientConfig == nil { if tr.TLSClientConfig == nil {
t.Errorf("no tls config found when DOCKER_TLS_VERIFY enabled") t.Error("no tls config found when DOCKER_TLS_VERIFY enabled")
} }
if tr.TLSClientConfig.InsecureSkipVerify { if tr.TLSClientConfig.InsecureSkipVerify {
t.Errorf("tls verification should be enabled") t.Error("tls verification should be enabled")
} }
} }

View file

@ -8,6 +8,6 @@ import (
func TestLibVersion(t *testing.T) { func TestLibVersion(t *testing.T) {
if btrfsLibVersion() <= 0 { if btrfsLibVersion() <= 0 {
t.Errorf("expected output from btrfs lib version > 0") t.Error("expected output from btrfs lib version > 0")
} }
} }

View file

@ -35,7 +35,7 @@ func TestNoneHealthcheck(t *testing.T) {
daemon.initHealthMonitor(c) daemon.initHealthMonitor(c)
if c.State.Health != nil { if c.State.Health != nil {
t.Errorf("Expecting Health to be nil, but was not") t.Error("Expecting Health to be nil, but was not")
} }
} }

View file

@ -50,7 +50,7 @@ func TestMapOpts(t *testing.T) {
t.Errorf("max-size = %s != 1", tmpMap["max-size"]) t.Errorf("max-size = %s != 1", tmpMap["max-size"])
} }
if o.Set("dummy-val=3") == nil { if o.Set("dummy-val=3") == nil {
t.Errorf("validator is not being called") t.Error("validator is not being called")
} }
} }

View file

@ -8,6 +8,6 @@ func TestDetectContentType(t *testing.T) {
input := []byte("That is just a plain text") input := []byte("That is just a plain text")
if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" { if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" {
t.Errorf("TestDetectContentType failed") t.Error("TestDetectContentType failed")
} }
} }

View file

@ -229,7 +229,7 @@ func TestResumableRequestReaderWithZeroTotalSize(t *testing.T) {
resstr := strings.TrimSuffix(string(data), "\n") resstr := strings.TrimSuffix(string(data), "\n")
if resstr != srvtxt { if resstr != srvtxt {
t.Errorf("resstr != srvtxt") t.Error("resstr != srvtxt")
} }
} }
@ -263,7 +263,7 @@ func TestResumableRequestReader(t *testing.T) {
resstr := strings.TrimSuffix(string(data), "\n") resstr := strings.TrimSuffix(string(data), "\n")
if resstr != srvtxt { if resstr != srvtxt {
t.Errorf("resstr != srvtxt") t.Error("resstr != srvtxt")
} }
} }
@ -302,6 +302,6 @@ func TestResumableRequestReaderWithInitialResponse(t *testing.T) {
resstr := strings.TrimSuffix(string(data), "\n") resstr := strings.TrimSuffix(string(data), "\n")
if resstr != srvtxt { if resstr != srvtxt {
t.Errorf("resstr != srvtxt") t.Error("resstr != srvtxt")
} }
} }

View file

@ -46,7 +46,7 @@ func TestSortFileInfoSums(t *testing.T) {
fis = newFileInfoSums() fis = newFileInfoSums()
fis.SortByPos() fis.SortByPos()
if fis[0].Pos() != 0 { if fis[0].Pos() != 0 {
t.Errorf("sorted fileInfoSums by Pos should order them by position.") t.Error("sorted fileInfoSums by Pos should order them by position.")
} }
fis = newFileInfoSums() fis = newFileInfoSums()
@ -56,7 +56,7 @@ func TestSortFileInfoSums(t *testing.T) {
t.Errorf("Expected %q, got %q", expected, gotFileInfoSum) t.Errorf("Expected %q, got %q", expected, gotFileInfoSum)
} }
if fis.GetFile("noPresent") != nil { if fis.GetFile("noPresent") != nil {
t.Errorf("Should have return nil if name not found.") t.Error("Should have return nil if name not found.")
} }
} }