< Summary

Class:GDX.Developer.Reports.Resource.Objects.ShaderObjectInfo
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/ShaderObjectInfo.cs
Covered lines:9
Uncovered lines:3
Coverable lines:12
Total lines:55
Line coverage:75% (9 of 12)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:3
Method coverage:66.6% (2 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Clone()0%2100%
Populate(...)0%110100%
GetDetailedInformation(...)0%110100%

File(s)

./Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/ShaderObjectInfo.cs

#LineLine coverage
 1// Copyright (c) 2020-2024 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5#if !UNITY_DOTSRUNTIME
 6
 7using UnityEngine;
 8
 9namespace GDX.Developer.Reports.Resource.Objects
 10{
 11    /// <exception cref="UnsupportedRuntimeException">Not supported on DOTS Runtime.</exception>
 12    public sealed class ShaderObjectInfo : ObjectInfo
 13    {
 14        public new const string TypeDefinition = "GDX.Developer.Reports.Resource.Objects.ShaderObjectInfo,GDX";
 15        public bool IsSupported;
 16        public int PassCount;
 17
 18
 19        /// <summary>
 20        ///     Create a clone of this object.
 21        /// </summary>
 22        /// <returns></returns>
 23        public override ObjectInfo Clone()
 024        {
 025            return new ShaderObjectInfo
 26            {
 27                CopyCount = CopyCount,
 28                MemoryUsage = MemoryUsage,
 29                Name = Name,
 30                Reference = Reference,
 31                TotalMemoryUsage = TotalMemoryUsage,
 32                Type = Type,
 33                IsSupported = IsSupported,
 34                PassCount = PassCount
 35            };
 036        }
 37
 38        public override void Populate(Object targetObject, TransientReference reference = null)
 13239        {
 13240            base.Populate(targetObject, reference);
 13241            Shader shaderAsset = (Shader)targetObject;
 42
 43            // Useful shader information
 13244            PassCount = shaderAsset.passCount;
 13245            IsSupported = shaderAsset.isSupported;
 13246        }
 47
 48        /// <inheritdoc />
 49        public override string GetDetailedInformation(int maximumWidth)
 17650        {
 17651            return $"Passes:{PassCount.ToString()}";
 17652        }
 53    }
 54}
 55#endif // !UNITY_DOTSRUNTIME

Coverage by test methods




Methods/Properties

Clone()
Populate(UnityEngine.Object, GDX.Developer.TransientReference)
GetDetailedInformation(System.Int32)