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
134242bc
Commit
134242bc
authored
May 04, 2019
by
Sydney Acksman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change input message to UnknownFieldSet tests to proto2 test message to test groups.
parent
cd655354
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
UnknownFieldSetTest.cs
csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs
+8
-7
No files found.
csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs
View file @
134242bc
...
...
@@ -33,6 +33,7 @@
using
System
;
using
System.IO
;
using
Google.Protobuf.TestProtos
;
using
Proto2
=
Google
.
Protobuf
.
TestProtos
.
Proto2
;
using
NUnit.Framework
;
namespace
Google.Protobuf
...
...
@@ -62,13 +63,13 @@ namespace Google.Protobuf
[
Test
]
public
void
TestMergeCodedInput
()
{
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
message
=
SampleMessages
.
CreateFullTestAllTypes
Proto2
();
var
emptyMessage
=
new
TestEmptyMessage
();
emptyMessage
.
MergeFrom
(
message
.
ToByteArray
());
Assert
.
AreEqual
(
message
.
CalculateSize
(),
emptyMessage
.
CalculateSize
());
Assert
.
AreEqual
(
message
.
ToByteArray
(),
emptyMessage
.
ToByteArray
());
var
newMessage
=
new
TestAllTypes
();
var
newMessage
=
new
Proto2
.
TestAllTypes
();
newMessage
.
MergeFrom
(
emptyMessage
.
ToByteArray
());
Assert
.
AreEqual
(
message
,
newMessage
);
Assert
.
AreEqual
(
message
.
CalculateSize
(),
newMessage
.
CalculateSize
());
...
...
@@ -77,7 +78,7 @@ namespace Google.Protobuf
[
Test
]
public
void
TestMergeMessage
()
{
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
message
=
SampleMessages
.
CreateFullTestAllTypes
Proto2
();
var
emptyMessage
=
new
TestEmptyMessage
();
var
otherEmptyMessage
=
new
TestEmptyMessage
();
emptyMessage
.
MergeFrom
(
message
.
ToByteArray
());
...
...
@@ -90,7 +91,7 @@ namespace Google.Protobuf
[
Test
]
public
void
TestEquals
()
{
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
message
=
SampleMessages
.
CreateFullTestAllTypes
Proto2
();
var
emptyMessage
=
new
TestEmptyMessage
();
var
otherEmptyMessage
=
new
TestEmptyMessage
();
Assert
.
AreEqual
(
emptyMessage
,
otherEmptyMessage
);
...
...
@@ -103,7 +104,7 @@ namespace Google.Protobuf
[
Test
]
public
void
TestHashCode
()
{
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
message
=
SampleMessages
.
CreateFullTestAllTypes
Proto2
();
var
emptyMessage
=
new
TestEmptyMessage
();
int
hashCode
=
emptyMessage
.
GetHashCode
();
emptyMessage
.
MergeFrom
(
message
.
ToByteArray
());
...
...
@@ -119,7 +120,7 @@ namespace Google.Protobuf
Assert
.
AreEqual
(
emptyMessage
.
CalculateSize
(),
otherEmptyMessage
.
CalculateSize
());
Assert
.
AreEqual
(
emptyMessage
.
ToByteArray
(),
otherEmptyMessage
.
ToByteArray
());
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
message
=
SampleMessages
.
CreateFullTestAllTypes
Proto2
();
emptyMessage
.
MergeFrom
(
message
.
ToByteArray
());
otherEmptyMessage
=
emptyMessage
.
Clone
();
Assert
.
AreEqual
(
message
.
CalculateSize
(),
otherEmptyMessage
.
CalculateSize
());
...
...
@@ -129,7 +130,7 @@ namespace Google.Protobuf
[
Test
]
public
void
TestDiscardUnknownFields
()
{
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
message
=
SampleMessages
.
CreateFullTestAllTypes
Proto2
();
var
goldenEmptyMessage
=
new
TestEmptyMessage
();
byte
[]
data
=
message
.
ToByteArray
();
int
fullSize
=
message
.
CalculateSize
();
...
...
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