1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 #cgo linux LDFLAGS: -ldl
13 extern void call4029(void *arg);
28 //export IMPInitWithFrame
29 func IMPInitWithFrame() {
38 //export IMPWindowResize
39 func IMPWindowResize() {
43 func test4029(t
*testing
.T
) {
44 loadThySelf(t
, "IMPWindowResize")
45 loadThySelf(t
, "IMPDrawRect")
46 loadThySelf(t
, "IMPInitWithFrame")
47 loadThySelf(t
, "IMPIsOpaque")
49 t
.Errorf("got %d callbacks, expected 4", callbacks
)
53 func loadThySelf(t
*testing
.T
, symbol
string) {
54 this_process
:= C
.dlopen(nil, C
.RTLD_NOW
)
55 if this_process
== nil {
56 t
.Error("dlopen:", C
.GoString(C
.dlerror()))
59 defer C
.dlclose(this_process
)
61 symbol_address
:= C
.dlsym(this_process
, C
.CString(symbol
))
62 if symbol_address
== nil {
63 t
.Error("dlsym:", C
.GoString(C
.dlerror()))
66 t
.Log(symbol
, symbol_address
)
67 C
.call4029(symbol_address
)