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.
---
utest/robust_test.cpp | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/utest/robust_test.cpp b/utest/robust_test.cpp
index e7b8894..ea6144c 100644
--- a/utest/robust_test.cpp
+++ b/utest/robust_test.cpp
@@ -16,6 +16,35 @@
/////////////////////////////////////////////////////////////////////////////////////////
+BOOST_AUTO_TEST_CASE(InitTest)
+{
+ AtomicReqRep rr;
+ auto client = [&]() {
+ for (int i = 0; i < 20; ++i) {
+ int64_t reply = 0;
+ bool r = rr.ClientRequest(i, reply);
+ printf("init request %d, %s, reply %d\n", i, (r ? "ok" : "failed"), reply);
+ }
+ };
+
+ bool run = true;
+ auto server = [&]() {
+ auto onReq = [](int64_t req) { return req + 100; };
+ while (run) {
+ rr.ServerProcess(onReq);
+ }
+ };
+
+ ThreadManager clients, servers;
+ servers.Launch(server);
+ for (int i = 0; i < 2; ++i) {
+ clients.Launch(client);
+ }
+ clients.WaitAll();
+ run = false;
+ servers.WaitAll();
+}
+
BOOST_AUTO_TEST_CASE(QueueTest)
{
const int nthread = 100;
--
Gitblit v1.8.0