Skip to content

Commit

Permalink
Regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvl committed Aug 23, 2024
1 parent aeaac78 commit 6c52032
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 18 deletions.
77 changes: 71 additions & 6 deletions Reference/Conformance/conformance/conformance.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,27 @@ enum Conformance_TestCategory: SwiftProtobuf.Enum, Swift.CaseIterable {

}

/// 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.
struct Conformance_TestStatus: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

var name: String = String()

var failureMessage: String = String()

/// What an actual test name matched to in a failure list. Can be wildcarded or
/// an exact match without wildcards.
var matchedName: String = String()

var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
}

/// 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.
Expand All @@ -150,7 +171,7 @@ struct Conformance_FailureSet: Sendable {
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

var failure: [String] = []
var test: [Conformance_TestStatus] = []

var unknownFields = SwiftProtobuf.UnknownStorage()

Expand Down Expand Up @@ -441,10 +462,54 @@ extension Conformance_TestCategory: SwiftProtobuf._ProtoNameProviding {
]
}

extension Conformance_TestStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestStatus"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "name"),
2: .standard(proto: "failure_message"),
3: .standard(proto: "matched_name"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.failureMessage) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.matchedName) }()
default: break
}
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.name.isEmpty {
try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
}
if !self.failureMessage.isEmpty {
try visitor.visitSingularStringField(value: self.failureMessage, fieldNumber: 2)
}
if !self.matchedName.isEmpty {
try visitor.visitSingularStringField(value: self.matchedName, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Conformance_TestStatus, rhs: Conformance_TestStatus) -> Bool {
if lhs.name != rhs.name {return false}
if lhs.failureMessage != rhs.failureMessage {return false}
if lhs.matchedName != rhs.matchedName {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".FailureSet"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "failure"),
2: .same(proto: "test"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
Expand All @@ -453,21 +518,21 @@ extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageI
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeRepeatedStringField(value: &self.failure) }()
case 2: try { try decoder.decodeRepeatedMessageField(value: &self.test) }()
default: break
}
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.failure.isEmpty {
try visitor.visitRepeatedStringField(value: self.failure, fieldNumber: 1)
if !self.test.isEmpty {
try visitor.visitRepeatedMessageField(value: self.test, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Conformance_FailureSet, rhs: Conformance_FailureSet) -> Bool {
if lhs.failure != rhs.failure {return false}
if lhs.test != rhs.test {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand Down
77 changes: 71 additions & 6 deletions Reference/upstream/conformance/conformance.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,27 @@ enum Conformance_TestCategory: SwiftProtobuf.Enum, Swift.CaseIterable {

}

/// 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.
struct Conformance_TestStatus: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

var name: String = String()

var failureMessage: String = String()

/// What an actual test name matched to in a failure list. Can be wildcarded or
/// an exact match without wildcards.
var matchedName: String = String()

var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
}

/// 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.
Expand All @@ -150,7 +171,7 @@ struct Conformance_FailureSet: Sendable {
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

var failure: [String] = []
var test: [Conformance_TestStatus] = []

var unknownFields = SwiftProtobuf.UnknownStorage()

Expand Down Expand Up @@ -441,10 +462,54 @@ extension Conformance_TestCategory: SwiftProtobuf._ProtoNameProviding {
]
}

extension Conformance_TestStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestStatus"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "name"),
2: .standard(proto: "failure_message"),
3: .standard(proto: "matched_name"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.failureMessage) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.matchedName) }()
default: break
}
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.name.isEmpty {
try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
}
if !self.failureMessage.isEmpty {
try visitor.visitSingularStringField(value: self.failureMessage, fieldNumber: 2)
}
if !self.matchedName.isEmpty {
try visitor.visitSingularStringField(value: self.matchedName, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Conformance_TestStatus, rhs: Conformance_TestStatus) -> Bool {
if lhs.name != rhs.name {return false}
if lhs.failureMessage != rhs.failureMessage {return false}
if lhs.matchedName != rhs.matchedName {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".FailureSet"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "failure"),
2: .same(proto: "test"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
Expand All @@ -453,21 +518,21 @@ extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageI
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeRepeatedStringField(value: &self.failure) }()
case 2: try { try decoder.decodeRepeatedMessageField(value: &self.test) }()
default: break
}
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.failure.isEmpty {
try visitor.visitRepeatedStringField(value: self.failure, fieldNumber: 1)
if !self.test.isEmpty {
try visitor.visitRepeatedMessageField(value: self.test, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Conformance_FailureSet, rhs: Conformance_FailureSet) -> Bool {
if lhs.failure != rhs.failure {return false}
if lhs.test != rhs.test {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand Down
16 changes: 16 additions & 0 deletions Reference/upstream/google/protobuf/cpp_features.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ struct Pb_CppFeatures: Sendable {
/// Clears the value of `stringType`. Subsequent reads from it will return its default value.
mutating func clearStringType() {self._stringType = nil}

var enumNameUsesStringView: Bool {
get {return _enumNameUsesStringView ?? false}
set {_enumNameUsesStringView = newValue}
}
/// Returns true if `enumNameUsesStringView` has been explicitly set.
var hasEnumNameUsesStringView: Bool {return self._enumNameUsesStringView != nil}
/// Clears the value of `enumNameUsesStringView`. Subsequent reads from it will return its default value.
mutating func clearEnumNameUsesStringView() {self._enumNameUsesStringView = nil}

var unknownFields = SwiftProtobuf.UnknownStorage()

enum StringType: SwiftProtobuf.Enum, Swift.CaseIterable {
Expand Down Expand Up @@ -93,6 +102,7 @@ struct Pb_CppFeatures: Sendable {

fileprivate var _legacyClosedEnum: Bool? = nil
fileprivate var _stringType: Pb_CppFeatures.StringType? = nil
fileprivate var _enumNameUsesStringView: Bool? = nil
}

// MARK: - Extension support defined in cpp_features.proto.
Expand Down Expand Up @@ -151,6 +161,7 @@ extension Pb_CppFeatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "legacy_closed_enum"),
2: .standard(proto: "string_type"),
3: .standard(proto: "enum_name_uses_string_view"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
Expand All @@ -161,6 +172,7 @@ extension Pb_CppFeatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement
switch fieldNumber {
case 1: try { try decoder.decodeSingularBoolField(value: &self._legacyClosedEnum) }()
case 2: try { try decoder.decodeSingularEnumField(value: &self._stringType) }()
case 3: try { try decoder.decodeSingularBoolField(value: &self._enumNameUsesStringView) }()
default: break
}
}
Expand All @@ -177,12 +189,16 @@ extension Pb_CppFeatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement
try { if let v = self._stringType {
try visitor.visitSingularEnumField(value: v, fieldNumber: 2)
} }()
try { if let v = self._enumNameUsesStringView {
try visitor.visitSingularBoolField(value: v, fieldNumber: 3)
} }()
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Pb_CppFeatures, rhs: Pb_CppFeatures) -> Bool {
if lhs._legacyClosedEnum != rhs._legacyClosedEnum {return false}
if lhs._stringType != rhs._stringType {return false}
if lhs._enumNameUsesStringView != rhs._enumNameUsesStringView {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand Down
Loading

0 comments on commit 6c52032

Please sign in to comment.