SWDEV-485763 - Fix memory leaks in various unit tests

Fix memory leaks by adding missing destroy calls for
events, streams, and graphs at the end of tests.

Ensure that every test case executes destroy calls,
regardless of whether it passes or fails.

Change-Id: I814e35c528d90ed2abb34d77377f1a7fd3f1f11c


[ROCm/hip-tests commit: 9cffda4ebb]
Tento commit je obsažen v:
Marko Arandjelovic
2024-09-20 18:04:35 +02:00
rodič d9482cf69c
revize fe9860bd47
33 změnil soubory, kde provedl 142 přidání a 38 odebrání
+3 -1
Zobrazit soubor
@@ -149,6 +149,7 @@ void validateStreamCaptureInfo(hipStream_t mstream) {
HIP_CHECK(hipStreamSynchronize(streamForLaunch));
HIP_CHECK(hipGraphExecDestroy(graphExec));
HIP_CHECK(hipGraphDestroy(graph));
HIP_CHECK(hipStreamDestroy(streamForLaunch));
HIP_CHECK(hipStreamDestroy(stream1));
@@ -610,6 +611,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_Nullstream_CaptureInfo") {
REQUIRE(C_h[i] == D_h[i]);
}
HIP_CHECK(hipGraphExecDestroy(graphExec));
HIP_CHECK(hipGraphDestroy(graph));
HIP_CHECK(hipStreamDestroy(stream));
HIP_CHECK(hipStreamDestroy(streamForGraph));
@@ -618,4 +620,4 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_Nullstream_CaptureInfo") {
free(A_h);
free(C_h);
free(D_h);
}
}