tests: Add proto2 serialization tests


tests/auto/protobuf had no proto2 .proto at all, so proto2 was covered
only by generator golden-file tests. Those record whatever the generator
currently emits and therefore cannot detect a wire-format change, which
is how required fields being dropped from the wire passed review.

Assert the encoding of a message whose required fields hold their type's
default values, for the three affected wire types, in both the binary
and JSON formats. The expected bytes are what the reference
implementation produces for the same message.

The .proto lives in tests/auto/shared/data/proto rather than beside the
generator test data, so that adding messages for later runtime tests
does not force the golden files to be regenerated.

Task-number: QTBUG-149955
Pick-to: 6.12 6.11 6.8
Change-Id: I0aba6485374af76645c62cdfa8fc543c7b4cfc0d
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commit61d1e09979bfea38e7fa13e22353b5d4344bdf8d
parent8259e24d23157ffc1aa313b40115c80943412325
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeFri, 9 Oct 2026 12:59:07 +0000