(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestGetOrientation(t *testing.T) { |
| 38 | tests := []struct { |
| 39 | filename string |
| 40 | expected int |
| 41 | }{ |
| 42 | {"./testdata/ben.jpg", 1}, |
| 43 | {"./testdata/acai.jpg", 6}, |
| 44 | {"./testdata/dog.jpg", 6}, |
| 45 | {"./testdata/small-png.png", 1}, |
| 46 | {"./testdata/small-logo.jpg", 1}, |
| 47 | } |
| 48 | |
| 49 | for _, tt := range tests { |
| 50 | result, err := GetOrientation(openFile(tt.filename)) |
| 51 | if err != nil { |
| 52 | t.Errorf("Received unexpected error when getting orientation: %s", err) |
| 53 | } |
| 54 | if result != tt.expected { |
| 55 | t.Errorf("Expected GetOrientation(%s) to be %d but got %v", tt.filename, tt.expected, result) |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestGetDimensions(t *testing.T) { |
| 61 | tests := []struct { |
nothing calls this directly
no test coverage detected