pw_bytes: Add functions for specifying byte units

In some situations, the usage of user-defined literals is either not
permitted or desirable due to the required usage directive. For example,
one would not want to place a using directive in a header and pollute
the namespace. This CL adds similar functions to provide similar
readability improvements. For example:

  constexpr size_t kBufferSize = pw::bytes::MiB(1) + pw::bytes::KiB(42);

Change-Id: I7c7d78ea05e665ea586a553dc3d39d266a2dfc67
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/84747
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Keir Mierle <keir@google.com>
diff --git a/pw_bytes/units_test.cc b/pw_bytes/units_test.cc
index abb6358..a857eaf 100644
--- a/pw_bytes/units_test.cc
+++ b/pw_bytes/units_test.cc
@@ -21,6 +21,29 @@
 
 using namespace pw::bytes::unit_literals;
 
+// Byte Function tests
+static_assert(B(1) == 1ull);
+static_assert(B(42) == 42ull);
+
+static_assert(KiB(1) == 1'024ull);
+static_assert(KiB(42) == 43'008ull);
+
+static_assert(MiB(1) == 1'048'576ull);
+static_assert(MiB(42) == 44'040'192ull);
+
+static_assert(GiB(1) == 1'073'741'824ull);
+static_assert(GiB(42) == 45'097'156'608ull);
+
+static_assert(TiB(1) == 1'099'511'627'776ull);
+static_assert(TiB(42) == 46'179'488'366'592ull);
+
+static_assert(PiB(1) == 1'125'899'906'842'624ull);
+static_assert(PiB(42) == 47'287'796'087'390'208ull);
+
+static_assert(EiB(1) == 1'152'921'504'606'846'976ull);
+static_assert(EiB(4) == 4'611'686'018'427'387'904ull);
+
+// User-defined literal tests
 static_assert(1_B == 1ull);
 static_assert(42_B == 42ull);