Skip to content

Commit

Permalink
Standardize proto namespaces.
Browse files Browse the repository at this point in the history
Make the proto namespace used more consistent and ensure they are scoped to this
project more clearly.

Delete files that don't seem to be use/validating anything.
  • Loading branch information
thomasvl committed Jul 24, 2023
1 parent 9b49a00 commit 37a0e0b
Show file tree
Hide file tree
Showing 181 changed files with 24,661 additions and 25,141 deletions.
6 changes: 3 additions & 3 deletions FuzzTesting/Sources/FuzzBinary/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import SwiftProtobuf
@_cdecl("LLVMFuzzerTestOneInput")
public func FuzzBinary(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
let bytes = UnsafeRawBufferPointer(start: start, count: count)
var msg: Fuzz_Testing_Message?
var msg: SwiftProtoTesting_Fuzz_Message?
do {
msg = try Fuzz_Testing_Message(
msg = try SwiftProtoTesting_Fuzz_Message(
serializedBytes: Array(bytes),
extensions: Fuzz_Testing_FuzzTesting_Extensions)
extensions: SwiftProtoTesting_Fuzz_FuzzTesting_Extensions)
} catch {
// Error parsing are to be expected since not all input will be well formed.
}
Expand Down
6 changes: 3 additions & 3 deletions FuzzTesting/Sources/FuzzBinaryDelimited/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import SwiftProtobuf
@_cdecl("LLVMFuzzerTestOneInput")
public func FuzzDelimited(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
let bytes = UnsafeRawBufferPointer(start: start, count: count)
var msg: Fuzz_Testing_Message?
var msg: SwiftProtoTesting_Fuzz_Message?
do {
let istream = InputStream(data: Data(bytes))
istream.open()
msg = try BinaryDelimited.parse(
messageType: Fuzz_Testing_Message.self,
messageType: SwiftProtoTesting_Fuzz_Message.self,
from: istream,
extensions: Fuzz_Testing_FuzzTesting_Extensions)
extensions: SwiftProtoTesting_Fuzz_FuzzTesting_Extensions)
} catch {
// Error parsing are to be expected since not all input will be well formed.
}
Expand Down
1,132 changes: 566 additions & 566 deletions FuzzTesting/Sources/FuzzCommon/fuzz_testing.pb.swift

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions FuzzTesting/Sources/FuzzJSON/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import SwiftProtobuf
@_cdecl("LLVMFuzzerTestOneInput")
public func FuzzJSON(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
let bytes = UnsafeRawBufferPointer(start: start, count: count)
var msg: Fuzz_Testing_Message?
var msg: SwiftProtoTesting_Fuzz_Message?
do {
msg = try Fuzz_Testing_Message(
msg = try SwiftProtoTesting_Fuzz_Message(
jsonUTF8Data: Data(bytes),
extensions: Fuzz_Testing_FuzzTesting_Extensions)
extensions: SwiftProtoTesting_Fuzz_FuzzTesting_Extensions)
} catch {
// Error parsing are to be expected since not all input will be well formed.
}
Expand Down
6 changes: 3 additions & 3 deletions FuzzTesting/Sources/FuzzTextFormat/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import FuzzCommon
public func FuzzTextFormat(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
let bytes = UnsafeRawBufferPointer(start: start, count: count)
guard let str = String(data: Data(bytes), encoding: .utf8) else { return 0 }
var msg: Fuzz_Testing_Message?
var msg: SwiftProtoTesting_Fuzz_Message?
do {
msg = try Fuzz_Testing_Message(
msg = try SwiftProtoTesting_Fuzz_Message(
textFormatString: str,
extensions: Fuzz_Testing_FuzzTesting_Extensions)
extensions: SwiftProtoTesting_Fuzz_FuzzTesting_Extensions)
} catch {
// Error parsing are to be expected since not all input will be well formed.
}
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Protos/SwiftProtobufTests/generated_swift_names_fields.proto: Protos/mined_words
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
@echo 'syntax = "proto3";' >> $@
@echo 'package protobuf_unittest_generated;' >> $@
@echo 'package swift_proto_testing.generated;' >> $@
@echo 'message GeneratedSwiftReservedFields {' >> $@
@cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " int32 " $$1 " = " n ";"; n += 1 }' >> $@
@echo '}' >> $@
Expand All @@ -377,7 +377,7 @@ Protos/SwiftProtobufTests/generated_swift_names_enum_cases.proto: Protos/mined_w
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
@echo 'syntax = "proto3";' >> $@
@echo 'package protobuf_unittest_generated;' >> $@
@echo 'package swift_proto_testing.generated;' >> $@
@echo 'enum GeneratedSwiftReservedEnum {' >> $@
@echo ' NONE = 0;' >> $@
@cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " " $$1 " = " n ";"; n += 1 }' >> $@
Expand All @@ -390,7 +390,7 @@ Protos/SwiftProtobufTests/generated_swift_names_messages.proto: Protos/mined_wor
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
@echo 'syntax = "proto3";' >> $@
@echo 'package protobuf_unittest_generated;' >> $@
@echo 'package swift_proto_testing.generated;' >> $@
@echo 'message GeneratedSwiftReservedMessages {' >> $@
@cat Protos/mined_words.txt | awk '{print " message " $$1 " { int32 " $$1 " = 1; }"}' >> $@
@echo '}' >> $@
Expand All @@ -402,7 +402,7 @@ Protos/SwiftProtobufTests/generated_swift_names_enums.proto: Protos/mined_words.
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
@echo 'syntax = "proto3";' >> $@
@echo 'package protobuf_unittest_generated;' >> $@
@echo 'package swift_proto_testing.generated;' >> $@
@echo 'message GeneratedSwiftReservedEnums {' >> $@
@cat Protos/mined_words.txt | awk '{print " enum " $$1 " { NONE_" $$1 " = 0; }"}' >> $@
@echo '}' >> $@
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/any_test.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

syntax = "proto3";

package protobuf_unittest;
package swift_proto_testing;

import "google/protobuf/any.proto";

Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/fuzz_testing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

syntax = "proto2";

package fuzz.testing;
package swift_proto_testing.fuzz;

import "google/protobuf/any.proto";
import "google/protobuf/api.proto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Protoc errors imply this file is being generated incorrectly
// Swift compile errors are probably bugs in protoc-gen-swift
syntax = "proto3";
package protobuf_unittest_generated;
package swift_proto_testing.generated;
enum GeneratedSwiftReservedEnum {
NONE = 0;
adjusted = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Protoc errors imply this file is being generated incorrectly
// Swift compile errors are probably bugs in protoc-gen-swift
syntax = "proto3";
package protobuf_unittest_generated;
package swift_proto_testing.generated;
message GeneratedSwiftReservedEnums {
enum adjusted { NONE_adjusted = 0; }
enum aggregateValue { NONE_aggregateValue = 0; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Protoc errors imply this file is being generated incorrectly
// Swift compile errors are probably bugs in protoc-gen-swift
syntax = "proto3";
package protobuf_unittest_generated;
package swift_proto_testing.generated;
message GeneratedSwiftReservedFields {
int32 adjusted = 1;
int32 aggregateValue = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Protoc errors imply this file is being generated incorrectly
// Swift compile errors are probably bugs in protoc-gen-swift
syntax = "proto3";
package protobuf_unittest_generated;
package swift_proto_testing.generated;
message GeneratedSwiftReservedMessages {
message adjusted { int32 adjusted = 1; }
message aggregateValue { int32 aggregateValue = 1; }
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/map_proto2_unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ syntax = "proto2";

import "unittest_import.proto";

package protobuf_unittest;
package swift_proto_testing;

enum Proto2MapEnum {
PROTO2_MAP_ENUM_FOO = 0;
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/map_unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ syntax = "proto3";

import "unittest.proto";

package protobuf_unittest;
package swift_proto_testing;

// Tests maps.
message TestMap {
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/test_messages_proto3.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

syntax = "proto3";

package protobuf_test_messages.proto3;
package swift_proto_testing.test3;

import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
Expand Down
26 changes: 13 additions & 13 deletions Protos/SwiftProtobufTests/unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ syntax = "proto2";

import "unittest_import.proto";

package protobuf_unittest;
package swift_proto_testing;

// This proto includes every type of field in both singular and repeated
// forms.
Expand Down Expand Up @@ -82,17 +82,17 @@ message TestAllTypes {

optional NestedMessage optional_nested_message = 18;
optional ForeignMessage optional_foreign_message = 19;
optional protobuf_unittest_import.ImportMessage optional_import_message = 20;
optional swift_proto_testing.import.ImportMessage optional_import_message = 20;

optional NestedEnum optional_nested_enum = 21;
optional ForeignEnum optional_foreign_enum = 22;
optional protobuf_unittest_import.ImportEnum optional_import_enum = 23;
optional swift_proto_testing.import.ImportEnum optional_import_enum = 23;

optional string optional_string_piece = 24 [ctype=STRING_PIECE];
optional string optional_cord = 25 [ctype=CORD];

// Defined in unittest_import_public.proto
optional protobuf_unittest_import.PublicImportMessage
optional swift_proto_testing.import.PublicImportMessage
optional_public_import_message = 26;

optional NestedMessage optional_lazy_message = 27 [lazy=true];
Expand Down Expand Up @@ -121,11 +121,11 @@ message TestAllTypes {

repeated NestedMessage repeated_nested_message = 48;
repeated ForeignMessage repeated_foreign_message = 49;
repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50;
repeated swift_proto_testing.import.ImportMessage repeated_import_message = 50;

repeated NestedEnum repeated_nested_enum = 51;
repeated ForeignEnum repeated_foreign_enum = 52;
repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
repeated swift_proto_testing.import.ImportEnum repeated_import_enum = 53;

repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
repeated string repeated_cord = 55 [ctype=CORD];
Expand All @@ -151,7 +151,7 @@ message TestAllTypes {

optional NestedEnum default_nested_enum = 81 [default = BAR ];
optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
optional protobuf_unittest_import.ImportEnum
optional swift_proto_testing.import.ImportEnum
default_import_enum = 83 [default = IMPORT_BAR];

optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"];
Expand Down Expand Up @@ -216,18 +216,18 @@ extend TestAllExtensions {

optional TestAllTypes.NestedMessage optional_nested_message_extension = 18;
optional ForeignMessage optional_foreign_message_extension = 19;
optional protobuf_unittest_import.ImportMessage
optional swift_proto_testing.import.ImportMessage
optional_import_message_extension = 20;

optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21;
optional ForeignEnum optional_foreign_enum_extension = 22;
optional protobuf_unittest_import.ImportEnum
optional swift_proto_testing.import.ImportEnum
optional_import_enum_extension = 23;

optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE];
optional string optional_cord_extension = 25 [ctype=CORD];

optional protobuf_unittest_import.PublicImportMessage
optional swift_proto_testing.import.PublicImportMessage
optional_public_import_message_extension = 26;

optional TestAllTypes.NestedMessage
Expand Down Expand Up @@ -258,12 +258,12 @@ extend TestAllExtensions {

repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48;
repeated ForeignMessage repeated_foreign_message_extension = 49;
repeated protobuf_unittest_import.ImportMessage
repeated swift_proto_testing.import.ImportMessage
repeated_import_message_extension = 50;

repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51;
repeated ForeignEnum repeated_foreign_enum_extension = 52;
repeated protobuf_unittest_import.ImportEnum
repeated swift_proto_testing.import.ImportEnum
repeated_import_enum_extension = 53;

repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE];
Expand Down Expand Up @@ -293,7 +293,7 @@ extend TestAllExtensions {
default_nested_enum_extension = 81 [default = BAR];
optional ForeignEnum
default_foreign_enum_extension = 82 [default = FOREIGN_BAR];
optional protobuf_unittest_import.ImportEnum
optional swift_proto_testing.import.ImportEnum
default_import_enum_extension = 83 [default = IMPORT_BAR];

optional string default_string_piece_extension = 84 [ctype=STRING_PIECE,
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/unittest_import.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

syntax = "proto2";

package protobuf_unittest_import;
package swift_proto_testing.import;

// Test public import
import public "unittest_import_public.proto";
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/unittest_import_public.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

syntax = "proto2";

package protobuf_unittest_import;
package swift_proto_testing.import;

message PublicImportMessage {
optional int32 e = 1;
Expand Down
10 changes: 5 additions & 5 deletions Protos/SwiftProtobufTests/unittest_mset.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ syntax = "proto2";

import "unittest_mset_wire_format.proto";

package protobuf_unittest;
package swift_proto_testing;

message TestMessageSetContainer {
optional proto2_wireformat_unittest.TestMessageSet message_set = 1;
optional swift_proto_testing.wire_format.TestMessageSet message_set = 1;
}

message TestMessageSetExtension1 {
extend proto2_wireformat_unittest.TestMessageSet {
extend swift_proto_testing.wire_format.TestMessageSet {
optional TestMessageSetExtension1 message_set_extension = 1545008;
}
optional int32 i = 15;
optional proto2_wireformat_unittest.TestMessageSet recursive = 16;
optional swift_proto_testing.wire_format.TestMessageSet recursive = 16;
optional string test_aliasing = 17 [ctype = STRING_PIECE];
}

message TestMessageSetExtension2 {
extend proto2_wireformat_unittest.TestMessageSet {
extend swift_proto_testing.wire_format.TestMessageSet {
optional TestMessageSetExtension2 message_set_extension = 1547769;
}
optional string str = 25;
Expand Down
2 changes: 1 addition & 1 deletion Protos/SwiftProtobufTests/unittest_mset_wire_format.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

syntax = "proto2";

package proto2_wireformat_unittest;
package swift_proto_testing.wire_format;

// A message with message_set_wire_format.
message TestMessageSet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

syntax = "proto3";

package proto3_preserve_unknown_enum_unittest;
package swift_proto_testing.unknown_enum.proto3;

enum MyEnum {
FOO = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

syntax = "proto2";

package proto2_preserve_unknown_enum_unittest;
package swift_proto_testing.unknown_enum.proto2;

enum MyEnum {
FOO = 0;
Expand Down
Loading

0 comments on commit 37a0e0b

Please sign in to comment.