File tree 8 files changed +133
-0
lines changed
8 files changed +133
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**************************************************************************
2
+ * @file: Ftpclient.h
3
+ * @brief:
4
+ *
5
+ * Copyright(c) 2020-present O-Net Communications (ShenZhen) Limited.
6
+ * This code is licensed under MIT license (see LICENSE for details)
7
+ *
8
+ *************************************************************************/
9
+
10
+ #pragma once
11
+
12
+ #ifdef _WIN32
13
+ #include <WinSock2.h>
14
+ #endif
15
+
16
+ #include <asio.hpp>
Original file line number Diff line number Diff line change
1
+ /**************************************************************************
2
+ * @file: TcpClient.h
3
+ * @brief:
4
+ *
5
+ * Copyright(c) 2020-present O-Net Communications (ShenZhen) Limited.
6
+ * This code is licensed under MIT license (see LICENSE for details)
7
+ *
8
+ *************************************************************************/
9
+
10
+ #pragma once
11
+
12
+ #ifdef _WIN32
13
+ #include <WinSock2.h>
14
+ #endif
15
+
16
+ #include <asio.hpp>
Original file line number Diff line number Diff line change
1
+ /**************************************************************************
2
+ * @file: TcpServer.h
3
+ * @brief:
4
+ *
5
+ * Copyright(c) 2020-present O-Net Communications (ShenZhen) Limited.
6
+ * This code is licensed under MIT license (see LICENSE for details)
7
+ *
8
+ *************************************************************************/
9
+
10
+ #pragma once
11
+
12
+ #ifdef _WIN32
13
+ #include <WinSock2.h>
14
+ #endif
15
+
16
+ #include <asio.hpp>
Original file line number Diff line number Diff line change
1
+ /**************************************************************************
2
+ * @file: UdpClient.h
3
+ * @brief:
4
+ *
5
+ * Copyright(c) 2020-present O-Net Communications (ShenZhen) Limited.
6
+ * This code is licensed under MIT license (see LICENSE for details)
7
+ *
8
+ *************************************************************************/
9
+
10
+ #pragma once
11
+
12
+ #ifdef _WIN32
13
+ #include <WinSock2.h>
14
+ #endif
15
+
16
+ #include <asio.hpp>
Original file line number Diff line number Diff line change
1
+ /**************************************************************************
2
+ * @file: UdpServer.h
3
+ * @brief:
4
+ *
5
+ * Copyright(c) 2020-present O-Net Communications (ShenZhen) Limited.
6
+ * This code is licensed under MIT license (see LICENSE for details)
7
+ *
8
+ *************************************************************************/
9
+
10
+ #pragma once
11
+
12
+ #ifdef _WIN32
13
+ #include <WinSock2.h>
14
+ #endif
15
+
16
+ #include <asio.hpp>
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.10)
2
+
3
+ set (SOURCE
4
+ main.cpp
5
+ TcpTests.cpp
6
+ )
7
+
8
+ add_executable (network_test ${SOURCE} )
9
+
10
+ target_include_directories (network_test PUBLIC
11
+ ${CMAKE_SOURCE_DIR}
12
+ )
13
+
14
+ # set_target_warnings_as_error(TARGET network_test)
15
+ target_compile_features (network_test PRIVATE ${CXX_STD} )
16
+
17
+ target_link_libraries (network_test gtest asio spdlog)
18
+ if (UNIX )
19
+ target_link_libraries (network_test
20
+ $<$<AND :$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS :$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>)
21
+ endif ()
22
+
23
+ include (CTest)
24
+ include (GoogleTest)
25
+ gtest_discover_tests(network_test)
Original file line number Diff line number Diff line change
1
+ /* *************************************************************************
2
+ * @file: TcpTests.cpp
3
+ * @brief:
4
+ *
5
+ * Copyright(c) 2020-present O-Net Communications (ShenZhen) Limited.
6
+ * This code is licensed under MIT license (see LICENSE for details)
7
+ *
8
+ **************************************************************************/
9
+
10
+ #include < gtest/gtest.h>
11
+
12
+ #include < network/TcpClient.h>
13
+ #include < network/TcpServer.h>
14
+
15
+ TEST (TCPTests, TCPServer)
16
+ {
17
+ }
18
+
19
+ TEST (TCPTests, TCPClient)
20
+ {
21
+ }
Original file line number Diff line number Diff line change
1
+ #include < gtest/gtest.h>
2
+
3
+ int main (int argc, char **argv)
4
+ {
5
+ ::testing::InitGoogleTest (&argc, argv);
6
+ return RUN_ALL_TESTS ();
7
+ }
You can’t perform that action at this time.
0 commit comments