[bt][common] static_cast for explicit truncation

In a test helper where we convert an integer wider than 1 byte to an
array of uint8_t, we truncate the lowest byte of the integer into the
current byte of the array. This truncation was implicit, triggering a
-Wno-conversion warning, so use a static_cast to make it explicit.

Bug: 72825
Change-Id: If404147de40e5fa87942cefe1a602c8342586462
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/513646
Fuchsia-Auto-Submit: Lucas Jenkins <lucasjenkins@google.com>
Reviewed-by: Xo Wang <xow@google.com>
Commit-Queue: Lucas Jenkins <lucasjenkins@google.com>
diff --git a/src/connectivity/bluetooth/core/bt-host/common/test_helpers.h b/src/connectivity/bluetooth/core/bt-host/common/test_helpers.h
index c5011a2..1f2ce07 100644
--- a/src/connectivity/bluetooth/core/bt-host/common/test_helpers.h
+++ b/src/connectivity/bluetooth/core/bt-host/common/test_helpers.h
@@ -108,7 +108,7 @@
   static_assert(std::is_integral_v<T>, "Must use integral types for safe bytewise access");
   std::array<uint8_t, sizeof(T)> bytes;
   for (auto& byte : bytes) {
-    byte = x;
+    byte = static_cast<uint8_t>(x);
     x >>= 8;
   }
   return bytes;