SWDEV-411064 - check if image is supported before running image specific tests
Change-Id: I62b3f7489f2f33b4b4e02f42a46e66c8940f2277
This commit is contained in:
committed by
Jatin Jaikishan Chaudhary
parent
b6b43db172
commit
ee3c94faf2
@@ -18,6 +18,8 @@ THE SOFTWARE.
|
||||
*/
|
||||
#include <hip_test_common.hh>
|
||||
TEST_CASE("Unit_hipArray_Valid") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
hipArray* array = nullptr;
|
||||
HIP_ARRAY_DESCRIPTOR desc;
|
||||
desc.Format = HIP_AD_FORMAT_FLOAT;
|
||||
@@ -27,17 +29,24 @@ TEST_CASE("Unit_hipArray_Valid") {
|
||||
HIP_CHECK(hipArrayCreate(&array, &desc));
|
||||
HIP_CHECK(hipFreeArray(array));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipArray_Invalid") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
void* data = malloc(sizeof(char));
|
||||
hipArray_t arrayPtr = static_cast<hipArray*>(data);
|
||||
REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed);
|
||||
free(data);
|
||||
}
|
||||
TEST_CASE("Unit_hipArray_Nullptr") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
hipArray* array = nullptr;
|
||||
REQUIRE(hipFreeArray(array) == hipErrorInvalidValue);
|
||||
}
|
||||
TEST_CASE("Unit_hipArray_DoubleFree") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
hipArray* array = nullptr;
|
||||
HIP_ARRAY_DESCRIPTOR desc;
|
||||
desc.Format = HIP_AD_FORMAT_FLOAT;
|
||||
@@ -49,6 +58,8 @@ TEST_CASE("Unit_hipArray_DoubleFree") {
|
||||
REQUIRE(hipFreeArray(array) == hipErrorContextIsDestroyed);
|
||||
}
|
||||
TEST_CASE("Unit_hipArray_TrippleDestroy") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
hipArray* array = nullptr;
|
||||
HIP_ARRAY_DESCRIPTOR desc;
|
||||
desc.Format = HIP_AD_FORMAT_FLOAT;
|
||||
@@ -61,11 +72,15 @@ TEST_CASE("Unit_hipArray_TrippleDestroy") {
|
||||
REQUIRE(hipArrayDestroy(array) == hipErrorContextIsDestroyed);
|
||||
}
|
||||
TEST_CASE("Unit_hipArray_DoubleNullptr") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
hipArray* array = nullptr;
|
||||
REQUIRE(hipFreeArray(array) == hipErrorInvalidValue);
|
||||
REQUIRE(hipFreeArray(array) == hipErrorInvalidValue);
|
||||
}
|
||||
TEST_CASE("Unit_hipArray_DoubleInvalid") {
|
||||
CHECK_IMAGE_SUPPORT
|
||||
|
||||
void* data = malloc(sizeof(char));
|
||||
hipArray_t arrayPtr = static_cast<hipArray*>(data);
|
||||
REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed);
|
||||
|
||||
Reference in New Issue
Block a user