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
50a89c1c
Commit
50a89c1c
authored
Aug 12, 2011
by
csharptest
Committed by
rogerk
Aug 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed removal of all '_' from names, Added unit test.
parent
c7b23c17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
11 deletions
+95
-11
build.csproj
build/build.csproj
+4
-0
unittest_issues.proto
protos/extest/unittest_issues.proto
+82
-0
ProtocolBuffers.Test.csproj
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+1
-0
UnitTestExtrasIssuesProtoFile.cs
...lBuffers.Test/TestProtos/UnitTestExtrasIssuesProtoFile.cs
+0
-0
NameHelpers.cs
src/ProtocolBuffers/NameHelpers.cs
+2
-2
ProtocolBuffers2008.sln
src/ProtocolBuffers2008.sln
+6
-9
No files found.
build/build.csproj
View file @
50a89c1c
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
<WorkingDirectories
Include=
"$(BuildTempDirectory)"
/>
<WorkingDirectories
Include=
"$(BuildTempDirectory)"
/>
<WorkingDirectories
Include=
"$(BuildOutputDirectory)"
/>
<WorkingDirectories
Include=
"$(BuildOutputDirectory)"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_issues.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras_full.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras_full.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras_lite.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras_lite.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras_xmltest.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\extest\unittest_extras_xmltest.proto"
/>
...
@@ -71,6 +72,9 @@
...
@@ -71,6 +72,9 @@
<TargetDirectory>
$(SourceDirectory)\AddressBook
</TargetDirectory>
<TargetDirectory>
$(SourceDirectory)\AddressBook
</TargetDirectory>
</GeneratedSource>
</GeneratedSource>
<!-- Unit test -->
<!-- Unit test -->
<GeneratedSource
Include=
"$(BuildTempDirectory)\UnitTestExtrasIssuesProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<GeneratedSource
Include=
"$(BuildTempDirectory)\UnitTestXmlSerializerTestProtoFile.cs"
>
<GeneratedSource
Include=
"$(BuildTempDirectory)\UnitTestXmlSerializerTestProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
</GeneratedSource>
...
...
protos/extest/unittest_issues.proto
0 → 100644
View file @
50a89c1c
// These proto descriptors have at one time been reported as an issue or defect.
// They are kept here to replicate the issue, and continue to verify the fix.
import
"google/protobuf/csharp_options.proto"
;
// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified
option
(
google.protobuf.csharp_file_options
)
.
namespace
=
"UnitTest.Issues.TestProtos"
;
option
(
google.protobuf.csharp_file_options
)
.
umbrella_classname
=
"UnitTestExtrasIssuesProtoFile"
;
package
unittest_issues
;
option
optimize_for
=
SPEED
;
// The following is a representative set of features
/*
enum EnumOptions {
ONE = 0;
TWO = 1;
THREE = 2;
}
message TestBasicChild
{
repeated EnumOptions options = 3;
optional bytes binary = 4;
}
message TestBasicNoFields {
}
message TestBasicRescursive {
optional TestBasicRescursive child = 1;
}
message TestBasicMessage {
optional int64 number = 6;
repeated int32 numbers = 2;
optional string text = 3;
repeated string textlines = 700;
optional bool valid = 5;
optional TestBasicChild child = 1;
repeated group Children = 401
{
repeated EnumOptions options = 3;
optional bytes binary = 4;
}
extensions 100 to 199;
}
message TestBasicExtension {
required int32 number = 1;
}
extend TestBasicMessage {
optional EnumOptions extension_enum = 101;
optional string extension_text = 102;
repeated int32 extension_number = 103 [packed = true];
optional TestBasicExtension extension_message = 199;
}
// Issue for non-qualified type reference in new services generation
option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH;
service TestGenericService {
rpc Foo(TestBasicNoFields) returns (TestBasicMessage);
rpc Bar(TestBasicNoFields) returns (TestBasicMessage);
}
*/
// Issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
message
A
{
optional
int32
_A
=
1
;
}
message
B
{
optional
int32
B_
=
1
;
}
message
AB
{
optional
int32
a_b
=
1
;
}
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
View file @
50a89c1c
...
@@ -104,6 +104,7 @@
...
@@ -104,6 +104,7 @@
<Compile
Include=
"TestProtos\UnitTestCustomOptionsProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestCustomOptionsProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestEmbedOptimizeForProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestEmbedOptimizeForProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestEmptyProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestEmptyProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestExtrasIssuesProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestGenericServices.cs"
/>
<Compile
Include=
"TestProtos\UnitTestGenericServices.cs"
/>
<Compile
Include=
"TestProtos\UnitTestGoogleSizeProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestGoogleSizeProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestGoogleSpeedProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestGoogleSpeedProtoFile.cs"
/>
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasIssuesProtoFile.cs
0 → 100644
View file @
50a89c1c
This diff is collapsed.
Click to expand it.
src/ProtocolBuffers/NameHelpers.cs
View file @
50a89c1c
...
@@ -102,12 +102,12 @@ namespace Google.ProtocolBuffers
...
@@ -102,12 +102,12 @@ namespace Google.ProtocolBuffers
/// <summary>
/// <summary>
/// Similar to UnderlineToCamel, but also matches the first character if it is lower-case
/// Similar to UnderlineToCamel, but also matches the first character if it is lower-case
/// </summary>
/// </summary>
private
static
Regex
UnderlineToPascal
=
new
Regex
(
@"(?:
^|[0-9_])[a-z]
"
);
private
static
Regex
UnderlineToPascal
=
new
Regex
(
@"(?:
(?:^|[0-9_])[a-z])|_
"
);
/// <summary>
/// <summary>
/// Matches lower-case character that follow either an underscore, or a number
/// Matches lower-case character that follow either an underscore, or a number
/// </summary>
/// </summary>
private
static
Regex
UnderlineToCamel
=
new
Regex
(
@"
[0-9_][a-z]
"
);
private
static
Regex
UnderlineToCamel
=
new
Regex
(
@"
(?:[0-9_][a-z])|_
"
);
/// <summary>
/// <summary>
/// Used for text-template transformation where a regex match is replaced in the input string.
/// Used for text-template transformation where a regex match is replaced in the input string.
...
...
src/ProtocolBuffers2008.sln
View file @
50a89c1c
...
@@ -23,6 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8
...
@@ -23,6 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8
..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto
..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto
..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto
..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto
..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto
..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto
..\protos\extest\unittest_issues.proto = ..\protos\extest\unittest_issues.proto
..\protos\google\protobuf\unittest_lite.proto = ..\protos\google\protobuf\unittest_lite.proto
..\protos\google\protobuf\unittest_lite.proto = ..\protos\google\protobuf\unittest_lite.proto
..\protos\google\protobuf\unittest_lite_imports_nonlite.proto = ..\protos\google\protobuf\unittest_lite_imports_nonlite.proto
..\protos\google\protobuf\unittest_lite_imports_nonlite.proto = ..\protos\google\protobuf\unittest_lite_imports_nonlite.proto
..\protos\google\protobuf\unittest_mset.proto = ..\protos\google\protobuf\unittest_mset.proto
..\protos\google\protobuf\unittest_mset.proto = ..\protos\google\protobuf\unittest_mset.proto
...
@@ -67,7 +68,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950
...
@@ -67,7 +68,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950
..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat
..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat
EndProjectSection
EndProjectSection
EndProject
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4
a
39-986C-AD7F270F4750}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4
A
39-986C-AD7F270F4750}"
EndProject
EndProject
Global
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfigurationPlatforms) = preSolution
...
@@ -147,14 +148,10 @@ Global
...
@@ -147,14 +148,10 @@ Global
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug_Silverlight2|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug_Silverlight2|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.Build.0 = Debug_Silverlight2|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.ActiveCfg = Release_Silverlight2|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.ActiveCfg = Release_Silverlight2|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.Build.0 = Release_Silverlight2|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231391AF-449C-4a39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
...
...
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