Fix leaks in callSingleTestFunction (#1224)

The context and queue were not released when the test is not supported
in offline mode or the queue couldn't be created.

Inline test_missing_support_offline_cmpiler_ret macro, remove dead
parameter of check_functions_for_offline_compiler and slightly refactor
callSingleTestFunction to address leaks.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This commit is contained in:
Marco Antognini
2021-06-09 11:08:08 +01:00
committed by GitHub
parent 315998511a
commit 76ace61314
3 changed files with 17 additions and 28 deletions

View File

@@ -21,6 +21,7 @@
#include "errorHelpers.h"
#include "parseParameters.h"
#include "testHarness.h"
#include <CL/cl_half.h>
@@ -690,21 +691,19 @@ const char *subtests_to_skip_with_offline_compiler[] = {
"library_function"
};
int check_functions_for_offline_compiler(const char *subtestname,
cl_device_id device)
bool check_functions_for_offline_compiler(const char *subtestname)
{
if (gCompilationMode != kOnline)
{
size_t nNotRequiredWithOfflineCompiler =
sizeof(subtests_to_skip_with_offline_compiler) / sizeof(char *);
size_t i;
for (i = 0; i < nNotRequiredWithOfflineCompiler; ++i)
ARRAY_SIZE(subtests_to_skip_with_offline_compiler);
for (size_t i = 0; i < nNotRequiredWithOfflineCompiler; ++i)
{
if (!strcmp(subtestname, subtests_to_skip_with_offline_compiler[i]))
{
return 1;
return false;
}
}
}
return 0;
}
return true;
}