Make fuzz test check round-trip correctness of upb encoder/decoder.
Prior to this CL, the fuzz tests only checked that the code does not crash, but it was not checking any correctness properties. This CL adds correctness checking, verifying that we can round trip through the wire format without losing or corrupting data.
This highlighted a minor bug in the encoder where the depth limit check was off by one (too strict). This CL makes the encoder more accepting when checking the depth limit.
PiperOrigin-RevId: 698527429
diff --git a/upb/message/BUILD b/upb/message/BUILD
index d7b83a1..0089596 100644
--- a/upb/message/BUILD
+++ b/upb/message/BUILD
@@ -381,6 +381,7 @@
"//upb:eps_copy_input_stream",
"//upb:json",
"//upb:mem",
+ "//upb:message_compare",
"//upb:mini_table",
"//upb:reflection",
"//upb:wire",
diff --git a/upb/message/test.cc b/upb/message/test.cc
index 7ee6442..041a82d 100644
--- a/upb/message/test.cc
+++ b/upb/message/test.cc
@@ -7,8 +7,10 @@
#include <cstddef>
#include <cstdint>
+#include <optional>
#include <string>
#include <string_view>
+#include <utility>
#include <vector>
#include <gmock/gmock.h>
@@ -22,6 +24,7 @@
#include "upb/mem/arena.h"
#include "upb/mem/arena.hpp"
#include "upb/message/array.h"
+#include "upb/message/compare.h"
#include "upb/message/map.h"
#include "upb/message/message.h"
#include "upb/message/test.upb.h"