(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestContextConfigListDevices(t *testing.T) { |
| 37 | c, err := NewContext(nil) |
| 38 | if err != nil { |
| 39 | t.Fatal(err) |
| 40 | } |
| 41 | devs, err := c.ListDevices() |
| 42 | if err != nil { |
| 43 | t.Fatal(err) |
| 44 | } |
| 45 | if len(devs) < 1 { |
| 46 | t.Fatalf("No devices found using ListDevices()") |
| 47 | } |
| 48 | foundCPUDevice := false |
| 49 | for _, d := range devs { |
| 50 | if d.Type == "CPU" { |
| 51 | foundCPUDevice = true |
| 52 | } |
| 53 | } |
| 54 | if !foundCPUDevice { |
| 55 | t.Error("Failed to find CPU device using ListDevices()") |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected