gfcp_test.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright © 2015 Daniel Fu <daniel820313@gmail.com>.
  2. // Copyright © 2019 Loki 'l0k18' Verloren <stalker.loki@protonmail.ch>.
  3. // Copyright © 2021 Gridfinity, LLC. <admin@gridfinity.com>.
  4. //
  5. // All rights reserved.
  6. //
  7. // All use of this code is governed by the MIT license.
  8. // The complete license is available in the LICENSE file.
  9. package gfcp_test
  10. import (
  11. "fmt"
  12. "runtime"
  13. "testing"
  14. u "go.gridfinity.dev/leaktestfe"
  15. licn "go4.org/legal"
  16. )
  17. func TestArchitecture(
  18. t *testing.T,
  19. ) {
  20. defer u.Leakplug(
  21. t,
  22. )
  23. is64bit := uint64(^uintptr(0)) == ^uint64(0)
  24. if !is64bit {
  25. t.Fatal(
  26. "\n\t*** Platform is not 64-bit, unsupported architecture",
  27. )
  28. }
  29. }
  30. func TestGoEnvironment(
  31. t *testing.T,
  32. ) {
  33. defer u.Leakplug(
  34. t,
  35. )
  36. t.Log(
  37. fmt.Sprintf(
  38. "\n\tCompiler:\t%v (%v)\n\tSystem:\t\t%v/%v\n\tCPU(s):\t\t%v logical processor(s)\n\tGOMAXPROCS:\t%v\n",
  39. runtime.Compiler,
  40. runtime.Version(),
  41. runtime.GOOS,
  42. runtime.GOARCH,
  43. runtime.NumCPU(),
  44. runtime.GOMAXPROCS(
  45. -1,
  46. ),
  47. ),
  48. )
  49. }
  50. func TestGFcpLicense(
  51. t *testing.T,
  52. ) {
  53. defer u.Leakplug(
  54. t,
  55. )
  56. licenses := licn.Licenses()
  57. if len(
  58. licenses,
  59. ) == 0 {
  60. t.Fatal(
  61. "\n\ngfcp_license_test.TestGFcpLicense FAILURE",
  62. )
  63. } else {
  64. t.Log(
  65. fmt.Sprintf(
  66. "\n\n%v\n",
  67. licenses,
  68. ),
  69. )
  70. }
  71. }