diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 421df046a2..9e7cfdfda4 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -203,7 +203,6 @@ TEST_F(DrmSimpleTests, givenPrintIoctlTimesWhenCallIoctlThenStatisticsAreGathere struct DrmMock : public Drm { using Drm::ioctlStatistics; }; - ::testing::internal::CaptureStdout(); constexpr long long initialMin = std::numeric_limits::max(); constexpr long long initialMax = 0; @@ -289,6 +288,8 @@ TEST_F(DrmSimpleTests, givenPrintIoctlTimesWhenCallIoctlThenStatisticsAreGathere EXPECT_EQ(1u, destroyData->second.count); EXPECT_NE(0, destroyData->second.totalTime); + ::testing::internal::CaptureStdout(); + delete drm; std::string output = ::testing::internal::GetCapturedStdout();