merge to one executable

This commit is contained in:
fancy
2020-05-18 17:29:58 +08:00
committed by fancy
parent 051742eef1
commit aedebf4e31
11 changed files with 73 additions and 48 deletions

View File

@@ -2,6 +2,6 @@ include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/src)
find_package(nlohmann_json REQUIRED)
add_executable(client_test socket_client_test.cpp)
target_link_libraries(client_test cgproxy-lib)
add_executable(client_test socket_client_test.cpp
../src/socket_client.cpp ../src/common.cpp ../src/config.cpp)
target_link_libraries(client_test nlohmann_json::nlohmann_json)

View File

@@ -29,16 +29,15 @@ void send_pid(const pid_t pid, bool proxy, int &status) {
SOCKET::send(j.dump(), status);
}
void test_config(){
void test_config() {
Config config;
config.cgroup_proxy={"/"};
config.cgroup_proxy = {"/"};
int status;
send_config(config, status);
}
void test_config_path(){
string path="/etc/cgproxy/config.json";
void test_config_path() {
string path = "/etc/cgproxy/config.json";
int status;
send_config_path(path, status);
}