diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index 9ebdc6e..e5000e3 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -113,6 +113,14 @@
         }                                                                                         \
     })
 
+#define SKIP_TEST_IF_VERSION_UNSUPPORTED(effect, minVersion)               \
+    ({                                                                     \
+        if (int version = getHalVersion(effect); version < (minVersion)) { \
+            GTEST_SKIP() << "Skipping for HAL version: " << version        \
+                         << ", minimal version: " << (minVersion) << "\n"; \
+        }                                                                  \
+    })
+
 // Test that the transaction status 'isOk' if it is a known transaction
 #define EXPECT_IS_OK_OR_UNKNOWN_TRANSACTION(ret)                                                 \
     EXPECT_PRED_FORMAT1(                                                                         \
diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
index c3c1e9e..2d2c033 100644
--- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
@@ -167,10 +167,7 @@
     void SetUp() override {
         SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
         ASSERT_NO_FATAL_FAILURE(SetUpBassBoost(mChannelLayout));
-        if (int32_t version;
-            mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
-            GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
-        }
+        SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
     }
 
     void TearDown() override {
diff --git a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
index 720a040..ed87f78 100644
--- a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
@@ -217,10 +217,7 @@
     void SetUp() override {
         SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
         ASSERT_NO_FATAL_FAILURE(SetUpDownmix(mInputChannelLayout));
-        if (int32_t version;
-            mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
-            GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
-        }
+        SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
         if (!isLayoutValid(mInputChannelLayout)) {
             GTEST_SKIP() << "Layout not supported \n";
         }
@@ -372,10 +369,7 @@
 
     void SetUp() override {
         ASSERT_NO_FATAL_FAILURE(SetUpDownmix(mInputChannelLayout));
-        if (int32_t version;
-            mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
-            GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
-        }
+        SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
         if (!isLayoutValid(mInputChannelLayout)) {
             GTEST_SKIP() << "Layout not supported \n";
         }
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 98f7d79..8f98959 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -127,6 +127,7 @@
     void checkInputAndOutputEquality(const std::vector<float>& outputMag);
 
     void setUpDataTest(const std::vector<int>& testFrequencies, float fullScaleSineDb);
+    void tearDownDataTest();
 
     void createChannelConfig();
 
@@ -141,8 +142,6 @@
     void addLimiterConfig(const std::vector<DynamicsProcessing::LimiterConfig>& cfg);
     void addInputGain(const std::vector<DynamicsProcessing::InputGain>& inputGain);
 
-    void checkHalVersion();
-
     static constexpr float kPreferredProcessingDurationMs = 10.0f;
     static constexpr int kBandCount = 5;
     static constexpr int kSamplingFrequency = 44100;
@@ -465,6 +464,8 @@
                                                  float fullScaleSineDb) {
     ASSERT_NO_FATAL_FAILURE(SetUpDynamicsProcessingEffect());
     SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+    SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
+
     mInput.resize(kFrameCount * mChannelCount);
     ASSERT_NO_FATAL_FAILURE(
             generateSineWave(testFrequencies, mInput, 1.0, kSamplingFrequency, mChannelLayout));
@@ -472,6 +473,10 @@
     ASSERT_NEAR(mInputDb, fullScaleSineDb, kToleranceDb);
 }
 
+void DynamicsProcessingTestHelper::tearDownDataTest() {
+    ASSERT_NO_FATAL_FAILURE(TearDownDynamicsProcessingEffect());
+}
+
 void DynamicsProcessingTestHelper::createChannelConfig() {
     for (int i = 0; i < mChannelCount; i++) {
         mChannelConfig.push_back(DynamicsProcessing::ChannelConfig(i, true));
@@ -553,13 +558,6 @@
     mTags.push_back({DynamicsProcessing::inputGain, dp});
 }
 
-void DynamicsProcessingTestHelper::checkHalVersion() {
-    if (int32_t version;
-        mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
-        GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
-    }
-}
-
 void fillLimiterConfig(std::vector<DynamicsProcessing::LimiterConfig>& limiterConfigList,
                        int channelIndex, bool enable, int linkGroup, float attackTime,
                        float releaseTime, float ratio, float threshold, float postGain) {
@@ -729,7 +727,7 @@
         ASSERT_NO_FATAL_FAILURE(setUpDataTest({kInputFrequency}, kSineFullScaleDb));
     }
 
-    void TearDown() override { TearDownDynamicsProcessingEffect(); }
+    void TearDown() override { ASSERT_NO_FATAL_FAILURE(tearDownDataTest()); }
 
     void cleanUpInputGainConfig() {
         CleanUp();
@@ -857,7 +855,7 @@
         ASSERT_NO_FATAL_FAILURE(setUpDataTest({kInputFrequency}, kSineFullScaleDb));
     }
 
-    void TearDown() override { TearDownDynamicsProcessingEffect(); }
+    void TearDown() override { ASSERT_NO_FATAL_FAILURE(tearDownDataTest()); }
 
     void computeThreshold(float ratio, float outputDb, float& threshold) {
         EXPECT_NE(ratio, 0);
@@ -1233,6 +1231,8 @@
 }
 
 TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
+    SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
+
     mEngineConfigPreset.postEqStage.bandCount = mCfgs.size();
     addEngineConfig(mEngineConfigPreset);
     std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -1330,7 +1330,7 @@
                 setUpDataTest(mMultitoneTestFrequencies, kSineMultitoneFullScaleDb));
     }
 
-    void TearDown() override { TearDownDynamicsProcessingEffect(); }
+    void TearDown() override { ASSERT_NO_FATAL_FAILURE(tearDownDataTest()); }
 
     void addEqParam(bool isPreEq) {
         createChannelConfig();
@@ -1558,7 +1558,7 @@
                 setUpDataTest(mMultitoneTestFrequencies, kSineMultitoneFullScaleDb));
     }
 
-    void TearDown() override { TearDownDynamicsProcessingEffect(); }
+    void TearDown() override { ASSERT_NO_FATAL_FAILURE(tearDownDataTest()); }
 
     void setMbcParamsAndProcess(std::vector<float>& output) {
         createChannelConfig();
diff --git a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
index 1b0b681..25d3a02 100644
--- a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
@@ -298,10 +298,7 @@
 
     void SetUp() override {
         ASSERT_NO_FATAL_FAILURE(SetUpHapticGenerator(mChMask));
-        if (int32_t version;
-            mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
-            GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
-        }
+        SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
     }
 
     void TearDown() override { ASSERT_NO_FATAL_FAILURE(TearDownHapticGenerator()); }
