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
19ed9c07
Commit
19ed9c07
authored
Aug 14, 2008
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UnknownFieldSet tests, and a fix to repeated extension elements.
parent
a80a37cc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
4 deletions
+39
-4
MessageTest.cs
csharp/ProtocolBuffers.Test/MessageTest.cs
+5
-2
ProtocolBuffers.Test.csproj
csharp/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+3
-0
ServiceTest.cs
csharp/ProtocolBuffers.Test/ServiceTest.cs
+10
-0
TextFormatTest.cs
csharp/ProtocolBuffers.Test/TextFormatTest.cs
+10
-0
UnknownFieldSetTest.cs
csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs
+0
-0
AbstractBuilder.cs
csharp/ProtocolBuffers/AbstractBuilder.cs
+5
-0
GeneratedExtensionBase.cs
csharp/ProtocolBuffers/GeneratedExtensionBase.cs
+2
-1
GeneratedRepeatException.cs
csharp/ProtocolBuffers/GeneratedRepeatException.cs
+1
-1
IBuilder.cs
csharp/ProtocolBuffers/IBuilder.cs
+3
-0
No files found.
csharp/ProtocolBuffers.Test/MessageTest.cs
View file @
19ed9c07
...
...
@@ -58,8 +58,11 @@ namespace Google.ProtocolBuffers {
Assert
.
AreEqual
(
MergeResultText
,
result
.
ToString
());
}
/** Test merging two DynamicMessages. */
public
void
testDynamicMergeFrom
()
{
/// <summary>
/// Test merging two DynamicMessages.
/// </summary>
[
Test
]
public
void
DynamicMergeFrom
()
{
DynamicMessage
result
=
(
DynamicMessage
)
DynamicMessage
.
CreateBuilder
(
MergeDest
)
.
MergeFrom
((
DynamicMessage
)
DynamicMessage
.
CreateBuilder
(
MergeSource
).
Build
())
.
Build
();
...
...
csharp/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
View file @
19ed9c07
...
...
@@ -54,6 +54,7 @@
<Compile
Include=
"MessageTest.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"ReflectionTester.cs"
/>
<Compile
Include=
"ServiceTest.cs"
/>
<Compile
Include=
"TestProtos\EnumWithNoOuter.cs"
/>
<Compile
Include=
"TestProtos\MessageWithNoOuter.cs"
/>
<Compile
Include=
"TestProtos\MultiFileProto.cs"
/>
...
...
@@ -64,6 +65,8 @@
<Compile
Include=
"TestProtos\UnitTestOptimizeForProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestProtoFile.cs"
/>
<Compile
Include=
"TestUtil.cs"
/>
<Compile
Include=
"TextFormatTest.cs"
/>
<Compile
Include=
"UnknownFieldSetTest.cs"
/>
<Compile
Include=
"WireFormatTest.cs"
/>
</ItemGroup>
<ItemGroup>
...
...
csharp/ProtocolBuffers.Test/ServiceTest.cs
0 → 100644
View file @
19ed9c07
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
NUnit.Framework
;
namespace
Google.ProtocolBuffers
{
[
TestFixture
]
public
class
ServiceTest
{
}
}
csharp/ProtocolBuffers.Test/TextFormatTest.cs
0 → 100644
View file @
19ed9c07
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
NUnit.Framework
;
namespace
Google.ProtocolBuffers
{
[
TestFixture
]
public
class
TextFormatTest
{
}
}
csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs
0 → 100644
View file @
19ed9c07
This diff is collapsed.
Click to expand it.
csharp/ProtocolBuffers/AbstractBuilder.cs
View file @
19ed9c07
...
...
@@ -84,6 +84,11 @@ namespace Google.ProtocolBuffers {
}
#
endregion
public
TBuilder
SetUnknownFields
(
UnknownFieldSet
fields
)
{
UnknownFields
=
fields
;
return
ThisBuilder
;
}
public
virtual
TBuilder
Clear
()
{
foreach
(
FieldDescriptor
field
in
AllFields
.
Keys
)
{
ClearField
(
field
);
...
...
csharp/ProtocolBuffers/GeneratedExtensionBase.cs
View file @
19ed9c07
...
...
@@ -78,7 +78,8 @@ namespace Google.ProtocolBuffers {
}
case
MappedType
.
Enum
:
// Just return a boxed int - that can be unboxed to the enum
return
((
EnumValueDescriptor
)
value
).
Number
;
EnumValueDescriptor
enumValue
=
(
EnumValueDescriptor
)
value
;
return
enumValue
.
Number
;
default
:
return
value
;
}
...
...
csharp/ProtocolBuffers/GeneratedRepeatException.cs
View file @
19ed9c07
...
...
@@ -31,7 +31,7 @@ namespace Google.ProtocolBuffers {
// Must convert the whole list.
List
<
TExtensionElement
>
result
=
new
List
<
TExtensionElement
>();
foreach
(
object
element
in
(
IEnumerable
)
value
)
{
((
IList
)
result
).
Add
(
SingularFromReflectionType
(
element
));
result
.
Add
((
TExtensionElement
)
SingularFromReflectionType
(
element
));
}
return
result
;
}
else
{
...
...
csharp/ProtocolBuffers/IBuilder.cs
View file @
19ed9c07
...
...
@@ -123,6 +123,9 @@ namespace Google.ProtocolBuffers {
public
interface
IBuilder
<
TMessage
,
TBuilder
>
:
IBuilder
where
TMessage
:
IMessage
<
TMessage
,
TBuilder
>
where
TBuilder
:
IBuilder
<
TMessage
,
TBuilder
>
{
TBuilder
SetUnknownFields
(
UnknownFieldSet
unknownFields
);
/// <summary>
/// Resets all fields to their default values.
/// </summary>
...
...
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