Skip to content

Commit 5bbb3c2

Browse files
committed
Trying to fix tests on ci
1 parent 06e6136 commit 5bbb3c2

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

tests/GraphBLAS-sharp.Tests/Helpers.fs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ module Generators =
2525
// TODO уточнить, что пустые матрицы тоже генерятся
2626
let dimension2DGenerator =
2727
Gen.sized <| fun size ->
28-
let quarter = size / 4
29-
Gen.choose (size - quarter, size + quarter)
30-
|> Gen.filter (fun value -> value > 0)
28+
Gen.choose (1, size)
3129
|> Gen.two
3230

3331
let dimension3DGenerator =
3432
Gen.sized <| fun size ->
35-
let quarter = size / 4
36-
Gen.choose (size - quarter, size + quarter)
37-
|> Gen.filter (fun value -> value > 0)
33+
Gen.choose (1, size)
3834
|> Gen.three
3935

4036
let genericSparseGenerator zero valuesGen handler =
@@ -288,7 +284,7 @@ module Generators =
288284
module Utils =
289285
let defaultConfig =
290286
{ FsCheckConfig.defaultConfig with
291-
maxTest = 20
287+
maxTest = 10
292288
startSize = 1
293289
endSize = 1000
294290
arbitrary = [
@@ -323,9 +319,11 @@ module Utils =
323319
|> Seq.distinctBy (fun device -> Cl.GetDeviceInfo(device, DeviceInfo.Name, &e).ToString())
324320
|> Seq.filter
325321
(fun device ->
322+
let isAvaliable = Cl.GetDeviceInfo(device, DeviceInfo.Available, &e).CastTo<bool>()
326323
let platform = Cl.GetDeviceInfo(device, DeviceInfo.Platform, &e).CastTo<Platform>()
327324
let platformName = Cl.GetPlatformInfo(platform, PlatformInfo.Name, &e).ToString()
328-
(Regex platformRegex).IsMatch platformName
325+
(Regex platformRegex).IsMatch platformName &&
326+
isAvaliable
329327
)
330328
|> Seq.map
331329
(fun device ->

0 commit comments

Comments
 (0)