Skip to content

Commit 248ef67

Browse files
committed
Run some Go auto-tests in parallel.
This requires that all auto-tests are in the same top level test.
1 parent ac581fd commit 248ef67

File tree

4 files changed

+281
-211
lines changed

4 files changed

+281
-211
lines changed

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ go_test(
3838
name = "go_default_test",
3939
srcs = [
4040
"group_intern_test.go",
41-
"group_test.go",
4241
"tox_test.go",
4342
],
43+
args = ["-test.parallel 50"],
4444
embed = [":go_default_library"],
4545
importpath = "github.com/TokTok/go-toxcore-c",
4646
)

group_test.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

tox.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,23 @@ func (this *Tox) SelfGetFriendList() []uint32 {
955955

956956
// tox_callback_***
957957

958+
func (this *Tox) SelfGetDhtId() string {
959+
var addr [PUBLIC_KEY_SIZE]byte
960+
var caddr = (*C.uint8_t)(unsafe.Pointer(&addr[0]))
961+
C.tox_self_get_dht_id(this.toxcore, caddr)
962+
963+
return strings.ToUpper(hex.EncodeToString(addr[:]))
964+
}
965+
966+
func (this *Tox) SelfGetUdpPort() (uint16, error) {
967+
var cerr C.TOX_ERR_GET_PORT
968+
r := C.tox_self_get_udp_port(this.toxcore, &cerr)
969+
if cerr > 0 {
970+
return 0, toxerr(cerr)
971+
}
972+
return uint16(r), nil
973+
}
974+
958975
func (this *Tox) SelfGetNospam() uint32 {
959976
r := C.tox_self_get_nospam(this.toxcore)
960977
return uint32(r)

0 commit comments

Comments
 (0)