github.com/sitano/gsysint@v0.0.0-20190607084937-69a4f3233e4e/g/g_test.go (about)

     1  package g
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestGetG(t *testing.T) {
     8  	g := GetG()
     9  
    10  	if g == nil {
    11  		t.Fatalf("GetG() returned nil pointer to the g structure")
    12  	}
    13  
    14  	t.Log("*g =", g)
    15  	// t.Log("g =", fmt.Sprintf("%#v", (*G)(g)))
    16  }
    17  
    18  func TestGetGID(t *testing.T) {
    19  	t.Log("goroutine id = ", CurG().GoID)
    20  }
    21  
    22  func TestGetM(t *testing.T) {
    23  	m := GetM()
    24  
    25  	if m == nil {
    26  		t.Fatalf("GetM() returned nil pointer to the m structure")
    27  	}
    28  
    29  	t.Log("*m =", m)
    30  	// t.Log("m =", fmt.Sprintf("%#v", (*M)(m)))
    31  }