From fbead58f926f8ab8923386789bc2dab7558f62f4 Mon Sep 17 00:00:00 2001 From: mpl Date: Mon, 19 Nov 2012 19:52:06 +0100 Subject: [PATCH] fix tests for images and netutil Change-Id: I89d978ce25cc8748ffab54aa3112e6b854f73b85 --- pkg/images/images_test.go | 4 ++-- pkg/netutil/ident_test.go | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/images/images_test.go b/pkg/images/images_test.go index e834ed451..8e99edfa8 100644 --- a/pkg/images/images_test.go +++ b/pkg/images/images_test.go @@ -80,7 +80,7 @@ func TestExifCorrection(t *testing.T) { t.Fatal(err) } defer f.Close() - im, err := Decode(f, nil) + im, _, err := Decode(f, nil) if err != nil { t.Fatal(err) } @@ -124,7 +124,7 @@ func TestForcedCorrection(t *testing.T) { case '8': angle = 90 } - im, err := Decode(f, &DecodeOpts{Rotate: angle, Flip: FlipDirection(flipMode)}) + im, _, err := Decode(f, &DecodeOpts{Rotate: angle, Flip: FlipDirection(flipMode)}) if err != nil { t.Fatal(err) } diff --git a/pkg/netutil/ident_test.go b/pkg/netutil/ident_test.go index 6a8fdb028..0eeb01c23 100644 --- a/pkg/netutil/ident_test.go +++ b/pkg/netutil/ident_test.go @@ -97,8 +97,11 @@ func testLocalListener(t *testing.T, ln net.Listener) { func TestHTTPAuth(t *testing.T) { var ts *httptest.Server ts = httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - from := r.RemoteAddr - to := ts.Listener.Addr().String() + from, err := HostPortToIP(r.RemoteAddr) + if err != nil { + t.Fatal(err) + } + to := ts.Listener.Addr() uid, err := AddrPairUserid(from, to) if err != nil { fmt.Fprintf(rw, "ERR: %v", err)