Skip to content

Commit 9fb655b

Browse files
committed
Regenerate test protos
1 parent ffbd13b commit 9fb655b

File tree

4 files changed

+125
-25
lines changed

4 files changed

+125
-25
lines changed

Tests/ProtobufTests/descriptor.pb.swift

Lines changed: 105 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,11 @@ public struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufExt
23562356
/// named by java_outer_classname. However, the outer class will still be
23572357
/// generated to contain the file's getDescriptor() method as well as any
23582358
/// top-level extensions defined in the file.
2359-
public var javaMultipleFiles: Bool? = nil
2359+
private var _javaMultipleFiles: Bool? = nil
2360+
public var javaMultipleFiles: Bool? {
2361+
get {return _javaMultipleFiles ?? false}
2362+
set {_javaMultipleFiles = newValue}
2363+
}
23602364

23612365
/// If set true, then the Java code generator will generate equals() and
23622366
/// hashCode() methods for all messages defined in the .proto file.
@@ -2370,17 +2374,29 @@ public struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufExt
23702374
/// the generated methods compute their results based on field values rather
23712375
/// than object identity. (Implementations should not assume that hashcodes
23722376
/// will be consistent across runtimes or versions of the protocol compiler.)
2373-
public var javaGenerateEqualsAndHash: Bool? = nil
2377+
private var _javaGenerateEqualsAndHash: Bool? = nil
2378+
public var javaGenerateEqualsAndHash: Bool? {
2379+
get {return _javaGenerateEqualsAndHash ?? false}
2380+
set {_javaGenerateEqualsAndHash = newValue}
2381+
}
23742382

23752383
/// If set true, then the Java2 code generator will generate code that
23762384
/// throws an exception whenever an attempt is made to assign a non-UTF-8
23772385
/// byte sequence to a string field.
23782386
/// Message reflection will do the same.
23792387
/// However, an extension field still accepts non-UTF-8 byte sequences.
23802388
/// This option has no effect on when used with the lite runtime.
2381-
public var javaStringCheckUtf8: Bool? = nil
2389+
private var _javaStringCheckUtf8: Bool? = nil
2390+
public var javaStringCheckUtf8: Bool? {
2391+
get {return _javaStringCheckUtf8 ?? false}
2392+
set {_javaStringCheckUtf8 = newValue}
2393+
}
23822394

2383-
public var optimizeFor: Google_Protobuf_FileOptions.OptimizeMode? = nil
2395+
private var _optimizeFor: Google_Protobuf_FileOptions.OptimizeMode? = nil
2396+
public var optimizeFor: Google_Protobuf_FileOptions.OptimizeMode? {
2397+
get {return _optimizeFor ?? Google_Protobuf_FileOptions.OptimizeMode.speed}
2398+
set {_optimizeFor = newValue}
2399+
}
23842400

23852401
/// Sets the Go package where structs generated from this .proto will be
23862402
/// placed. If omitted, the Go package will be derived from the following:
@@ -2399,21 +2415,41 @@ public struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufExt
23992415
/// that generate code specific to your particular RPC system. Therefore,
24002416
/// these default to false. Old code which depends on generic services should
24012417
/// explicitly set them to true.
2402-
public var ccGenericServices: Bool? = nil
2418+
private var _ccGenericServices: Bool? = nil
2419+
public var ccGenericServices: Bool? {
2420+
get {return _ccGenericServices ?? false}
2421+
set {_ccGenericServices = newValue}
2422+
}
24032423

2404-
public var javaGenericServices: Bool? = nil
2424+
private var _javaGenericServices: Bool? = nil
2425+
public var javaGenericServices: Bool? {
2426+
get {return _javaGenericServices ?? false}
2427+
set {_javaGenericServices = newValue}
2428+
}
24052429

2406-
public var pyGenericServices: Bool? = nil
2430+
private var _pyGenericServices: Bool? = nil
2431+
public var pyGenericServices: Bool? {
2432+
get {return _pyGenericServices ?? false}
2433+
set {_pyGenericServices = newValue}
2434+
}
24072435

24082436
/// Is this file deprecated?
24092437
/// Depending on the target platform, this can emit Deprecated annotations
24102438
/// for everything in the file, or it will be completely ignored; in the very
24112439
/// least, this is a formalization for deprecating files.
2412-
public var deprecated: Bool? = nil
2440+
private var _deprecated: Bool? = nil
2441+
public var deprecated: Bool? {
2442+
get {return _deprecated ?? false}
2443+
set {_deprecated = newValue}
2444+
}
24132445

24142446
/// Enables the use of arenas for the proto messages in this file. This applies
24152447
/// only to generated classes for C++.
2416-
public var ccEnableArenas: Bool? = nil
2448+
private var _ccEnableArenas: Bool? = nil
2449+
public var ccEnableArenas: Bool? {
2450+
get {return _ccEnableArenas ?? false}
2451+
set {_ccEnableArenas = newValue}
2452+
}
24172453

24182454
/// Sets the objective c class prefix which is prepended to all objective c
24192455
/// generated classes from this .proto. There is no default.
@@ -2653,18 +2689,30 @@ public struct Google_Protobuf_MessageOptions: ProtobufGeneratedMessage, Protobuf
26532689
///
26542690
/// Because this is an option, the above two restrictions are not enforced by
26552691
/// the protocol compiler.
2656-
public var messageSetWireFormat: Bool? = nil
2692+
private var _messageSetWireFormat: Bool? = nil
2693+
public var messageSetWireFormat: Bool? {
2694+
get {return _messageSetWireFormat ?? false}
2695+
set {_messageSetWireFormat = newValue}
2696+
}
26572697

26582698
/// Disables the generation of the standard "descriptor()" accessor, which can
26592699
/// conflict with a field of the same name. This is meant to make migration
26602700
/// from proto1 easier; new code should avoid fields named "descriptor".
2661-
public var noStandardDescriptorAccessor: Bool? = nil
2701+
private var _noStandardDescriptorAccessor: Bool? = nil
2702+
public var noStandardDescriptorAccessor: Bool? {
2703+
get {return _noStandardDescriptorAccessor ?? false}
2704+
set {_noStandardDescriptorAccessor = newValue}
2705+
}
26622706

26632707
/// Is this message deprecated?
26642708
/// Depending on the target platform, this can emit Deprecated annotations
26652709
/// for the message, or it will be completely ignored; in the very least,
26662710
/// this is a formalization for deprecating messages.
2667-
public var deprecated: Bool? = nil
2711+
private var _deprecated: Bool? = nil
2712+
public var deprecated: Bool? {
2713+
get {return _deprecated ?? false}
2714+
set {_deprecated = newValue}
2715+
}
26682716

26692717
/// Whether the message is an automatically generated map entry type for the
26702718
/// maps field.
@@ -2996,7 +3044,11 @@ public struct Google_Protobuf_FieldOptions: ProtobufGeneratedMessage, ProtobufEx
29963044
/// representation of the field than it normally would. See the specific
29973045
/// options below. This option is not yet implemented in the open source
29983046
/// release -- sorry, we'll try to include it in a future version!
2999-
public var ctype: Google_Protobuf_FieldOptions.CType? = nil
3047+
private var _ctype: Google_Protobuf_FieldOptions.CType? = nil
3048+
public var ctype: Google_Protobuf_FieldOptions.CType? {
3049+
get {return _ctype ?? Google_Protobuf_FieldOptions.CType.string}
3050+
set {_ctype = newValue}
3051+
}
30003052

30013053
/// The packed option can be enabled for repeated primitive fields to enable
30023054
/// a more efficient representation on the wire. Rather than repeatedly
@@ -3014,7 +3066,11 @@ public struct Google_Protobuf_FieldOptions: ProtobufGeneratedMessage, ProtobufEx
30143066
/// JavaScript code to use the JavaScript "number" type instead of strings.
30153067
/// This option is an enum to permit additional types to be added,
30163068
/// e.g. goog.math.Integer.
3017-
public var jstype: Google_Protobuf_FieldOptions.JSType? = nil
3069+
private var _jstype: Google_Protobuf_FieldOptions.JSType? = nil
3070+
public var jstype: Google_Protobuf_FieldOptions.JSType? {
3071+
get {return _jstype ?? Google_Protobuf_FieldOptions.JSType.jsNormal}
3072+
set {_jstype = newValue}
3073+
}
30183074

30193075
/// Should this field be parsed lazily? Lazy applies only to message-type
30203076
/// fields. It means that when the outer message is initially parsed, the
@@ -3044,16 +3100,28 @@ public struct Google_Protobuf_FieldOptions: ProtobufGeneratedMessage, ProtobufEx
30443100
/// implementation must either *always* check its required fields, or *never*
30453101
/// check its required fields, regardless of whether or not the message has
30463102
/// been parsed.
3047-
public var lazy: Bool? = nil
3103+
private var _lazy: Bool? = nil
3104+
public var lazy: Bool? {
3105+
get {return _lazy ?? false}
3106+
set {_lazy = newValue}
3107+
}
30483108

30493109
/// Is this field deprecated?
30503110
/// Depending on the target platform, this can emit Deprecated annotations
30513111
/// for accessors, or it will be completely ignored; in the very least, this
30523112
/// is a formalization for deprecating fields.
3053-
public var deprecated: Bool? = nil
3113+
private var _deprecated: Bool? = nil
3114+
public var deprecated: Bool? {
3115+
get {return _deprecated ?? false}
3116+
set {_deprecated = newValue}
3117+
}
30543118

30553119
/// For Google-internal migration only. Do not use.
3056-
public var weak: Bool? = nil
3120+
private var _weak: Bool? = nil
3121+
public var weak: Bool? {
3122+
get {return _weak ?? false}
3123+
set {_weak = newValue}
3124+
}
30573125

30583126
/// The parser stores options it doesn't recognize here. See above.
30593127
public var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
@@ -3273,7 +3341,11 @@ public struct Google_Protobuf_EnumOptions: ProtobufGeneratedMessage, ProtobufExt
32733341
/// Depending on the target platform, this can emit Deprecated annotations
32743342
/// for the enum, or it will be completely ignored; in the very least, this
32753343
/// is a formalization for deprecating enums.
3276-
public var deprecated: Bool? = nil
3344+
private var _deprecated: Bool? = nil
3345+
public var deprecated: Bool? {
3346+
get {return _deprecated ?? false}
3347+
set {_deprecated = newValue}
3348+
}
32773349

32783350
/// The parser stores options it doesn't recognize here. See above.
32793351
public var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
@@ -3376,7 +3448,11 @@ public struct Google_Protobuf_EnumValueOptions: ProtobufGeneratedMessage, Protob
33763448
/// Depending on the target platform, this can emit Deprecated annotations
33773449
/// for the enum value, or it will be completely ignored; in the very least,
33783450
/// this is a formalization for deprecating enum values.
3379-
public var deprecated: Bool? = nil
3451+
private var _deprecated: Bool? = nil
3452+
public var deprecated: Bool? {
3453+
get {return _deprecated ?? false}
3454+
set {_deprecated = newValue}
3455+
}
33803456

33813457
/// The parser stores options it doesn't recognize here. See above.
33823458
public var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
@@ -3476,7 +3552,11 @@ public struct Google_Protobuf_ServiceOptions: ProtobufGeneratedMessage, Protobuf
34763552
/// Depending on the target platform, this can emit Deprecated annotations
34773553
/// for the service, or it will be completely ignored; in the very least,
34783554
/// this is a formalization for deprecating services.
3479-
public var deprecated: Bool? = nil
3555+
private var _deprecated: Bool? = nil
3556+
public var deprecated: Bool? {
3557+
get {return _deprecated ?? false}
3558+
set {_deprecated = newValue}
3559+
}
34803560

34813561
/// The parser stores options it doesn't recognize here. See above.
34823562
public var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
@@ -3576,7 +3656,11 @@ public struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufE
35763656
/// Depending on the target platform, this can emit Deprecated annotations
35773657
/// for the method, or it will be completely ignored; in the very least,
35783658
/// this is a formalization for deprecating methods.
3579-
public var deprecated: Bool? = nil
3659+
private var _deprecated: Bool? = nil
3660+
public var deprecated: Bool? {
3661+
get {return _deprecated ?? false}
3662+
set {_deprecated = newValue}
3663+
}
35803664

35813665
/// The parser stores options it doesn't recognize here. See above.
35823666
public var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []

Tests/ProtobufTests/unittest.pb.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9888,7 +9888,11 @@ public struct ProtobufUnittest_TestCommentInjectionMessage: ProtobufGeneratedMes
98889888
var unknown = ProtobufUnknownStorage()
98899889

98909890
/// */ <- This should not close the generated doc comment
9891-
public var a: String? = nil
9891+
private var _a: String? = nil
9892+
public var a: String? {
9893+
get {return _a ?? "*/ <- Neither should this."}
9894+
set {_a = newValue}
9895+
}
98929896

98939897
public init() {}
98949898

Tests/ProtobufTests/unittest_lite.pb.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3381,7 +3381,11 @@ public struct ProtobufUnittest_V1MessageLite: ProtobufGeneratedMessage {
33813381

33823382
public var intField: Int32 = 0
33833383

3384-
public var enumField: ProtobufUnittest_V1EnumLite? = nil
3384+
private var _enumField: ProtobufUnittest_V1EnumLite? = nil
3385+
public var enumField: ProtobufUnittest_V1EnumLite? {
3386+
get {return _enumField ?? ProtobufUnittest_V1EnumLite.v1First}
3387+
set {_enumField = newValue}
3388+
}
33853389

33863390
public init() {}
33873391

@@ -3447,7 +3451,11 @@ public struct ProtobufUnittest_V2MessageLite: ProtobufGeneratedMessage {
34473451

34483452
public var intField: Int32 = 0
34493453

3450-
public var enumField: ProtobufUnittest_V2EnumLite? = nil
3454+
private var _enumField: ProtobufUnittest_V2EnumLite? = nil
3455+
public var enumField: ProtobufUnittest_V2EnumLite? {
3456+
get {return _enumField ?? ProtobufUnittest_V2EnumLite.v2First}
3457+
set {_enumField = newValue}
3458+
}
34513459

34523460
public init() {}
34533461

Tests/ProtobufTests/unittest_swift_enum_optional_default.pb.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ public struct ProtobufUnittest_Extend_EnumOptionalDefault: ProtobufGeneratedMess
301301

302302
}
303303

304-
public var optionalEnum: ProtobufUnittest_Extend_EnumOptionalDefault.NestedMessage2.Enum? = nil
304+
private var _optionalEnum: ProtobufUnittest_Extend_EnumOptionalDefault.NestedMessage2.Enum? = nil
305+
public var optionalEnum: ProtobufUnittest_Extend_EnumOptionalDefault.NestedMessage2.Enum? {
306+
get {return _optionalEnum ?? ProtobufUnittest_Extend_EnumOptionalDefault.NestedMessage2.Enum.foo}
307+
set {_optionalEnum = newValue}
308+
}
305309

306310
public init() {}
307311

0 commit comments

Comments
 (0)