Test AOM_VALGRIND_BUILD with #ifdef or defined()

Fix -Wundef warnings. The AOM_VALGRIND_BUILD macro is not defined in
aom/aom_config.h, so it should be tested with #ifdef or defined().

See https://aomedia-review.googlesource.com/c/aom/+/137841 and
https://aomedia-review.googlesource.com/c/aom/+/137861.

Bug: aomedia:356830476
Change-Id: Ia4e2a9fe1d436fcf9ec4cec3fa65e7207f861a54
diff --git a/test/ethread_test.cc b/test/ethread_test.cc
index da3be3f..552ea18 100644
--- a/test/ethread_test.cc
+++ b/test/ethread_test.cc
@@ -470,7 +470,7 @@
 
 // The AVxEncoderThreadTestLarge takes up ~14% of total run-time of the
 // Valgrind long tests. Exclude it; the smaller tests are still run.
-#if !AOM_VALGRIND_BUILD
+#if !defined(AOM_VALGRIND_BUILD)
 class AVxEncoderThreadTestLarge : public AVxEncoderThreadTest {};
 
 TEST_P(AVxEncoderThreadTestLarge, EncoderResultTest) {
@@ -486,7 +486,7 @@
                            ::testing::Values(0, 1, 3, 5),
                            ::testing::Values(1, 6), ::testing::Values(1, 6),
                            ::testing::Values(0, 1));
-#endif  // !AOM_VALGRIND_BUILD
+#endif  // !defined(AOM_VALGRIND_BUILD)
 
 TEST_P(AVxEncoderThreadTest, EncoderResultTest) {
   cfg_.large_scale_tile = 0;
@@ -570,7 +570,7 @@
 // AVxEncoderThreadLSTestLarge takes up about 2% of total run-time of
 // the Valgrind long tests. Since we already run AVxEncoderThreadLSTest,
 // skip this one for Valgrind.
-#if !CONFIG_REALTIME_ONLY && !AOM_VALGRIND_BUILD
+#if !CONFIG_REALTIME_ONLY && !defined(AOM_VALGRIND_BUILD)
 class AVxEncoderThreadLSTestLarge : public AVxEncoderThreadLSTest {};
 
 TEST_P(AVxEncoderThreadLSTestLarge, EncoderResultTest) {
@@ -585,5 +585,5 @@
                                              ::libaom_test::kOnePassGood),
                            ::testing::Values(1, 3), ::testing::Values(0, 6),
                            ::testing::Values(0, 6), ::testing::Values(1));
-#endif  // !CONFIG_REALTIME_ONLY && !AOM_VALGRIND_BUILD
+#endif  // !CONFIG_REALTIME_ONLY && !defined(AOM_VALGRIND_BUILD)
 }  // namespace
diff --git a/test/kf_test.cc b/test/kf_test.cc
index 14fc064..0ae3c64 100644
--- a/test/kf_test.cc
+++ b/test/kf_test.cc
@@ -190,7 +190,7 @@
 // Because valgrind builds take a very long time to run, use a lower
 // resolution video for valgrind runs.
 const char *TestFileName() {
-#if AOM_VALGRIND_BUILD
+#ifdef AOM_VALGRIND_BUILD
   return "hantro_collage_w176h144.yuv";
 #else
   return "hantro_collage_w352h288.yuv";
@@ -198,7 +198,7 @@
 }
 
 int TestFileWidth() {
-#if AOM_VALGRIND_BUILD
+#ifdef AOM_VALGRIND_BUILD
   return 176;
 #else
   return 352;
@@ -206,7 +206,7 @@
 }
 
 int TestFileHeight() {
-#if AOM_VALGRIND_BUILD
+#ifdef AOM_VALGRIND_BUILD
   return 144;
 #else
   return 288;