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:
parent
c18204325c
commit
7011be6f86
|
@ -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' }}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -72,4 +73,4 @@ TEST_F(TurbochargerSpeedConverterTest, zeroCoefReturnsZeroSpeedOnAnyInput) {
|
|||
ASSERT_TRUE(result.Valid);
|
||||
ASSERT_FLOAT_EQ(0.0f, result.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -72,4 +73,4 @@ TEST_F(VehicleSpeedConverterTest, zeroCoefReturnsZeroSpeedOnAnyInput) {
|
|||
ASSERT_TRUE(result.Valid);
|
||||
ASSERT_FLOAT_EQ(0.0f, result.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue