Test for stack use after free in ASAN. (#3552)

Fix two cases that didn't affect the product, but did affect our ability to test.
This commit is contained in:
Scott Smith 2021-11-15 16:44:39 -08:00 committed by GitHub
parent c18204325c
commit 7011be6f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View File

@ -56,7 +56,7 @@ jobs:
- name: Run Tests
working-directory: ./unit_tests/
run: build/rusefi_test
run: ASAN_OPTIONS=detect_stack_use_after_return=1 build/rusefi_test
- name: Install Coverage Tools
if: ${{ matrix.os != 'macos-latest' }}

View File

@ -82,7 +82,7 @@ jobs:
- name: Run Tests
working-directory: ./unit_tests/
run: build/rusefi_test
run: ASAN_OPTIONS=detect_stack_use_after_return=1 build/rusefi_test
# Commit changes and catch the error that occurs if nothing has been changed (without catching other errors)
- name: Commit fresh triggers.txt

View File

@ -6,14 +6,15 @@ static constexpr engine_type_e ENGINE_TEST_HELPER = TEST_ENGINE;
class TurbochargerSpeedConverterTest : public ::testing::Test {
public:
EngineTestHelper eth;
TurbochargerSpeedConverter dut;
TurbochargerSpeedConverterTest(){
TurbochargerSpeedConverterTest()
: eth(ENGINE_TEST_HELPER, std::unordered_map<SensorType, float>{}) {
}
void SetUp() override {
WITH_ENGINE_TEST_HELPER(ENGINE_TEST_HELPER);
EXPAND_EngineTestHelper;
dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE);
}

View File

@ -6,14 +6,15 @@ static constexpr engine_type_e ENGINE_TEST_HELPER = TEST_ENGINE;
class VehicleSpeedConverterTest : public ::testing::Test {
public:
EngineTestHelper eth;
VehicleSpeedConverter dut;
VehicleSpeedConverterTest(){
VehicleSpeedConverterTest()
: eth(ENGINE_TEST_HELPER, std::unordered_map<SensorType, float>{}) {
}
void SetUp() override {
WITH_ENGINE_TEST_HELPER(ENGINE_TEST_HELPER);
EXPAND_EngineTestHelper;
dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE);
}