Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
145033c0
Commit
145033c0
authored
Nov 27, 2019
by
Sydney Acksman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust based on review feedback
parent
cd11d541
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
69 deletions
+77
-69
generate_protos.sh
csharp/generate_protos.sh
+4
-4
extensions_b.proto
csharp/protos/extensions/extensions_b.proto
+0
-13
extensions_issue6936_a.proto
csharp/protos/extensions_issue6936_a.proto
+5
-2
extensions_issue6936_b.proto
csharp/protos/extensions_issue6936_b.proto
+15
-0
extensions_issue6936_c.proto
csharp/protos/extensions_issue6936_c.proto
+7
-4
ExtensionsIssue6936A.cs
...c/Google.Protobuf.Test.TestProtos/ExtensionsIssue6936A.cs
+13
-13
ExtensionsIssue6936B.cs
...c/Google.Protobuf.Test.TestProtos/ExtensionsIssue6936B.cs
+12
-12
ExtensionsIssue6936C.cs
...c/Google.Protobuf.Test.TestProtos/ExtensionsIssue6936C.cs
+18
-17
CustomOptionsTest.cs
.../src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs
+3
-4
testprotos.pb
csharp/src/Google.Protobuf.Test/testprotos.pb
+0
-0
No files found.
csharp/generate_protos.sh
View file @
145033c0
...
...
@@ -44,7 +44,7 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \
# Note that this deliberately does *not* include old_extensions1.proto
# and old_extensions2.proto, which are generated with an older version
# of protoc.
$PROTOC
-Isrc
-Icsharp
/protos
-Icsharp
/protos/extensions
\
$PROTOC
-Isrc
-Icsharp
/protos
\
--csharp_out
=
csharp/src/Google.Protobuf.Test.TestProtos
\
--descriptor_set_out
=
csharp/src/Google.Protobuf.Test/testprotos.pb
\
--include_source_info
\
...
...
@@ -58,9 +58,9 @@ $PROTOC -Isrc -Icsharp/protos -Icsharp/protos/extensions \
unittest.proto
\
unittest_import.proto
\
unittest_import_public.proto
\
extensions_a.proto
\
extensions_b.proto
\
extensions_c.proto
\
extensions_
issue6936_
a.proto
\
extensions_
issue6936_
b.proto
\
extensions_
issue6936_
c.proto
\
google/protobuf/unittest_well_known_types.proto
\
google/protobuf/test_messages_proto3.proto
\
google/protobuf/test_messages_proto2.proto
...
...
csharp/protos/extensions/extensions_b.proto
deleted
100644 → 0
View file @
cd11d541
syntax
=
"proto3"
;
import
"extensions_a.proto"
;
option
csharp_namespace
=
"Google.Protobuf.TestProtos.Extensions"
;
// This file is used as part of a unit test for issue 6936
// We don't need to use it, we just have to import it in c
message
Foo
{
option
(
opt
)
=
"bar"
;
}
\ No newline at end of file
csharp/protos/extensions
/extensions
_a.proto
→
csharp/protos/extensions
_issue6936
_a.proto
View file @
145033c0
syntax
=
"proto3"
;
option
csharp_namespace
=
"Google.Protobuf.TestProtos.Extensions"
;
package
unittest_issues
;
option
csharp_namespace
=
"UnitTest.Issues.TestProtos"
;
// This file is used as part of a unit test for issue 6936
// We don't need to use it, we just have to import it in both b and c
// We don't need to use it, we just have to import it in both
// "extensions_issue6936_b.proto" and "extensions_issue6936_c.proto"
import
"google/protobuf/descriptor.proto"
;
...
...
csharp/protos/extensions_issue6936_b.proto
0 → 100644
View file @
145033c0
syntax
=
"proto3"
;
import
"extensions_issue6936_a.proto"
;
package
unittest_issues
;
option
csharp_namespace
=
"UnitTest.Issues.TestProtos"
;
// This file is used as part of a unit test for issue 6936
// We don't need to use it, we just have to import it in "extensions_issue6936_c.proto"
message
Foo
{
option
(
opt
)
=
"foo"
;
}
\ No newline at end of file
csharp/protos/extensions
/extensions
_c.proto
→
csharp/protos/extensions
_issue6936
_c.proto
View file @
145033c0
syntax
=
"proto3"
;
import
"extensions_a.proto"
;
import
"extensions_b.proto"
;
import
"extensions_
issue6936_
a.proto"
;
import
"extensions_
issue6936_
b.proto"
;
option
csharp_namespace
=
"Google.Protobuf.TestProtos.Extensions"
;
package
unittest_issues
;
option
csharp_namespace
=
"UnitTest.Issues.TestProtos"
;
// This file is used as part of a unit test for issue 6936
// We don't need to use it, we just have to load it at runtime
message
Bar
{
option
(
opt
)
=
"
foo
"
;
option
(
opt
)
=
"
bar
"
;
Foo
foo
=
1
;
}
\ No newline at end of file
csharp/src/Google.Protobuf.Test.TestProtos/ExtensionsA.cs
→
csharp/src/Google.Protobuf.Test.TestProtos/Extensions
Issue6936
A.cs
View file @
145033c0
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: extensions_a.proto
// source: extensions_
issue6936_
a.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
...
...
@@ -9,34 +9,34 @@ using pb = global::Google.Protobuf;
using
pbc
=
global
::
Google
.
Protobuf
.
Collections
;
using
pbr
=
global
::
Google
.
Protobuf
.
Reflection
;
using
scg
=
global
::
System
.
Collections
.
Generic
;
namespace
Google.Protobuf.TestProtos.Extension
s
{
namespace
UnitTest.Issues.TestProto
s
{
/// <summary>Holder for reflection information generated from extensions_a.proto</summary>
public
static
partial
class
ExtensionsAReflection
{
/// <summary>Holder for reflection information generated from extensions_
issue6936_
a.proto</summary>
public
static
partial
class
Extensions
Issue6936
AReflection
{
#
region
Descriptor
/// <summary>File descriptor for extensions_a.proto</summary>
/// <summary>File descriptor for extensions_
issue6936_
a.proto</summary>
public
static
pbr
::
FileDescriptor
Descriptor
{
get
{
return
descriptor
;
}
}
private
static
pbr
::
FileDescriptor
descriptor
;
static
ExtensionsAReflection
()
{
static
Extensions
Issue6936
AReflection
()
{
byte
[]
descriptorData
=
global
::
System
.
Convert
.
FromBase64String
(
string
.
Concat
(
"Ch
JleHRlbnNpb25zX2EucHJvdG8aIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlw
"
,
"
dG9yLnByb3RvOi4KA29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0
"
,
"
aW9ucxjQhgMgASgJQiiqAiVHb29nbGUuUHJvdG9idWYuVGVzdFByb3Rvcy5F
"
,
"
eHRlbnNpb25zYgZwcm90bzM=
"
));
"Ch
xleHRlbnNpb25zX2lzc3VlNjkzNl9hLnByb3RvEg91bml0dGVzdF9pc3N1
"
,
"
ZXMaIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvOi4KA29wdBIf
"
,
"
Lmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjQhgMgASgJQh2qAhpV
"
,
"
bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z
"
));
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
Reflection
.
DescriptorReflection
.
Descriptor
,
},
new
pbr
::
GeneratedClrTypeInfo
(
null
,
new
pb
::
Extension
[]
{
ExtensionsAExtensions
.
Opt
},
null
));
new
pbr
::
GeneratedClrTypeInfo
(
null
,
new
pb
::
Extension
[]
{
Extensions
Issue6936
AExtensions
.
Opt
},
null
));
}
#
endregion
}
/// <summary>Holder for extension identifiers generated from the top level of extensions_a.proto</summary>
public
static
partial
class
ExtensionsAExtensions
{
/// <summary>Holder for extension identifiers generated from the top level of extensions_
issue6936_
a.proto</summary>
public
static
partial
class
Extensions
Issue6936
AExtensions
{
public
static
readonly
pb
::
Extension
<
global
::
Google
.
Protobuf
.
Reflection
.
MessageOptions
,
string
>
Opt
=
new
pb
::
Extension
<
global
::
Google
.
Protobuf
.
Reflection
.
MessageOptions
,
string
>(
50000
,
pb
::
FieldCodec
.
ForString
(
400002
,
""
));
}
...
...
csharp/src/Google.Protobuf.Test.TestProtos/ExtensionsB.cs
→
csharp/src/Google.Protobuf.Test.TestProtos/Extensions
Issue6936
B.cs
View file @
145033c0
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: extensions_b.proto
// source: extensions_
issue6936_
b.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
...
...
@@ -9,28 +9,28 @@ using pb = global::Google.Protobuf;
using
pbc
=
global
::
Google
.
Protobuf
.
Collections
;
using
pbr
=
global
::
Google
.
Protobuf
.
Reflection
;
using
scg
=
global
::
System
.
Collections
.
Generic
;
namespace
Google.Protobuf.TestProtos.Extension
s
{
namespace
UnitTest.Issues.TestProto
s
{
/// <summary>Holder for reflection information generated from extensions_b.proto</summary>
public
static
partial
class
ExtensionsBReflection
{
/// <summary>Holder for reflection information generated from extensions_
issue6936_
b.proto</summary>
public
static
partial
class
Extensions
Issue6936
BReflection
{
#
region
Descriptor
/// <summary>File descriptor for extensions_b.proto</summary>
/// <summary>File descriptor for extensions_
issue6936_
b.proto</summary>
public
static
pbr
::
FileDescriptor
Descriptor
{
get
{
return
descriptor
;
}
}
private
static
pbr
::
FileDescriptor
descriptor
;
static
ExtensionsBReflection
()
{
static
Extensions
Issue6936
BReflection
()
{
byte
[]
descriptorData
=
global
::
System
.
Convert
.
FromBase64String
(
string
.
Concat
(
"Ch
JleHRlbnNpb25zX2IucHJvdG8aEmV4dGVuc2lvbnNfYS5wcm90byIOCgNG
"
,
"
b286B4K1GANiYXJCKKoCJUdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zLkV4
"
,
"
dGVuc2lvbnNiBnByb3RvMw==
"
));
"Ch
xleHRlbnNpb25zX2lzc3VlNjkzNl9iLnByb3RvEg91bml0dGVzdF9pc3N1
"
,
"
ZXMaHGV4dGVuc2lvbnNfaXNzdWU2OTM2X2EucHJvdG8iDgoDRm9vOgeCtRgD
"
,
"
Zm9vQh2qAhpVbml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z
"
));
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
Extensions
AReflection
.
Descriptor
,
},
new
pbr
::
FileDescriptor
[]
{
global
::
UnitTest
.
Issues
.
TestProtos
.
ExtensionsIssue6936
AReflection
.
Descriptor
,
},
new
pbr
::
GeneratedClrTypeInfo
(
null
,
null
,
new
pbr
::
GeneratedClrTypeInfo
[]
{
new
pbr
::
GeneratedClrTypeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
Foo
),
global
::
Google
.
Protobuf
.
TestProtos
.
Extension
s
.
Foo
.
Parser
,
null
,
null
,
null
,
null
,
null
)
new
pbr
::
GeneratedClrTypeInfo
(
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
Foo
),
global
::
UnitTest
.
Issues
.
TestProto
s
.
Foo
.
Parser
,
null
,
null
,
null
,
null
,
null
)
}));
}
#
endregion
...
...
@@ -45,7 +45,7 @@ namespace Google.Protobuf.TestProtos.Extensions {
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
]
public
static
pbr
::
MessageDescriptor
Descriptor
{
get
{
return
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
Extensions
BReflection
.
Descriptor
.
MessageTypes
[
0
];
}
get
{
return
global
::
UnitTest
.
Issues
.
TestProtos
.
ExtensionsIssue6936
BReflection
.
Descriptor
.
MessageTypes
[
0
];
}
}
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
]
...
...
csharp/src/Google.Protobuf.Test.TestProtos/ExtensionsC.cs
→
csharp/src/Google.Protobuf.Test.TestProtos/Extensions
Issue6936
C.cs
View file @
145033c0
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: extensions_c.proto
// source: extensions_
issue6936_
c.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
...
...
@@ -9,29 +9,30 @@ using pb = global::Google.Protobuf;
using
pbc
=
global
::
Google
.
Protobuf
.
Collections
;
using
pbr
=
global
::
Google
.
Protobuf
.
Reflection
;
using
scg
=
global
::
System
.
Collections
.
Generic
;
namespace
Google.Protobuf.TestProtos.Extension
s
{
namespace
UnitTest.Issues.TestProto
s
{
/// <summary>Holder for reflection information generated from extensions_c.proto</summary>
public
static
partial
class
ExtensionsCReflection
{
/// <summary>Holder for reflection information generated from extensions_
issue6936_
c.proto</summary>
public
static
partial
class
Extensions
Issue6936
CReflection
{
#
region
Descriptor
/// <summary>File descriptor for extensions_c.proto</summary>
/// <summary>File descriptor for extensions_
issue6936_
c.proto</summary>
public
static
pbr
::
FileDescriptor
Descriptor
{
get
{
return
descriptor
;
}
}
private
static
pbr
::
FileDescriptor
descriptor
;
static
ExtensionsCReflection
()
{
static
Extensions
Issue6936
CReflection
()
{
byte
[]
descriptorData
=
global
::
System
.
Convert
.
FromBase64String
(
string
.
Concat
(
"ChJleHRlbnNpb25zX2MucHJvdG8aEmV4dGVuc2lvbnNfYS5wcm90bxoSZXh0"
,
"ZW5zaW9uc19iLnByb3RvIiEKA0JhchIRCgNmb28YASABKAsyBC5Gb286B4K1"
,
"GANmb29CKKoCJUdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zLkV4dGVuc2lv"
,
"bnNiBnByb3RvMw=="
));
"ChxleHRlbnNpb25zX2lzc3VlNjkzNl9jLnByb3RvEg91bml0dGVzdF9pc3N1"
,
"ZXMaHGV4dGVuc2lvbnNfaXNzdWU2OTM2X2EucHJvdG8aHGV4dGVuc2lvbnNf"
,
"aXNzdWU2OTM2X2IucHJvdG8iMQoDQmFyEiEKA2ZvbxgBIAEoCzIULnVuaXR0"
,
"ZXN0X2lzc3Vlcy5Gb286B4K1GANiYXJCHaoCGlVuaXRUZXN0Lklzc3Vlcy5U"
,
"ZXN0UHJvdG9zYgZwcm90bzM="
));
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
ExtensionsAReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
Extensions
BReflection
.
Descriptor
,
},
new
pbr
::
FileDescriptor
[]
{
global
::
UnitTest
.
Issues
.
TestProtos
.
ExtensionsIssue6936AReflection
.
Descriptor
,
global
::
UnitTest
.
Issues
.
TestProtos
.
ExtensionsIssue6936
BReflection
.
Descriptor
,
},
new
pbr
::
GeneratedClrTypeInfo
(
null
,
null
,
new
pbr
::
GeneratedClrTypeInfo
[]
{
new
pbr
::
GeneratedClrTypeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
Bar
),
global
::
Google
.
Protobuf
.
TestProtos
.
Extension
s
.
Bar
.
Parser
,
new
[]{
"Foo"
},
null
,
null
,
null
,
null
)
new
pbr
::
GeneratedClrTypeInfo
(
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
Bar
),
global
::
UnitTest
.
Issues
.
TestProto
s
.
Bar
.
Parser
,
new
[]{
"Foo"
},
null
,
null
,
null
,
null
)
}));
}
#
endregion
...
...
@@ -46,7 +47,7 @@ namespace Google.Protobuf.TestProtos.Extensions {
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
]
public
static
pbr
::
MessageDescriptor
Descriptor
{
get
{
return
global
::
Google
.
Protobuf
.
TestProtos
.
Extensions
.
Extensions
CReflection
.
Descriptor
.
MessageTypes
[
0
];
}
get
{
return
global
::
UnitTest
.
Issues
.
TestProtos
.
ExtensionsIssue6936
CReflection
.
Descriptor
.
MessageTypes
[
0
];
}
}
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
]
...
...
@@ -74,9 +75,9 @@ namespace Google.Protobuf.TestProtos.Extensions {
/// <summary>Field number for the "foo" field.</summary>
public
const
int
FooFieldNumber
=
1
;
private
global
::
Google
.
Protobuf
.
TestProtos
.
Extension
s
.
Foo
foo_
;
private
global
::
UnitTest
.
Issues
.
TestProto
s
.
Foo
foo_
;
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
]
public
global
::
Google
.
Protobuf
.
TestProtos
.
Extension
s
.
Foo
Foo
{
public
global
::
UnitTest
.
Issues
.
TestProto
s
.
Foo
Foo
{
get
{
return
foo_
;
}
set
{
foo_
=
value
;
...
...
@@ -145,7 +146,7 @@ namespace Google.Protobuf.TestProtos.Extensions {
}
if
(
other
.
foo_
!=
null
)
{
if
(
foo_
==
null
)
{
Foo
=
new
global
::
Google
.
Protobuf
.
TestProtos
.
Extension
s
.
Foo
();
Foo
=
new
global
::
UnitTest
.
Issues
.
TestProto
s
.
Foo
();
}
Foo
.
MergeFrom
(
other
.
Foo
);
}
...
...
@@ -162,7 +163,7 @@ namespace Google.Protobuf.TestProtos.Extensions {
break
;
case
10
:
{
if
(
foo_
==
null
)
{
Foo
=
new
global
::
Google
.
Protobuf
.
TestProtos
.
Extension
s
.
Foo
();
Foo
=
new
global
::
UnitTest
.
Issues
.
TestProto
s
.
Foo
();
}
input
.
ReadMessage
(
Foo
);
break
;
...
...
csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs
View file @
145033c0
...
...
@@ -42,7 +42,6 @@ using static UnitTest.Issues.TestProtos.ComplexOptionType2.Types;
using
static
UnitTest
.
Issues
.
TestProtos
.
UnittestCustomOptionsProto3Extensions
;
using
static
UnitTest
.
Issues
.
TestProtos
.
DummyMessageContainingEnum
.
Types
;
using
Google.Protobuf.TestProtos
;
using
Google.Protobuf.TestProtos.Extensions
;
#pragma warning disable CS0618
...
...
@@ -197,11 +196,11 @@ namespace Google.Protobuf.Test.Reflection
[
Test
]
public
void
MultipleImportOfSameFileWithExtension
()
{
var
descriptor
=
ExtensionsCReflection
.
Descriptor
;
var
descriptor
=
Extensions
Issue6936
CReflection
.
Descriptor
;
var
foo
=
Foo
.
Descriptor
;
var
bar
=
Bar
.
Descriptor
;
AssertOption
(
"
bar"
,
foo
.
CustomOptions
.
TryGetString
,
Extensions
AExtensions
.
Opt
,
foo
.
GetOption
);
AssertOption
(
"
foo"
,
bar
.
CustomOptions
.
TryGetString
,
Extensions
AExtensions
.
Opt
,
bar
.
GetOption
);
AssertOption
(
"
foo"
,
foo
.
CustomOptions
.
TryGetString
,
ExtensionsIssue6936
AExtensions
.
Opt
,
foo
.
GetOption
);
AssertOption
(
"
bar"
,
bar
.
CustomOptions
.
TryGetString
,
ExtensionsIssue6936
AExtensions
.
Opt
,
bar
.
GetOption
);
}
private
void
AssertOption
<
T
,
D
>(
T
expected
,
OptionFetcher
<
T
>
fetcher
,
Extension
<
D
,
T
>
extension
,
Func
<
Extension
<
D
,
T
>,
T
>
descriptorOptionFetcher
)
where
D
:
IExtendableMessage
<
D
>
...
...
csharp/src/Google.Protobuf.Test/testprotos.pb
View file @
145033c0
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment