Skip to content

Commit

Permalink
Fix GPU detection test
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberj0g committed Jun 9, 2022
1 parent 71edaeb commit ddc9c1e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions common/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,22 @@ func TestRatPriceInfo(t *testing.T) {
assert.Zero(priceInfo.Cmp(big.NewRat(7, 2)))
}

func TestParseAccelDevices_FailedDetection(t *testing.T) {
assert := assert.New(t)

getGPU = func() ([]*gpu.GraphicsCard, error) {
return []*gpu.GraphicsCard{}, nil
}
getPCI = func() ([]*pci.Device, error) {
return []*pci.Device{}, nil
}

ids, err := ParseAccelDevices("all", ffmpeg.Nvidia)

assert.NotNil(err)
assert.Equal(len(ids), 0)
}

func TestParseAccessDevices_Gpu(t *testing.T) {
assert := assert.New(t)

Expand Down

0 comments on commit ddc9c1e

Please sign in to comment.