Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always test with address sanitizer a few base classes #13256

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Framework/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,17 @@ o2_target_root_dictionary(Framework
include/Framework/StepTHn.h
LINKDEF test/FrameworkCoreTestLinkDef.h)

add_executable(o2-test-framework-core-sanitized
test/test_Variants.cxx
src/Array2D.cxx
src/Variant.cxx
)

target_link_libraries(o2-test-framework-core-sanitized PRIVATE O2::Catch2 O2::FrameworkFoundation Boost::boost RapidJSON::RapidJSON)
target_include_directories(o2-test-framework-core-sanitized PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include O2::FrameworkFoundation)
target_compile_options(o2-test-framework-core-sanitized PRIVATE -fsanitize=address)
target_link_options(o2-test-framework-core-sanitized PRIVATE -fsanitize=address)

add_executable(o2-test-framework-core
test/test_AlgorithmSpec.cxx
test/test_AnalysisTask.cxx
Expand Down Expand Up @@ -251,8 +262,10 @@ target_link_libraries(o2-test-framework-core PRIVATE O2::Catch2)

get_filename_component(outdir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../tests ABSOLUTE)
set_property(TARGET o2-test-framework-core PROPERTY RUNTIME_OUTPUT_DIRECTORY ${outdir})
set_property(TARGET o2-test-framework-core-sanitized PROPERTY RUNTIME_OUTPUT_DIRECTORY ${outdir})

add_test(NAME framework:core COMMAND o2-test-framework-core --skip-benchmarks)
add_test(NAME framework:sanitized COMMAND o2-test-framework-core-sanitized --skip-benchmarks)

o2_add_test(AlgorithmWrapper NAME test_Framework_test_AlgorithmWrapper
SOURCES test/test_AlgorithmWrapper.cxx
Expand Down
5 changes: 1 addition & 4 deletions Framework/Core/src/Variant.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,7 @@ Variant::~Variant()
case variant_trait_v<float*>:
case variant_trait_v<double*>:
case variant_trait_v<bool*>:
case variant_trait_v<std::string*>:
if (reinterpret_cast<void**>(&mStore) != nullptr) {
free(*reinterpret_cast<void**>(&mStore));
}
free(*reinterpret_cast<void**>(&mStore));
return;
default:
return;
Expand Down
Loading