From 93ccaca8547f26ad20b7e8de1ba8fc229c3691a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E7=A7=91=E5=87=80?= <wkejing9687@163.com>
Date: Tue, 14 Sep 2021 21:34:24 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90communication=5Flite=E3=80=91=E3=80=90?=
 =?UTF-8?q?master=E3=80=91add=20lwip=20suites=20to=20linux?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: 王科净 <wkejing9687@163.com>
---
 build_lite/BUILD.gn                                | 1 +
 communication_lite/lwip_posix/BUILD.gn             | 6 ++++++
 communication_lite/lwip_posix/src/ActsLwipTest.cpp | 3 ++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/build_lite/BUILD.gn b/build_lite/BUILD.gn
index beaf6e912..5c37281eb 100644
--- a/build_lite/BUILD.gn
+++ b/build_lite/BUILD.gn
@@ -84,6 +84,7 @@ lite_component("acts_component") {
         "//test/xts/acts/utils_lite/kv_store_posix:ActsKvStoreTest",
         "//test/xts/acts/startup_lite/syspara_posix:ActsParameterTest",
         "//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest",
+        "//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest",
 
         #"//test/xts/acts/security_lite/huks_posix:ActsSecurityDataTest",
         "//test/xts/acts/security_lite/permission_posix/pms:ActsPMSTest",
diff --git a/communication_lite/lwip_posix/BUILD.gn b/communication_lite/lwip_posix/BUILD.gn
index b2cdd0941..eb1abc693 100755
--- a/communication_lite/lwip_posix/BUILD.gn
+++ b/communication_lite/lwip_posix/BUILD.gn
@@ -25,4 +25,10 @@ hcpptest_suite("ActsLwipTest") {
   deps = ["//third_party/bounds_checking_function:libsec_shared" ]
 
   cflags = [ "-Wno-error" ]
+      
+  ldflags = [
+    "-lstdc++",
+    "-lm",
+    "-lpthread",
+  ]
 }
diff --git a/communication_lite/lwip_posix/src/ActsLwipTest.cpp b/communication_lite/lwip_posix/src/ActsLwipTest.cpp
index 288deb26a..ca6d2019e 100755
--- a/communication_lite/lwip_posix/src/ActsLwipTest.cpp
+++ b/communication_lite/lwip_posix/src/ActsLwipTest.cpp
@@ -413,7 +413,8 @@ static int SelectServerForFork(unsigned int timeoutSec)
     char dataBuf[50] = {0};
     int fds[TEST_FD_COUNT] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
     fds[0] = srvFd;
-    struct timeval timev = {.tv_sec = timeoutSec, .tv_usec = 0};
+    long timeout = timeoutSec;
+    struct timeval timev = {.tv_sec = timeout, .tv_usec = 0};
     struct sockaddr_in clnAddr = {0};
     socklen_t clnAddrLen = sizeof(clnAddr);
     while (1) {
-- 
GitLab