From 1dadc9a592189653a5e16952519e66b5e91af215 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sun, 5 Nov 2023 10:39:24 +0100 Subject: [PATCH 1/3] Fix legacy tests --- tests/root_io/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/root_io/CMakeLists.txt b/tests/root_io/CMakeLists.txt index 598046e3a..e719e583f 100644 --- a/tests/root_io/CMakeLists.txt +++ b/tests/root_io/CMakeLists.txt @@ -59,8 +59,7 @@ target_link_libraries(read-legacy-files-root PRIVATE TestDataModel TestDataModel macro(ADD_PODIO_LEGACY_TEST version base_test input_file) ExternalData_Add_Test(legacy_test_cases NAME ${base_test}_${version} - COMMAND ${base_test} ${CMAKE_CURRENT_BINARY_DIR}/../input_files/${input_file} - DATA{${PROJECT_SOURCE_DIR}/tests/input_files/${input_file}} + COMMAND ${base_test} DATA{${PROJECT_SOURCE_DIR}/tests/input_files/${input_file}} ) set_property(TEST ${base_test}_${version} PROPERTY ENVIRONMENT LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/tests:${PROJECT_BINARY_DIR}/src:$ENV{LD_LIBRARY_PATH} From d2a8419736088708f9eea31729846464f65fe7b7 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 6 Nov 2023 13:49:34 +0100 Subject: [PATCH 2/3] Add a check for argc > 2 --- tests/root_io/read_frame_root.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/root_io/read_frame_root.cpp b/tests/root_io/read_frame_root.cpp index b687fa83e..2076a5a96 100644 --- a/tests/root_io/read_frame_root.cpp +++ b/tests/root_io/read_frame_root.cpp @@ -13,6 +13,11 @@ int main(int argc, char* argv[]) { inputFile = argv[1]; assertBuildVersion = false; } + else if (argc > 2) { + std::cout << "Wrong number of arguments" << std::endl; + std::cout << "Usage: " << argv[0] << " FILE" << std::endl; + return 1; + } return read_frames(inputFile, assertBuildVersion) + test_frame_aux_info(inputFile); From 4099f1876ddd44b100e36e976541d49015cbc0af Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 6 Nov 2023 13:50:10 +0100 Subject: [PATCH 3/3] Fix clang-format --- tests/root_io/read_frame_root.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/root_io/read_frame_root.cpp b/tests/root_io/read_frame_root.cpp index 2076a5a96..2e7f466de 100644 --- a/tests/root_io/read_frame_root.cpp +++ b/tests/root_io/read_frame_root.cpp @@ -12,8 +12,7 @@ int main(int argc, char* argv[]) { if (argc == 2) { inputFile = argv[1]; assertBuildVersion = false; - } - else if (argc > 2) { + } else if (argc > 2) { std::cout << "Wrong number of arguments" << std::endl; std::cout << "Usage: " << argv[0] << " FILE" << std::endl; return 1;