From 981ca0fa022524fd04af988bc798f2d697d31548 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期三, 19 五月 2021 14:33:10 +0800
Subject: [PATCH] hide .so symbols, avoid 2+ protobuf link conflict.
---
api/bhsgo/bhome_node_test.go | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/api/bhsgo/bhome_node_test.go b/api/bhsgo/bhome_node_test.go
index 9f2b324..756b752 100644
--- a/api/bhsgo/bhome_node_test.go
+++ b/api/bhsgo/bhome_node_test.go
@@ -1,11 +1,12 @@
package bhsgo
import (
- bh "bhshmq/proto/source/bhome_msg"
"fmt"
"testing"
"time"
"unsafe"
+
+ bh "basic.com/valib/bhshmq.git/proto/source/bhome_msg"
)
func ServerCallback(src unsafe.Pointer, proc_id *string, req *bh.MsgRequestTopic) {
@@ -26,10 +27,23 @@
proc := bh.ProcInfo{}
proc.ProcId = []byte(proc_id)
reply := bh.MsgCommonReply{}
-
- StartWorker(ClientCallback, ServerCallback, SubDataCallback)
+ defer Cleanup()
r := Register(&proc, &reply, 1000)
+ if r {
+ fmt.Println("register ok")
+ } else {
+ fmt.Println("register failed")
+ return
+ }
+ r = Unregister(&proc, &reply, 1000)
+ if r {
+ fmt.Println("Unregister ok")
+ } else {
+ fmt.Println("Unregister failed")
+ }
+
+ r = Register(&proc, &reply, 1000)
if r {
fmt.Println("register ok")
} else {
@@ -37,6 +51,8 @@
t.Log("register error")
return
}
+
+ StartWorker(ClientCallback, ServerCallback, SubDataCallback)
r = HeartbeatEasy(1000)
if r {
@@ -65,7 +81,7 @@
pid := ""
rr := bh.MsgRequestTopicReply{}
dest := bh.BHAddress{}
- for i := 0; i < 10000; i++ {
+ for i := 0; i < 100; i++ {
if Request(&dest, &req, &pid, &rr, 3000) {
fmt.Println("server:" + pid + ", reply:" + string(rr.Data))
} else {
--
Gitblit v1.8.0