Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

TestSystemGuid.cs 1.4KB

123456789101112131415161718192021222324252627282930313233343536
  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. // Disabled on .Net 7 - Needs Unsafe::Add / Unsafe::AsRef / Unsafe::As handling
  19. [TestCompiler(typeof(SystemGuidProvider), DisableGold = true, IgnoreOnNetCore = true)]
  20. public static int GuidArg(ref Guid guid)
  21. {
  22. return guid == new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0) ? 1 : 0;
  23. }
  24. public static readonly Guid StaticReadonlyGuid = new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0);
  25. // Disabled on .Net 7 - Needs Unsafe::Add / Unsafe::AsRef / Unsafe::As handling
  26. [TestCompiler(IgnoreOnNetCore = true)]
  27. public static int GuidStaticReadonly()
  28. {
  29. return StaticReadonlyGuid == new Guid(0x26b6afc2, 0xf1b2, 0x479d, 0xb2, 0xad, 0x13, 0x2f, 0x17, 0x8d, 0x3a, 0xe0) ? 1 : 0;
  30. }
  31. }
  32. }