• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MeltyPlayer / MeltyTool / 20982513833

14 Jan 2026 04:35AM UTC coverage: 41.138% (-0.8%) from 41.907%
20982513833

push

github

MeltyPlayer
Fixed broken shader source tests.

6752 of 18485 branches covered (36.53%)

Branch coverage included in aggregate %.

28650 of 67572 relevant lines covered (42.4%)

64006.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.22
/FinModelUtility/Fin/Fin/src/language/equations/fixedFunction/util/ValueExtensions.cs
1
using System;
2

3
using fin.math.floats;
4

5
namespace fin.language.equations.fixedFunction.util;
6

7
public static class ValueExtensions {
8
  public static bool IsZero(this IValue? value)
9
    => value switch {
44,082!
10
        IColorValue colorValue => colorValue.IsRoughly(0),
30,234✔
11
        IScalarValue scalarValue => scalarValue.IsRoughly(0),
13,848✔
12
        null => true,
×
13
        _ => throw new ArgumentOutOfRangeException(nameof(value), value, null)
×
14
    };
44,082✔
15

16
  public static bool IsOne(this IValue? value)
17
    => value switch {
20,842!
18
        IColorValue colorValue => colorValue.IsRoughly(1),
14,597✔
19
        IScalarValue scalarValue => scalarValue.IsRoughly(1),
6,245✔
20
        null => false,
×
21
        _ => throw new ArgumentOutOfRangeException(nameof(value), value, null)
×
22
    };
20,842✔
23

24
  public static bool IsRoughly(this IColorValue? value, float intensity)
25
    => value switch {
44,831!
26
        IColorConstant colorConstant
44,831✔
27
            => (colorConstant.IntensityValue != null &&
8,378✔
28
                colorConstant.IntensityValue.Value.IsRoughly_(intensity)) ||
8,378✔
29
               (colorConstant.RValue.IsRoughly_(intensity) &&
8,378✔
30
                colorConstant.GValue.IsRoughly_(intensity) &&
8,378✔
31
                colorConstant.BValue.IsRoughly_(intensity)),
8,378✔
32
        ColorWrapper colorWrapper
44,831✔
33
            => (colorWrapper.Intensity != null &&
1,765!
34
                colorWrapper.Intensity.IsRoughly(intensity)) ||
1,765✔
35
               (colorWrapper.R.IsRoughly(intensity) &&
1,765✔
36
                colorWrapper.G.IsRoughly(intensity) &&
1,765✔
37
                colorWrapper.B.IsRoughly(intensity)),
1,765✔
38
        null => intensity.IsRoughly0(),
×
39
        _    => false
34,688✔
40
    };
44,831✔
41

42
  public static bool IsRoughly(this IScalarValue? value, float intensity)
43
    => value switch {
24,990!
44
        IScalarOutput scalarOutput
24,990✔
45
            => scalarOutput.ScalarValue.IsRoughly(intensity),
1,413✔
46
        IScalarConstant scalarConstant
24,990✔
47
            => scalarConstant.Value.IsRoughly_(intensity),
14,513✔
48
        null => intensity.IsRoughly0(),
×
49
        _    => false
9,064✔
50
    };
24,990✔
51

52
  public const float TOLERANCE = 1 / 255f;
53

54
  private static bool IsRoughly_(this float actual, float expected)
55
    => Math.Abs(actual - expected) < TOLERANCE;
27,707✔
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc