From aeaac7823153121a55912bdc8a4263d6d9ce8b78 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Fri, 23 Aug 2024 16:13:31 -0400 Subject: [PATCH] Update proto files from upstream. Used upstream 138451296bf4101f992faa215a1899f3b9ec29e7. --- .../Conformance/conformance/conformance.proto | 14 +++++++++++++- Protos/upstream/conformance/conformance.proto | 14 +++++++++++++- .../upstream/google/protobuf/cpp_features.proto | 17 ++++++++++++++--- Protos/upstream/google/protobuf/unittest.proto | 2 +- .../google/protobuf/unittest_lite.proto | 4 ++++ .../protobuf/unittest_no_field_presence.proto | 8 +++++++- 6 files changed, 52 insertions(+), 7 deletions(-) diff --git a/Protos/Conformance/conformance/conformance.proto b/Protos/Conformance/conformance/conformance.proto index 2357d59ad..e3298f085 100644 --- a/Protos/Conformance/conformance/conformance.proto +++ b/Protos/Conformance/conformance/conformance.proto @@ -57,11 +57,23 @@ enum TestCategory { TEXT_FORMAT_TEST = 5; } +// Meant to encapsulate all types of tests: successes, skips, failures, etc. +// Therefore, this may or may not have a failure message. Failure messages +// may be truncated for our failure lists. +message TestStatus { + string name = 1; + string failure_message = 2; + // What an actual test name matched to in a failure list. Can be wildcarded or + // an exact match without wildcards. + string matched_name = 3; +} + // The conformance runner will request a list of failures as the first request. // This will be known by message_type == "conformance.FailureSet", a conformance // test should return a serialized FailureSet in protobuf_payload. message FailureSet { - repeated string failure = 1; + repeated TestStatus test = 2; + reserved 1; } // Represents a single test case's input. The testee should: diff --git a/Protos/upstream/conformance/conformance.proto b/Protos/upstream/conformance/conformance.proto index 2357d59ad..e3298f085 100644 --- a/Protos/upstream/conformance/conformance.proto +++ b/Protos/upstream/conformance/conformance.proto @@ -57,11 +57,23 @@ enum TestCategory { TEXT_FORMAT_TEST = 5; } +// Meant to encapsulate all types of tests: successes, skips, failures, etc. +// Therefore, this may or may not have a failure message. Failure messages +// may be truncated for our failure lists. +message TestStatus { + string name = 1; + string failure_message = 2; + // What an actual test name matched to in a failure list. Can be wildcarded or + // an exact match without wildcards. + string matched_name = 3; +} + // The conformance runner will request a list of failures as the first request. // This will be known by message_type == "conformance.FailureSet", a conformance // test should return a serialized FailureSet in protobuf_payload. message FailureSet { - repeated string failure = 1; + repeated TestStatus test = 2; + reserved 1; } // Represents a single test case's input. The testee should: diff --git a/Protos/upstream/google/protobuf/cpp_features.proto b/Protos/upstream/google/protobuf/cpp_features.proto index f3d670428..a0d192999 100644 --- a/Protos/upstream/google/protobuf/cpp_features.proto +++ b/Protos/upstream/google/protobuf/cpp_features.proto @@ -27,10 +27,10 @@ message CppFeatures { feature_support = { edition_introduced: EDITION_2023, edition_deprecated: EDITION_2023, - deprecation_warning: "The legacy closed enum treatment in C++ is " + deprecation_warning: "The legacy closed enum behavior in C++ is " "deprecated and is scheduled to be removed in " - "edition 2025. Mark enum type on the enum " - "definitions themselves rather than on fields.", + "edition 2025. See http://protobuf.dev/programming-guides/enum/#cpp for " + "more information", }, edition_defaults = { edition: EDITION_LEGACY, value: "true" }, edition_defaults = { edition: EDITION_PROTO3, value: "false" } @@ -53,4 +53,15 @@ message CppFeatures { edition_defaults = { edition: EDITION_LEGACY, value: "STRING" }, edition_defaults = { edition: EDITION_2024, value: "VIEW" } ]; + + optional bool enum_name_uses_string_view = 3 [ + retention = RETENTION_SOURCE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2024, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "false" }, + edition_defaults = { edition: EDITION_2024, value: "true" } + ]; } diff --git a/Protos/upstream/google/protobuf/unittest.proto b/Protos/upstream/google/protobuf/unittest.proto index cb46956d3..ce2cdc9fe 100644 --- a/Protos/upstream/google/protobuf/unittest.proto +++ b/Protos/upstream/google/protobuf/unittest.proto @@ -124,7 +124,7 @@ message TestAllTypes { repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; repeated string repeated_cord = 55 [ctype=CORD]; - repeated NestedMessage repeated_lazy_message = 57 ; + repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; // Singular with defaults optional int32 default_int32 = 61 [default = 41 ]; diff --git a/Protos/upstream/google/protobuf/unittest_lite.proto b/Protos/upstream/google/protobuf/unittest_lite.proto index b3fcfa431..4bc78c4de 100644 --- a/Protos/upstream/google/protobuf/unittest_lite.proto +++ b/Protos/upstream/google/protobuf/unittest_lite.proto @@ -625,3 +625,7 @@ message RecursiveMessage { RecursiveMessage recurse = 1; bytes payload = 2; } + +message RecursiveGroup { + RecursiveGroup recurse = 1 [features.message_encoding = DELIMITED]; +} diff --git a/Protos/upstream/google/protobuf/unittest_no_field_presence.proto b/Protos/upstream/google/protobuf/unittest_no_field_presence.proto index f6880a58e..cc02acc91 100644 --- a/Protos/upstream/google/protobuf/unittest_no_field_presence.proto +++ b/Protos/upstream/google/protobuf/unittest_no_field_presence.proto @@ -92,7 +92,7 @@ message TestAllTypes { repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; repeated string repeated_cord = 55 [ctype = CORD]; - repeated NestedMessage repeated_lazy_message = 57 ; + repeated NestedMessage repeated_lazy_message = 57; oneof oneof_field { uint32 oneof_uint32 = 111; @@ -112,6 +112,12 @@ message ForeignMessage { int32 c = 1; } +// Same as ForeignMessage, but all fields have explicit presence. +// It can be useful for testing explicit-implicit presence interop behaviour. +message ExplicitForeignMessage { + int32 c = 1 [features.field_presence = EXPLICIT]; +} + enum ForeignEnum { FOREIGN_FOO = 0; FOREIGN_BAR = 1;