Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GpuTimeProviderUnitTests.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.IO;
  2. using NUnit.Framework;
  3. using UnityEngine;
  4. using UnityEngine.AdaptivePerformance;
  5. namespace UnityEditor.AdaptivePerformance.Editor.Tests
  6. {
  7. public class GpuTimeProviderUnitTests
  8. {
  9. GpuTimeProvider belowTestSubject;
  10. GpuTimeProvider aboveTestSubject;
  11. [Test]
  12. public void VerifyFrameTime_WhenlatestTiming_IsBelowUnit()
  13. {
  14. Assert.AreEqual(-1.0f,new BelowUnitGpuTimeProvider().GpuFrameTime);
  15. }
  16. [Test]
  17. public void VerifyFrameTime_WhenlatestTiming_IsAboveUnit()
  18. {
  19. Assert.AreEqual(-1.0f,new AboveUnitGpuTimeProvider().GpuFrameTime);
  20. }
  21. internal class BelowUnitGpuTimeProvider : GpuTimeProvider
  22. {
  23. protected override uint GetLatestTimings()
  24. {
  25. return (uint)0.8;
  26. }
  27. }
  28. internal class AboveUnitGpuTimeProvider : GpuTimeProvider
  29. {
  30. protected override uint GetLatestTimings()
  31. {
  32. return (uint)1.7;
  33. }
  34. }
  35. }
  36. }