From 39cdfecc8c0032b05f5f6d5ccd339381d2c9c1a9 Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Wed, 1 Jun 2016 18:28:06 +0900 Subject: [PATCH] Move sample engine lib to test package TODO: handle for the case of engine not exist. CSR_ERROR_ENGINE_NOT_EXIST error code should be returned. Change-Id: I0c11c7a89cddc4abb5efb72f852302e98e97de56 Signed-off-by: Kyungwook Tak --- CMakeLists.txt | 22 ++++++------- packaging/csr-framework.spec | 35 ++++++++++++--------- packaging/csr.manifest.in | 2 +- src/framework/service/server-service.cpp | 4 +-- test/CMakeLists.txt | 4 +++ {engine => test/engine}/CMakeLists.txt | 0 .../engine}/content-screening/CMakeLists.txt | 18 +++++------ .../resources/csret_cs_virus_signatures | 0 .../content-screening}/resources/vendor_logo.bmp | Bin .../engine}/content-screening/sample-engine.cpp | 0 .../engine}/web-protection/CMakeLists.txt | 18 +++++------ .../web-protection/resources/csret_wp_risky_urls | 0 .../web-protection}/resources/vendor_logo.bmp | Bin .../engine}/web-protection/sample-engine.cpp | 0 test/internals/CMakeLists.txt | 6 ++-- test/internals/test-cs-loader.cpp | 12 +++---- test/internals/test-main.cpp | 4 +-- test/internals/test-wp-loader.cpp | 12 +++---- 18 files changed, 72 insertions(+), 65 deletions(-) rename {engine => test/engine}/CMakeLists.txt (100%) rename {engine => test/engine}/content-screening/CMakeLists.txt (64%) rename {engine => test/engine}/content-screening/resources/csret_cs_virus_signatures (100%) rename {engine/web-protection => test/engine/content-screening}/resources/vendor_logo.bmp (100%) rename {engine => test/engine}/content-screening/sample-engine.cpp (100%) rename {engine => test/engine}/web-protection/CMakeLists.txt (64%) rename {engine => test/engine}/web-protection/resources/csret_wp_risky_urls (100%) rename {engine/content-screening => test/engine/web-protection}/resources/vendor_logo.bmp (100%) rename {engine => test/engine}/web-protection/sample-engine.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b12646..a89b3f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,9 @@ ADD_DEFINITIONS("-DRW_DBSPACE=\"${RW_DBSPACE}\"") ADD_DEFINITIONS("-DSERVICE_IDLE_TIMEOUT_TIME=${SERVICE_IDLE_TIMEOUT_TIME}") ADD_DEFINITIONS("-DPOPUP_SERVICE_IDLE_TIMEOUT_TIME=${POPUP_SERVICE_IDLE_TIMEOUT_TIME}") ADD_DEFINITIONS("-DPOPUP_SERVICE_ENV_FILE_PATH=\"${POPUP_SERVICE_ENV_FILE_PATH}\"") -ADD_DEFINITIONS("-DSAMPLE_ENGINE_RO_RES_DIR=\"${SAMPLE_ENGINE_RO_RES_DIR}\"") -ADD_DEFINITIONS("-DSAMPLE_ENGINE_RW_WORKING_DIR=\"${SAMPLE_ENGINE_RW_WORKING_DIR}\"") -ADD_DEFINITIONS("-DSAMPLE_ENGINE_DIR=\"${SAMPLE_ENGINE_DIR}\"") +ADD_DEFINITIONS("-DENGINE_RO_RES_DIR=\"${ENGINE_RO_RES_DIR}\"") +ADD_DEFINITIONS("-DENGINE_RW_WORKING_DIR=\"${ENGINE_RW_WORKING_DIR}\"") +ADD_DEFINITIONS("-DENGINE_DIR=\"${ENGINE_DIR}\"") ADD_DEFINITIONS("-DTEST_DIR=\"${TEST_DIR}\"") IF (CMAKE_BUILD_TYPE MATCHES "DEBUG") @@ -59,26 +59,25 @@ SET(TARGET_CSR_SERVER ${SERVICE_NAME}-server) SET(TARGET_CSR_CLIENT ${SERVICE_NAME}-client) SET(TARGET_CSR_COMMON ${SERVICE_NAME}-common) SET(TARGET_CSR_POPUP ${SERVICE_NAME}-popup) -SET(TARGET_CSR_CS_ENGINE_SAMPLE ${SERVICE_NAME}-cs-engine) -SET(TARGET_CSR_WP_ENGINE_SAMPLE ${SERVICE_NAME}-wp-engine) SET(TARGET_CSR_TEST ${SERVICE_NAME}-test) SET(TARGET_CSR_TEST_COMMON ${SERVICE_NAME}-test-common) SET(TARGET_CSR_INTERNAL_TEST ${SERVICE_NAME}-internal-test) SET(TARGET_CSR_POPUP_TEST ${SERVICE_NAME}-popup-test) SET(TARGET_CSR_THREADPOOL_TEST ${SERVICE_NAME}-threadpool-test) -# for now, sample engine as a default -ADD_DEFINITIONS("-DCS_ENGINE_PATH=\"${SAMPLE_ENGINE_DIR}/lib${TARGET_CSR_CS_ENGINE_SAMPLE}.so\"") -ADD_DEFINITIONS("-DWP_ENGINE_PATH=\"${SAMPLE_ENGINE_DIR}/lib${TARGET_CSR_WP_ENGINE_SAMPLE}.so\"") +SET(TARGET_CSR_CS_ENGINE ${SERVICE_NAME}-cs-engine) +SET(TARGET_CSR_WP_ENGINE ${SERVICE_NAME}-wp-engine) +ADD_DEFINITIONS("-DCS_ENGINE_PATH=\"${ENGINE_DIR}/lib${TARGET_CSR_CS_ENGINE}.so\"") +ADD_DEFINITIONS("-DWP_ENGINE_PATH=\"${ENGINE_DIR}/lib${TARGET_CSR_WP_ENGINE}.so\"") CONFIGURE_FILE(packaging/${SERVICE_NAME}-client.manifest.in ${SERVICE_NAME}-client.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-common.manifest.in ${SERVICE_NAME}-common.manifest @ONLY) IF (PLATFORM_VERSION_3) ADD_DEFINITIONS("-DPLATFORM_VERSION_3") - ADD_DEFINITIONS("-DDECLARE_POPUP_USER=\"\"") - ADD_DEFINITIONS("-DDECLARE_POPUP_GROUP=\"\"") - ADD_DEFINITIONS("-DDECLARE_POPUP_SMACK_PROCESS_LABEL=\"\"") + ADD_DEFINITIONS("-DDECLARE_POPUP_USER=") + ADD_DEFINITIONS("-DDECLARE_POPUP_GROUP=") + ADD_DEFINITIONS("-DDECLARE_POPUP_SMACK_PROCESS_LABEL=") CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY) ELSE (PLATFORM_VERSION_3) @@ -93,4 +92,3 @@ ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(pkgconfig) ADD_SUBDIRECTORY(systemd) ADD_SUBDIRECTORY(test) -ADD_SUBDIRECTORY(engine) diff --git a/packaging/csr-framework.spec b/packaging/csr-framework.spec index 2250575..1805a22 100644 --- a/packaging/csr-framework.spec +++ b/packaging/csr-framework.spec @@ -36,9 +36,9 @@ file contents and checking url to prevent malicious items. %global rw_data_dir /opt/share %global ro_db_dir %{ro_data_dir}/%{service_name}/dbspace %global rw_db_dir %{rw_data_dir}/%{service_name}/dbspace -%global sample_engine_ro_res_dir %{ro_data_dir}/%{service_name}/engine_res -%global sample_engine_rw_working_dir %{rw_data_dir}/%{service_name}/engine_data -%global sample_engine_dir %{ro_data_dir}/%{service_name}/engine +%global engine_ro_res_dir %{ro_data_dir}/%{service_name}/engine_res +%global engine_rw_working_dir %{rw_data_dir}/%{service_name}/engine_data +%global engine_dir %{ro_data_dir}/%{service_name}/engine %global test_dir %{rw_data_dir}/%{service_name}-test %global service_idle_timeout_time 60 @@ -143,9 +143,9 @@ test program of csr-framework -DRW_DBSPACE:PATH=%{rw_db_dir} \ -DSERVICE_IDLE_TIMEOUT_TIME=%{service_idle_timeout_time} \ -DPOPUP_SERVICE_IDLE_TIMEOUT_TIME=%{popup_service_idle_timeout_time} \ - -DSAMPLE_ENGINE_RO_RES_DIR:PATH=%{sample_engine_ro_res_dir} \ - -DSAMPLE_ENGINE_RW_WORKING_DIR:PATH=%{sample_engine_rw_working_dir} \ - -DSAMPLE_ENGINE_DIR:PATH=%{sample_engine_dir} \ + -DENGINE_RO_RES_DIR:PATH=%{engine_ro_res_dir} \ + -DENGINE_RW_WORKING_DIR:PATH=%{engine_rw_working_dir} \ + -DENGINE_DIR:PATH=%{engine_dir} \ -DTEST_TARGET=%{test_target} \ -DTEST_DIR:PATH=%{test_dir} \ %if "%{platform_version}" == "3.0" @@ -173,11 +173,14 @@ cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-common cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0 -mkdir -p %{buildroot}%{ro_db_dir} mkdir -p %{buildroot}%{rw_db_dir} -mkdir -p %{buildroot}%{sample_engine_ro_res_dir} +mkdir -p %{buildroot}%{ro_db_dir} cp data/scripts/*.sql %{buildroot}%{ro_db_dir} +mkdir -p %{buildroot}%{engine_dir} +mkdir -p %{buildroot}%{engine_ro_res_dir} +mkdir -p %{buildroot}%{engine_rw_working_dir} + %post systemctl daemon-reload if [ $1 = 1 ]; then @@ -239,13 +242,9 @@ fi %dir %attr(-, %{service_user}, %{service_group}) %{rw_db_dir} %attr(444, %{service_user}, %{service_group}) %{ro_db_dir}/*.sql -# sample engine related files -%dir %{sample_engine_dir} -%dir %{sample_engine_ro_res_dir} -%dir %attr(775, %{service_user}, %{service_group}) %{sample_engine_rw_working_dir} -%{sample_engine_dir}/lib%{service_name}-cs-engine.so -%{sample_engine_dir}/lib%{service_name}-wp-engine.so -%attr(-, %{service_user}, %{service_group}) %{sample_engine_rw_working_dir}/* +%dir %{engine_dir} +%dir %{engine_ro_res_dir} +%dir %attr(775, %{service_user}, %{service_group}) %{engine_rw_working_dir} %files -n lib%{name}-common %defattr(-,root,root,-) @@ -292,6 +291,12 @@ fi %attr(-, %{service_user}, %{service_group}) %{bin_dir}/%{service_name}-internal-test %attr(-, %{service_user}, %{service_group}) %{bin_dir}/%{service_name}-popup-test %attr(-, %{service_user}, %{service_group}) %{bin_dir}/%{service_name}-threadpool-test + # test resources %dir %attr(-, %{service_user}, %{service_group}) %{test_dir} %attr(-, %{service_user}, %{service_group}) %{test_dir}/* + +# sample engine related files +%{engine_dir}/lib%{service_name}-cs-engine.so +%{engine_dir}/lib%{service_name}-wp-engine.so +%attr(-, %{service_user}, %{service_group}) %{engine_rw_working_dir}/* diff --git a/packaging/csr.manifest.in b/packaging/csr.manifest.in index 8079f69..29c59c4 100644 --- a/packaging/csr.manifest.in +++ b/packaging/csr.manifest.in @@ -4,6 +4,6 @@ - + diff --git a/src/framework/service/server-service.cpp b/src/framework/service/server-service.cpp index db3667e..4e3546f 100644 --- a/src/framework/service/server-service.cpp +++ b/src/framework/service/server-service.cpp @@ -85,8 +85,8 @@ inline CommandId extractCommandId(BinaryQueue &q) ServerService::ServerService() : Service(), m_workqueue(2, 10), - m_cs(new CsLoader(CS_ENGINE_PATH, SAMPLE_ENGINE_RO_RES_DIR, SAMPLE_ENGINE_RW_WORKING_DIR)), - m_wp(new WpLoader(WP_ENGINE_PATH, SAMPLE_ENGINE_RO_RES_DIR, SAMPLE_ENGINE_RW_WORKING_DIR)), + m_cs(new CsLoader(CS_ENGINE_PATH, ENGINE_RO_RES_DIR, ENGINE_RW_WORKING_DIR)), + m_wp(new WpLoader(WP_ENGINE_PATH, ENGINE_RO_RES_DIR, ENGINE_RW_WORKING_DIR)), m_db(new Db::Manager(RW_DBSPACE "/.csr.db", RO_DBSPACE)), m_cslogic(*m_cs, *m_db), m_wplogic(*m_wp, *m_db), diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dd71f5d..2ee2f91 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,6 +16,10 @@ # @author Kyungwook Tak (k.tak@samsung.com) # @brief build test program of csr-framework # +####################### sample engine ######################### +ADD_SUBDIRECTORY(engine) +############################################################### + FIND_PACKAGE(Threads REQUIRED) ADD_DEFINITIONS("-DBOOST_TEST_DYN_LINK") ADD_DEFINITIONS("-DTEST_TARGET=\"${TEST_TARGET}\"") diff --git a/engine/CMakeLists.txt b/test/engine/CMakeLists.txt similarity index 100% rename from engine/CMakeLists.txt rename to test/engine/CMakeLists.txt diff --git a/engine/content-screening/CMakeLists.txt b/test/engine/content-screening/CMakeLists.txt similarity index 64% rename from engine/content-screening/CMakeLists.txt rename to test/engine/content-screening/CMakeLists.txt index b4dd826..0939cea 100644 --- a/engine/content-screening/CMakeLists.txt +++ b/test/engine/content-screening/CMakeLists.txt @@ -16,7 +16,7 @@ # @author Kyungwook Tak (k.tak@samsung.com) # @brief build sample engine of content screening # -PKG_CHECK_MODULES(${TARGET_CSR_CS_ENGINE_SAMPLE}_DEP +PKG_CHECK_MODULES(${TARGET_CSR_CS_ENGINE}_DEP REQUIRED ) @@ -24,23 +24,23 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/include/csr ${PROJECT_SOURCE_DIR}/src/include/csre . - ${${TARGET_CSR_CS_ENGINE_SAMPLE}_DEP_INCLUDE_DIRS} + ${${TARGET_CSR_CS_ENGINE}_DEP_INCLUDE_DIRS} ) -SET(${TARGET_CSR_CS_ENGINE_SAMPLE}_SRCS +SET(${TARGET_CSR_CS_ENGINE}_SRCS sample-engine.cpp ) -ADD_LIBRARY(${TARGET_CSR_CS_ENGINE_SAMPLE} SHARED ${${TARGET_CSR_CS_ENGINE_SAMPLE}_SRCS}) +ADD_LIBRARY(${TARGET_CSR_CS_ENGINE} SHARED ${${TARGET_CSR_CS_ENGINE}_SRCS}) -SET_TARGET_PROPERTIES(${TARGET_CSR_CS_ENGINE_SAMPLE} +SET_TARGET_PROPERTIES(${TARGET_CSR_CS_ENGINE} PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden" ) -TARGET_LINK_LIBRARIES(${TARGET_CSR_CS_ENGINE_SAMPLE} - ${${TARGET_CSR_CS_ENGINE_SAMPLE_DEP}_LIBRARIES} +TARGET_LINK_LIBRARIES(${TARGET_CSR_CS_ENGINE} + ${${TARGET_CSR_CS_ENGINE_DEP}_LIBRARIES} ) -INSTALL(TARGETS ${TARGET_CSR_CS_ENGINE_SAMPLE} DESTINATION ${SAMPLE_ENGINE_DIR}) -INSTALL(DIRECTORY resources/ DESTINATION ${SAMPLE_ENGINE_RW_WORKING_DIR}) +INSTALL(TARGETS ${TARGET_CSR_CS_ENGINE} DESTINATION ${ENGINE_DIR}) +INSTALL(DIRECTORY resources/ DESTINATION ${ENGINE_RW_WORKING_DIR}) diff --git a/engine/content-screening/resources/csret_cs_virus_signatures b/test/engine/content-screening/resources/csret_cs_virus_signatures similarity index 100% rename from engine/content-screening/resources/csret_cs_virus_signatures rename to test/engine/content-screening/resources/csret_cs_virus_signatures diff --git a/engine/web-protection/resources/vendor_logo.bmp b/test/engine/content-screening/resources/vendor_logo.bmp similarity index 100% rename from engine/web-protection/resources/vendor_logo.bmp rename to test/engine/content-screening/resources/vendor_logo.bmp diff --git a/engine/content-screening/sample-engine.cpp b/test/engine/content-screening/sample-engine.cpp similarity index 100% rename from engine/content-screening/sample-engine.cpp rename to test/engine/content-screening/sample-engine.cpp diff --git a/engine/web-protection/CMakeLists.txt b/test/engine/web-protection/CMakeLists.txt similarity index 64% rename from engine/web-protection/CMakeLists.txt rename to test/engine/web-protection/CMakeLists.txt index 37640b1..f833c2d 100644 --- a/engine/web-protection/CMakeLists.txt +++ b/test/engine/web-protection/CMakeLists.txt @@ -16,7 +16,7 @@ # @author Kyungwook Tak (k.tak@samsung.com) # @brief build sample engine of csr web protection # -PKG_CHECK_MODULES(${TARGET_CSR_WP_ENGINE_SAMPLE}_DEP +PKG_CHECK_MODULES(${TARGET_CSR_WP_ENGINE}_DEP REQUIRED ) @@ -24,23 +24,23 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/include/csr ${PROJECT_SOURCE_DIR}/src/include/csre . - ${${TARGET_CSR_WP_ENGINE_SAMPLE}_DEP_INCLUDE_DIRS} + ${${TARGET_CSR_WP_ENGINE}_DEP_INCLUDE_DIRS} ) -SET(${TARGET_CSR_WP_ENGINE_SAMPLE}_SRCS +SET(${TARGET_CSR_WP_ENGINE}_SRCS sample-engine.cpp ) -ADD_LIBRARY(${TARGET_CSR_WP_ENGINE_SAMPLE} SHARED ${${TARGET_CSR_WP_ENGINE_SAMPLE}_SRCS}) +ADD_LIBRARY(${TARGET_CSR_WP_ENGINE} SHARED ${${TARGET_CSR_WP_ENGINE}_SRCS}) -SET_TARGET_PROPERTIES(${TARGET_CSR_WP_ENGINE_SAMPLE} +SET_TARGET_PROPERTIES(${TARGET_CSR_WP_ENGINE} PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden" ) -TARGET_LINK_LIBRARIES(${TARGET_CSR_WP_ENGINE_SAMPLE} - ${${TARGET_CSR_WP_ENGINE_SAMPLE_DEP}_LIBRARIES} +TARGET_LINK_LIBRARIES(${TARGET_CSR_WP_ENGINE} + ${${TARGET_CSR_WP_ENGINE_DEP}_LIBRARIES} ) -INSTALL(TARGETS ${TARGET_CSR_WP_ENGINE_SAMPLE} DESTINATION ${SAMPLE_ENGINE_DIR}) -INSTALL(DIRECTORY resources/ DESTINATION ${SAMPLE_ENGINE_RW_WORKING_DIR}) +INSTALL(TARGETS ${TARGET_CSR_WP_ENGINE} DESTINATION ${ENGINE_DIR}) +INSTALL(DIRECTORY resources/ DESTINATION ${ENGINE_RW_WORKING_DIR}) diff --git a/engine/web-protection/resources/csret_wp_risky_urls b/test/engine/web-protection/resources/csret_wp_risky_urls similarity index 100% rename from engine/web-protection/resources/csret_wp_risky_urls rename to test/engine/web-protection/resources/csret_wp_risky_urls diff --git a/engine/content-screening/resources/vendor_logo.bmp b/test/engine/web-protection/resources/vendor_logo.bmp similarity index 100% rename from engine/content-screening/resources/vendor_logo.bmp rename to test/engine/web-protection/resources/vendor_logo.bmp diff --git a/engine/web-protection/sample-engine.cpp b/test/engine/web-protection/sample-engine.cpp similarity index 100% rename from engine/web-protection/sample-engine.cpp rename to test/engine/web-protection/sample-engine.cpp diff --git a/test/internals/CMakeLists.txt b/test/internals/CMakeLists.txt index d3ee64b..cd135ce 100644 --- a/test/internals/CMakeLists.txt +++ b/test/internals/CMakeLists.txt @@ -72,14 +72,14 @@ ADD_EXECUTABLE(${TARGET_CSR_INTERNAL_TEST} ${${TARGET_CSR_INTERNAL_TEST}_SRCS}) SET_TARGET_PROPERTIES(${TARGET_CSR_INTERNAL_TEST} PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fPIE" - LINK_FLAGS "-pie -Wl,-rpath,${SAMPLE_ENGINE_DIR}" + LINK_FLAGS "-pie -Wl,-rpath,${ENGINE_DIR}" ) TARGET_LINK_LIBRARIES(${TARGET_CSR_INTERNAL_TEST} ${TARGET_CSR_TEST_COMMON} ${TARGET_CSR_COMMON} - ${TARGET_CSR_CS_ENGINE_SAMPLE} - ${TARGET_CSR_WP_ENGINE_SAMPLE} + ${TARGET_CSR_CS_ENGINE} + ${TARGET_CSR_WP_ENGINE} ${${TARGET_CSR_INTERNAL_TEST}_DEP_LIBRARIES} -lboost_unit_test_framework -ldl diff --git a/test/internals/test-cs-loader.cpp b/test/internals/test-cs-loader.cpp index 263be57..e994116 100644 --- a/test/internals/test-cs-loader.cpp +++ b/test/internals/test-cs-loader.cpp @@ -95,9 +95,9 @@ struct Handle { template <> struct Handle { Handle() : - loader(SAMPLE_ENGINE_DIR "/libcsr-cs-engine.so", - SAMPLE_ENGINE_RO_RES_DIR, - SAMPLE_ENGINE_RW_WORKING_DIR) + loader(ENGINE_DIR "/libcsr-cs-engine.so", + ENGINE_RO_RES_DIR, + ENGINE_RW_WORKING_DIR) { ASSERT_IF(loader.contextCreate(context), CSRE_ERROR_NONE); } @@ -114,9 +114,9 @@ struct Handle { template <> struct Handle { Handle() : - loader(SAMPLE_ENGINE_DIR "/libcsr-cs-engine.so", - SAMPLE_ENGINE_RO_RES_DIR, - SAMPLE_ENGINE_RW_WORKING_DIR) + loader(ENGINE_DIR "/libcsr-cs-engine.so", + ENGINE_RO_RES_DIR, + ENGINE_RW_WORKING_DIR) { ASSERT_IF(loader.getEngineInfo(context), CSRE_ERROR_NONE); } diff --git a/test/internals/test-main.cpp b/test/internals/test-main.cpp index b78f8d2..1a26f1c 100644 --- a/test/internals/test-main.cpp +++ b/test/internals/test-main.cpp @@ -45,13 +45,13 @@ struct Initializer { { if (!isEngineInitialized) { int ret = csre_cs_global_initialize( - SAMPLE_ENGINE_RO_RES_DIR, SAMPLE_ENGINE_RW_WORKING_DIR); + ENGINE_RO_RES_DIR, ENGINE_RW_WORKING_DIR); if (ret != CSRE_ERROR_NONE) throw std::logic_error("Failed to init content screening engine."); ret = csre_wp_global_initialize( - SAMPLE_ENGINE_RO_RES_DIR, SAMPLE_ENGINE_RW_WORKING_DIR); + ENGINE_RO_RES_DIR, ENGINE_RW_WORKING_DIR); if (ret != CSRE_ERROR_NONE) throw std::logic_error("Failed to init web protection engine."); diff --git a/test/internals/test-wp-loader.cpp b/test/internals/test-wp-loader.cpp index b4d270b..41269c7 100755 --- a/test/internals/test-wp-loader.cpp +++ b/test/internals/test-wp-loader.cpp @@ -90,9 +90,9 @@ struct Handle { template <> struct Handle { Handle() : - loader(SAMPLE_ENGINE_DIR "/libcsr-wp-engine.so", - SAMPLE_ENGINE_RO_RES_DIR, - SAMPLE_ENGINE_RW_WORKING_DIR) + loader(ENGINE_DIR "/libcsr-wp-engine.so", + ENGINE_RO_RES_DIR, + ENGINE_RW_WORKING_DIR) { ASSERT_IF(loader.contextCreate(context), CSRE_ERROR_NONE); } @@ -109,9 +109,9 @@ struct Handle { template <> struct Handle { Handle() : - loader(SAMPLE_ENGINE_DIR "/libcsr-wp-engine.so", - SAMPLE_ENGINE_RO_RES_DIR, - SAMPLE_ENGINE_RW_WORKING_DIR) + loader(ENGINE_DIR "/libcsr-wp-engine.so", + ENGINE_RO_RES_DIR, + ENGINE_RW_WORKING_DIR) { ASSERT_IF(loader.getEngineInfo(context), CSRE_ERROR_NONE); } -- 2.7.4