Skip TestGpuNnapi if AHardwareBuffer allocation fails am: e6a5fc57bb am: 2426493071 am: 6e92bd201c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/NeuralNetworks/+/15900876

Change-Id: I6b961a0aa314a3335dc9905762cd2619abbe4c61
diff --git a/runtime/test/TestGpuNnapi.cpp b/runtime/test/TestGpuNnapi.cpp
index 61809c4..333d867 100644
--- a/runtime/test/TestGpuNnapi.cpp
+++ b/runtime/test/TestGpuNnapi.cpp
@@ -236,7 +236,9 @@
             .format = AHARDWAREBUFFER_FORMAT_BLOB,
             .usage = usage,
     };
-    ASSERT_EQ(AHardwareBuffer_allocate(&desc, outAhwb), 0);
+    if (AHardwareBuffer_allocate(&desc, outAhwb) != 0) {
+        GTEST_SKIP() << "Device failed to allocate Android hardware buffer";
+    }
 }
 
 using NameAndDevice = std::pair<const char*, const ANeuralNetworksDevice*>;