aboutsummaryrefslogtreecommitdiff
path: root/misc/cgo/test/basic.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-05-02 13:55:51 -0400
committerRuss Cox <rsc@golang.org>2011-05-02 13:55:51 -0400
commitf985638b94bb72c80e5e27c284d37eabe7d09aea (patch)
tree48066d95bb309472ba228f9fad3f62a077330df6 /misc/cgo/test/basic.go
parent3599e3fc12e0b2056b15ce4286af9c332b0157dd (diff)
downloadgo-f985638b94bb72c80e5e27c284d37eabe7d09aea.tar.xz
misc/cgo/test: run tests
The new gotest ignores Test functions outside *_test.go files (the old shell script allowed them), so replace one clumsy hack with another. The root problem is that the package makefiles only know how to run cgo for source files in the package proper, not for test files. Making it work for test files is probably more trouble than it's worth. R=bradfitz CC=golang-dev https://golang.org/cl/4452060
Diffstat (limited to 'misc/cgo/test/basic.go')
-rw-r--r--misc/cgo/test/basic.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/cgo/test/basic.go b/misc/cgo/test/basic.go
index a94074c52e..b9d0953bd3 100644
--- a/misc/cgo/test/basic.go
+++ b/misc/cgo/test/basic.go
@@ -90,31 +90,31 @@ func Atol(s string) int {
return int(n)
}
-func TestConst(t *testing.T) {
+func testConst(t *testing.T) {
C.myConstFunc(nil, 0, nil)
}
-func TestEnum(t *testing.T) {
+func testEnum(t *testing.T) {
if C.Enum1 != 1 || C.Enum2 != 2 {
t.Error("bad enum", C.Enum1, C.Enum2)
}
}
-func TestAtol(t *testing.T) {
+func testAtol(t *testing.T) {
l := Atol("123")
if l != 123 {
t.Error("Atol 123: ", l)
}
}
-func TestErrno(t *testing.T) {
+func testErrno(t *testing.T) {
n, err := Strtol("asdf", 123)
if n != 0 || err != os.EINVAL {
t.Error("Strtol: ", n, err)
}
}
-func TestMultipleAssign(t *testing.T) {
+func testMultipleAssign(t *testing.T) {
p := C.CString("234")
n, m := C.strtol(p, nil, 345), C.strtol(p, nil, 10)
if n != 0 || m != 234 {