Merge "BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros" am: 7d6b36cdd7

Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/2005330

Change-Id: I077a71c7a419f60ad13de6e8200906d25c83f55f
diff --git a/common/native/bpf_headers/include/bpf/BpfUtils.h b/common/native/bpf_headers/include/bpf/BpfUtils.h
index 265d4b6..8f1b9a2 100644
--- a/common/native/bpf_headers/include/bpf/BpfUtils.h
+++ b/common/native/bpf_headers/include/bpf/BpfUtils.h
@@ -112,38 +112,28 @@
     return kernelVersion() >= KVER(major, minor, sub);
 }
 
-#define SKIP_IF_BPF_SUPPORTED                                                    \
-    do {                                                                         \
-        if (android::bpf::isAtLeastKernelVersion(4, 9, 0)) {                     \
-            GTEST_LOG_(INFO) << "This test is skipped since bpf is supported\n"; \
-            return;                                                              \
-        }                                                                        \
+#define SKIP_IF_BPF_SUPPORTED                              \
+    do {                                                   \
+        if (android::bpf::isAtLeastKernelVersion(4, 9, 0)) \
+            GTEST_SKIP() << "Skip: bpf is supported.";     \
     } while (0)
 
-#define SKIP_IF_BPF_NOT_SUPPORTED                                                    \
-    do {                                                                             \
-        if (!android::bpf::isAtLeastKernelVersion(4, 9, 0)) {                        \
-            GTEST_LOG_(INFO) << "This test is skipped since bpf is not supported\n"; \
-            return;                                                                  \
-        }                                                                            \
+#define SKIP_IF_BPF_NOT_SUPPORTED                           \
+    do {                                                    \
+        if (!android::bpf::isAtLeastKernelVersion(4, 9, 0)) \
+            GTEST_SKIP() << "Skip: bpf is not supported.";  \
     } while (0)
 
-#define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED                                        \
-    do {                                                                          \
-        if (!android::bpf::isAtLeastKernelVersion(4, 14, 0)) {                    \
-            GTEST_LOG_(INFO) << "This test is skipped since extended bpf feature" \
-                             << "not supported\n";                                \
-            return;                                                               \
-        }                                                                         \
+#define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED                               \
+    do {                                                                 \
+        if (!android::bpf::isAtLeastKernelVersion(4, 14, 0))             \
+            GTEST_SKIP() << "Skip: extended bpf feature not supported."; \
     } while (0)
 
-#define SKIP_IF_XDP_NOT_SUPPORTED                                \
-    do {                                                         \
-        if (!android::bpf::isAtLeastKernelVersion(5, 9, 0)) {    \
-            GTEST_LOG_(INFO) << "This test is skipped since xdp" \
-                             << "not supported\n";               \
-            return;                                              \
-        }                                                        \
+#define SKIP_IF_XDP_NOT_SUPPORTED                           \
+    do {                                                    \
+        if (!android::bpf::isAtLeastKernelVersion(5, 9, 0)) \
+            GTEST_SKIP() << "Skip: xdp not supported.";     \
     } while (0)
 
 }  // namespace bpf