tests: Adjust expectations in accordance with -DNDEBUG

If assertions are disabled then `EXPECT_DEATH()` will fail. Guard
`EXPECT_DEATH()` calls with an NDEBUG test, and substitute an
appropriate test when it's defined.

Change-Id: I60541762aceb656c2eff03a438f314197b281f77
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/tests/libpldm_bios_table_test.cpp b/tests/libpldm_bios_table_test.cpp
index 54173b6..95a9310 100644
--- a/tests/libpldm_bios_table_test.cpp
+++ b/tests/libpldm_bios_table_test.cpp
@@ -876,9 +876,15 @@
     auto firstEntry =
         reinterpret_cast<struct pldm_bios_attr_val_table_entry*>(table.data());
     firstEntry->attr_type = PLDM_BIOS_PASSWORD;
+#ifdef NDEBUG
+    EXPECT_EQ(pldm_bios_table_attr_value_find_by_handle(table.data(),
+                                                        table.size(), 1),
+              nullptr);
+#else
     EXPECT_DEATH(pldm_bios_table_attr_value_find_by_handle(table.data(),
                                                            table.size(), 1),
                  "entry_length != NULL");
+#endif
 }
 
 TEST(AttrValTable, CopyAndUpdateTest)
@@ -1131,7 +1137,9 @@
     auto iter = pldm_bios_table_iter_create(table.data(), table.size(),
                                             PLDM_BIOS_ATTR_TABLE);
     attr_entry->attr_type = PLDM_BIOS_PASSWORD;
+#ifndef NDEBUG
     EXPECT_DEATH(pldm_bios_table_iter_next(iter), "attr_table_entry != NULL");
+#endif
     pldm_bios_table_iter_free(iter);
 }
 
diff --git a/tests/libpldm_firmware_update_test.cpp b/tests/libpldm_firmware_update_test.cpp
index 493da65..c42381c 100644
--- a/tests/libpldm_firmware_update_test.cpp
+++ b/tests/libpldm_firmware_update_test.cpp
@@ -1608,12 +1608,19 @@
      *  The 1st parameter is the function under test.
      *  The 2nd parameter compares the output of the program.
      */
-    ASSERT_DEATH(
+#ifdef NDEBUG
+    EXPECT_NE(decode_query_downstream_identifiers_resp(
+                  response, responseMsg.size() - hdrSize, &resp_data,
+                  &downstreamDevices),
+              PLDM_SUCCESS);
+#else
+    EXPECT_DEATH(
         decode_query_downstream_identifiers_resp(
             response, responseMsg.size() - hdrSize, &resp_data,
             &downstreamDevices),
         // This error doesn't output any error message, leave it be empty
         "");
+#endif
 }
 
 TEST(QueryDownstreamIdentifiers, decodeRequestErrorBufSize)