From 3320f7c7224e051b4a30a74e0a683159ed8b9dea Mon Sep 17 00:00:00 2001 From: YohanPipereau Date: Fri, 5 Apr 2019 20:14:09 +0200 Subject: Modify build system -Clean Makefile -Fix errors in scvpp length copies -Add testing when building scvpp Change-Id: I5a331386a1812b147dfec26310dfbd3aed327dae Signed-off-by: YohanPipereau --- src/scvpp/src/interface.c | 4 +++- src/scvpp/tests/CMakeLists.txt | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/scvpp') diff --git a/src/scvpp/src/interface.c b/src/scvpp/src/interface.c index 53cea1c..8f3b30b 100644 --- a/src/scvpp/src/interface.c +++ b/src/scvpp/src/interface.c @@ -20,6 +20,8 @@ #include #include +#define IFACE_SUBSTR 49 + // Use VAPI macros to define symbols DEFINE_VAPI_MSG_IDS_INTERFACE_API_JSON @@ -53,7 +55,7 @@ bin_api_sw_interface_dump(vapi_payload_sw_interface_details *details, /* Dump a specific interfaces */ mp->payload.name_filter_valid = true; - strncpy((char *)mp->payload.name_filter, iface_name, VPP_INTFC_NAME_LEN); + strncpy((char *)mp->payload.name_filter, iface_name, IFACE_SUBSTR); VAPI_CALL(vapi_sw_interface_dump(g_vapi_ctx, mp, sw_interface_dump_cb, details)); diff --git a/src/scvpp/tests/CMakeLists.txt b/src/scvpp/tests/CMakeLists.txt index 2b6de4a..19b7f7b 100644 --- a/src/scvpp/tests/CMakeLists.txt +++ b/src/scvpp/tests/CMakeLists.txt @@ -29,12 +29,12 @@ set(TEST_SRC add_executable(scvpp_test ${TEST_SRC}) target_link_libraries(scvpp_test ${CMOCKA_LIBRARIES} scvpp_a) target_include_directories(scvpp_test PRIVATE ../inc) -add_test(scvpp_test scvpp_test) +add_test(scvpp_test ./scvpp_test) if(valgrind_FOUND) - add_test(${TEST_NAME}_valgrind valgrind + add_test(scvpp_valgrind valgrind --error-exitcode=1 --read-var-info=yes --leak-check=full --show-leak-kinds=all - ./${TEST_NAME} + ./scvpp_test ) endif(valgrind_FOUND) -- cgit 1.2.3-korg