gfcp_test.go 1.3 KB

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