暫無描述
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.

TestSystemGuid.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using Unity.Burst;
  3. using UnityBenchShared;
  4. namespace Burst.Compiler.IL.Tests
  5. {
  6. /// <summary>
  7. /// Tests types
  8. /// </summary>
  9. [BurstCompile]
  10. internal class SystemGuid
  11. {
  12. public struct SystemGuidProvider : IArgumentProvider
  13. {
  14. public object Value => new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0);
  15. }
  16. // TODO: Gold disabled because System.Guid has very different code on Mono/macOS vs .NET/Windows. Should re-check
  17. // once we use .NET everywhere.
  18. [TestCompiler(typeof(SystemGuidProvider), DisableGold = true)]
  19. public static int GuidArg(ref Guid guid)
  20. {
  21. return guid == new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0) ? 1 : 0;
  22. }
  23. public static readonly Guid StaticReadonlyGuid = new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0);
  24. [TestCompiler]
  25. public static int GuidStaticReadonly()
  26. {
  27. return StaticReadonlyGuid == new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0) ? 1 : 0;
  28. }
  29. }
  30. }