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
08c84b90
Commit
08c84b90
authored
Oct 01, 2011
by
csharptest
Committed by
rogerk
Oct 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit test correction for types that were moved to different proto files
parent
af112a9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
43 deletions
+46
-43
AbstractMessageTest.cs
src/ProtocolBuffers.Test/AbstractMessageTest.cs
+1
-0
ProtocolBuffers.Test.csproj
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+1
-0
TestUtil.cs
src/ProtocolBuffers.Test/TestUtil.cs
+43
-43
ExtendableMessageLiteTest.cs
src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs
+1
-0
No files found.
src/ProtocolBuffers.Test/AbstractMessageTest.cs
View file @
08c84b90
...
...
@@ -133,6 +133,7 @@ namespace Google.ProtocolBuffers
byte
[]
bytes
=
TestUtil
.
GetPackedSet
().
ToByteArray
();
ExtensionRegistry
registry
=
ExtensionRegistry
.
CreateInstance
();
UnitTestProtoFile
.
RegisterAllExtensions
(
registry
);
UnitTestExtrasProtoFile
.
RegisterAllExtensions
(
registry
);
TestUnpackedExtensions
message
=
TestUnpackedExtensions
.
ParseFrom
(
bytes
,
registry
);
TestUtil
.
AssertUnpackedExtensionsSet
(
message
);
}
...
...
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
View file @
08c84b90
...
...
@@ -88,6 +88,7 @@
</Compile>
<Compile
Include=
"Compatibility\TextCompatibilityTests.cs"
/>
<Compile
Include=
"Compatibility\XmlCompatibilityTests.cs"
/>
<Compile
Include=
"TestProtos\UnitTestExtrasProtoFile.cs"
/>
<Compile
Include=
"TestRpcForMimeTypes.cs"
/>
<Compile
Include=
"TestReaderForUrlEncoded.cs"
/>
<Compile
Include=
"CSharpOptionsTest.cs"
/>
...
...
src/ProtocolBuffers.Test/TestUtil.cs
View file @
08c84b90
...
...
@@ -1690,49 +1690,49 @@ namespace Google.ProtocolBuffers
public
static
void
AssertUnpackedExtensionsSet
(
TestUnpackedExtensions
message
)
{
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedInt32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedInt64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedUint32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedUint64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedSint32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedSint64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedFixed32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedFixed64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedSfixed32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedSfixed64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedFloatExtension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedDoubleExtension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedBoolExtension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTestProtoFile
.
UnpackedEnumExtension
));
Assert
.
AreEqual
(
601
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedInt32Extension
,
0
));
Assert
.
AreEqual
(
602L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedInt64Extension
,
0
));
Assert
.
AreEqual
(
603
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedUint32Extension
,
0
));
Assert
.
AreEqual
(
604L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedUint64Extension
,
0
));
Assert
.
AreEqual
(
605
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSint32Extension
,
0
));
Assert
.
AreEqual
(
606L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSint64Extension
,
0
));
Assert
.
AreEqual
(
607
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedFixed32Extension
,
0
));
Assert
.
AreEqual
(
608L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedFixed64Extension
,
0
));
Assert
.
AreEqual
(
609
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSfixed32Extension
,
0
));
Assert
.
AreEqual
(
610L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSfixed64Extension
,
0
));
Assert
.
AreEqual
(
611F
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedFloatExtension
,
0
));
Assert
.
AreEqual
(
612D
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedDoubleExtension
,
0
));
Assert
.
AreEqual
(
true
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedBoolExtension
,
0
));
Assert
.
AreEqual
(
ForeignEnum
.
FOREIGN_BAR
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedEnumExtension
,
0
));
Assert
.
AreEqual
(
701
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedInt32Extension
,
1
));
Assert
.
AreEqual
(
702L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedInt64Extension
,
1
));
Assert
.
AreEqual
(
703
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedUint32Extension
,
1
));
Assert
.
AreEqual
(
704L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedUint64Extension
,
1
));
Assert
.
AreEqual
(
705
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSint32Extension
,
1
));
Assert
.
AreEqual
(
706L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSint64Extension
,
1
));
Assert
.
AreEqual
(
707
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedFixed32Extension
,
1
));
Assert
.
AreEqual
(
708L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedFixed64Extension
,
1
));
Assert
.
AreEqual
(
709
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSfixed32Extension
,
1
));
Assert
.
AreEqual
(
710L
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedSfixed64Extension
,
1
));
Assert
.
AreEqual
(
711F
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedFloatExtension
,
1
));
Assert
.
AreEqual
(
712D
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedDoubleExtension
,
1
));
Assert
.
AreEqual
(
false
,
message
.
GetExtension
(
UnitTestProtoFile
.
UnpackedBoolExtension
,
1
));
Assert
.
AreEqual
(
ForeignEnum
.
FOREIGN_BAZ
,
message
.
GetExtension
(
UnitTest
ProtoFile
.
UnpackedEnumExtension
,
1
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedInt32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedInt64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedUint32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedUint64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedSint32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedSint64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedFixed32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedFixed64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedSfixed32Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedSfixed64Extension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedFloatExtension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedDoubleExtension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedBoolExtension
));
Assert
.
AreEqual
(
2
,
message
.
GetExtensionCount
(
UnitTest
Extras
ProtoFile
.
UnpackedEnumExtension
));
Assert
.
AreEqual
(
601
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedInt32Extension
,
0
));
Assert
.
AreEqual
(
602L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedInt64Extension
,
0
));
Assert
.
AreEqual
(
603
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedUint32Extension
,
0
));
Assert
.
AreEqual
(
604L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedUint64Extension
,
0
));
Assert
.
AreEqual
(
605
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSint32Extension
,
0
));
Assert
.
AreEqual
(
606L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSint64Extension
,
0
));
Assert
.
AreEqual
(
607
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedFixed32Extension
,
0
));
Assert
.
AreEqual
(
608L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedFixed64Extension
,
0
));
Assert
.
AreEqual
(
609
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSfixed32Extension
,
0
));
Assert
.
AreEqual
(
610L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSfixed64Extension
,
0
));
Assert
.
AreEqual
(
611F
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedFloatExtension
,
0
));
Assert
.
AreEqual
(
612D
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedDoubleExtension
,
0
));
Assert
.
AreEqual
(
true
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedBoolExtension
,
0
));
Assert
.
AreEqual
(
UnpackedExtensions
ForeignEnum
.
FOREIGN_BAR
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedEnumExtension
,
0
));
Assert
.
AreEqual
(
701
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedInt32Extension
,
1
));
Assert
.
AreEqual
(
702L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedInt64Extension
,
1
));
Assert
.
AreEqual
(
703
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedUint32Extension
,
1
));
Assert
.
AreEqual
(
704L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedUint64Extension
,
1
));
Assert
.
AreEqual
(
705
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSint32Extension
,
1
));
Assert
.
AreEqual
(
706L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSint64Extension
,
1
));
Assert
.
AreEqual
(
707
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedFixed32Extension
,
1
));
Assert
.
AreEqual
(
708L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedFixed64Extension
,
1
));
Assert
.
AreEqual
(
709
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSfixed32Extension
,
1
));
Assert
.
AreEqual
(
710L
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedSfixed64Extension
,
1
));
Assert
.
AreEqual
(
711F
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedFloatExtension
,
1
));
Assert
.
AreEqual
(
712D
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedDoubleExtension
,
1
));
Assert
.
AreEqual
(
false
,
message
.
GetExtension
(
UnitTest
Extras
ProtoFile
.
UnpackedBoolExtension
,
1
));
Assert
.
AreEqual
(
UnpackedExtensionsForeignEnum
.
FOREIGN_BAZ
,
message
.
GetExtension
(
UnitTestExtras
ProtoFile
.
UnpackedEnumExtension
,
1
));
}
private
static
ByteString
goldenPackedFieldsMessage
=
null
;
...
...
src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs
View file @
08c84b90
...
...
@@ -348,6 +348,7 @@ namespace Google.ProtocolBuffers
ExtensionRegistry
registry
=
ExtensionRegistry
.
CreateInstance
();
UnitTestLiteProtoFile
.
RegisterAllExtensions
(
registry
);
UnitTestExtrasLiteProtoFile
.
RegisterAllExtensions
(
registry
);
TestUnpackedExtensionsLite
unpacked
=
TestUnpackedExtensionsLite
.
ParseFrom
(
original
.
ToByteArray
(),
registry
);
...
...
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