< Summary

Class:TextureUtils
Assembly:TextureUtils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/TextureUtils/TextureUtils.cs
Covered lines:4
Uncovered lines:6
Coverable lines:10
Total lines:20
Line coverage:40% (4 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
TextureUtils()0%110100%
IsQuestionMarkPNG(...)0%19.856027.27%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/TextureUtils/TextureUtils.cs

#LineLine coverage
 1using UnityEngine;
 2
 3public static class TextureUtils
 4{
 15    static readonly byte[] questionMarkPNG = { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 8,
 6    public static bool IsQuestionMarkPNG(Texture tex)
 7    {
 798        if (!tex)
 09            return true;
 10
 7911        if (tex.width != 8 || tex.height != 8)
 7912            return false;
 13
 014        byte[] png1 = (tex as Texture2D).EncodeToPNG();
 015        for (int i = 0; i < questionMarkPNG.Length; i++)
 016            if (!png1[i].Equals(questionMarkPNG[i]))
 017                return false;
 018        return true;
 19    }
 20}