mirror of
https://github.com/ziutek/glib.git
synced 2025-09-27 03:36:01 +08:00
Widac jakis sens
This commit is contained in:
29
glib_test.go
Normal file
29
glib_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package glib
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestValue(t *testing.T) {
|
||||
v1 := uint64(0xdeadbeaf)
|
||||
a := ValueOf(v1)
|
||||
b := NewValueInit(TYPE_UINT64)
|
||||
a.Copy(b)
|
||||
t.Logf("a = %s(%s), b = %s(%s)", a.Type(), a, b.Type(), b)
|
||||
if b.Get().(uint64) != v1 {
|
||||
t.Error("TYPE_UINT64")
|
||||
}
|
||||
v2 := -1
|
||||
a = ValueOf(v2)
|
||||
b = NewValueInit(TYPE_INT)
|
||||
a.Copy(b)
|
||||
t.Logf("a = %s(%s), b = %s(%s)", a.Type(), a, b.Type(), b)
|
||||
if b.Get() != v2 {
|
||||
t.Error("TYPE_INT")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSignal(t *testing.T) {
|
||||
s := NewSignal("bla", TYPE_NONE, TYPE_GO_INT)
|
||||
t.Logf("Signal: %s", s)
|
||||
}
|
Reference in New Issue
Block a user