Skip to content

Commit

Permalink
fix test bsc compile err
Browse files Browse the repository at this point in the history
  • Loading branch information
stargieg committed Oct 26, 2024
1 parent 435c0b2 commit 268bccd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
3 changes: 3 additions & 0 deletions test/bacnet/datalink/bsc-socket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
${SRC_DIR}/bacnet/npdu.c
${SRC_DIR}/bacnet/proplist.c
${SRC_DIR}/bacnet/special_event.c
${SRC_DIR}/bacnet/channel_value.c
${SRC_DIR}/bacnet/secure_connect.c
${SRC_DIR}/bacnet/timestamp.c
${SRC_DIR}/bacnet/weeklyschedule.c
Expand Down Expand Up @@ -154,6 +155,7 @@ elseif(WIN32)
${SRC_DIR}/bacnet/npdu.c
${SRC_DIR}/bacnet/proplist.c
${SRC_DIR}/bacnet/special_event.c
${SRC_DIR}/bacnet/channel_value.c
${SRC_DIR}/bacnet/secure_connect.c
${SRC_DIR}/bacnet/timestamp.c
${SRC_DIR}/bacnet/weeklyschedule.c
Expand Down Expand Up @@ -245,6 +247,7 @@ elseif(APPLE)
${SRC_DIR}/bacnet/npdu.c
${SRC_DIR}/bacnet/proplist.c
${SRC_DIR}/bacnet/special_event.c
${SRC_DIR}/bacnet/channel_value.c
${SRC_DIR}/bacnet/secure_connect.c
${SRC_DIR}/bacnet/timestamp.c
${SRC_DIR}/bacnet/weeklyschedule.c
Expand Down
19 changes: 14 additions & 5 deletions test/bacnet/datalink/hub-sc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ if(ZEPHYR_BASE)
message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "BACNet/SC hub function test: building for linux")
target_compile_options(${PROJECT_NAME} PRIVATE
-Wno-language-extension-token
)
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux)
add_compile_definitions(BACNET_PORT=linux)
find_package(libwebsockets CONFIG REQUIRED)
Expand Down Expand Up @@ -104,9 +107,12 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
${ZTST_DIR}/ztest_mock.c
${ZTST_DIR}/ztest.c
)
target_link_libraries(${PROJECT_NAME}
${LIBWEBSOCKETS_LIBRARIES}
)
target_link_libraries(${PROJECT_NAME}
${LIBWEBSOCKETS_LIBRARIES}
)
target_compile_options(${PROJECT_NAME} PRIVATE
-Wno-language-extension-token
)
elseif(WIN32)
message(STATUS "BACNet/SC hub function test: building for win32")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32)
Expand Down Expand Up @@ -266,6 +272,9 @@ elseif(APPLE)
${ZTST_DIR}/ztest.c
)
target_link_libraries(${PROJECT_NAME}
${LIBWEBSOCKETS_LIBRARIES}
)
${LIBWEBSOCKETS_LIBRARIES}
)
target_compile_options(${PROJECT_NAME} PRIVATE
-Wno-language-extension-token
)
endif()
5 changes: 3 additions & 2 deletions test/bacnet/datalink/hub-sc/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,7 @@ static void hub_connector_event(BSC_HUB_CONNECTOR_EVENT ev,
size_t pdu_len,
BVLC_SC_DECODED_MESSAGE *decoded_pdu)
{
(void) decoded_pdu;
bws_dispatch_lock();
debug_printf("hub_connector_event() ev = %p, ev->e = %p, ev->ev = %d, h = "
"%p, user_arg = %p, pdu = "
Expand Down Expand Up @@ -1619,10 +1620,10 @@ static void test_hub_connector_url(bool primary)
zassert_equal(bsc_hub_connector_stopped(hubc_h), false, 0);
if (primary) {
zassert_equal(
bsc_hub_connector_state(hubc_h), BACNET_CONNECTED_TO_PRIMARY, 0);
bsc_hub_connector_state(hubc_h), BACNET_SC_HUB_CONNECTOR_STATE_CONNECTED_TO_PRIMARY, 0);
} else {
zassert_equal(
bsc_hub_connector_state(hubc_h), BACNET_CONNECTED_TO_FAILOVER, 0);
bsc_hub_connector_state(hubc_h), BACNET_SC_HUB_CONNECTOR_STATE_CONNECTED_TO_FAILOVER, 0);
}
bsc_hub_connector_stop(hubc_h);
zassert_equal(wait_hubc_ev(&hubc, BSC_HUBC_EVENT_STOPPED, hubc_h), true, 0);
Expand Down
5 changes: 4 additions & 1 deletion test/bacnet/datalink/websockets/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,8 @@ static void cli_event(BSC_WEBSOCKET_HANDLE h,
{
test_ctx_t *ctx = (test_ctx_t *)user_param;
BSC_WEBSOCKET_RET ret;

(void) ws_reason;
(void) ws_reason_desc;
if (ev == BSC_WEBSOCKET_CONNECTED) {
ctx->ev = BSC_WEBSOCKET_CONNECTED;
} else if (ev == BSC_WEBSOCKET_SENDABLE) {
Expand Down Expand Up @@ -1347,6 +1348,8 @@ static void srv_event(BSC_WEBSOCKET_SRV_HANDLE sh,
{
test_ctx_t *ctx = (test_ctx_t *)user_param;
BSC_WEBSOCKET_RET ret;
(void) ws_reason;
(void) ws_reason_desc;

if (ev == BSC_WEBSOCKET_SERVER_STARTED) {
ctx->ev = BSC_WEBSOCKET_SERVER_STARTED;
Expand Down

0 comments on commit 268bccd

Please sign in to comment.