Example #1
0
    public void ProfileAnalysis_SetRange_ModifiesFirstLastIndices()
    {
        var analysis = new ProfileAnalysis();

        analysis.SetRange(0, 300);

        Assert.IsTrue(0 == analysis.GetFrameSummary().first);
        Assert.IsTrue(300 == analysis.GetFrameSummary().last);
    }
Example #2
0
    public void ProfileAnalysis_SetupFrameBuckets_GeneratesExpectedValues()
    {
        var analysis = new ProfileAnalysis();

        var marker = new MarkerData("Test Marker");

        marker.presentOnFrameCount = 1;

        for (int i = 0; i < 20; ++i)
        {
            analysis.UpdateSummary(i, 1.0f * i);
        }

        analysis.SetupFrameBuckets(20);

        var summary = analysis.GetFrameSummary();

        Assert.IsTrue(2 == summary.buckets[0]);

        for (int i = 1; i < summary.buckets.Length - 1; ++i)
        {
            Assert.IsTrue(1 == summary.buckets[i]);
        }

        Assert.IsTrue(0 == summary.buckets[19]);
    }
Example #3
0
    public void ProfileAnalysis_UpdateSummary_AddsFramesToSummary()
    {
        var analysis     = new ProfileAnalysis();
        var frameSummary = analysis.GetFrameSummary();

        Assert.IsTrue(0 == frameSummary.frames.Count);

        analysis.UpdateSummary(0, 0.1f);

        Assert.IsTrue(1 == frameSummary.frames.Count);
    }