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
8bd88ea8
Commit
8bd88ea8
authored
Sep 23, 2011
by
csharptest
Committed by
rogerk
Sep 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unit test to repro issue 28
parent
3b625064
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
unittest_issues.proto
protos/extest/unittest_issues.proto
+9
-0
ReusableBuilderTest.cs
src/ProtocolBuffers.Test/ReusableBuilderTest.cs
+13
-0
No files found.
protos/extest/unittest_issues.proto
View file @
8bd88ea8
...
...
@@ -86,3 +86,12 @@ message NumberField {
optional
int32
_01
=
1
;
}
// Issue 28: Circular message dependencies result in null defaults for DefaultInstance
message
MyMessageAReferenceB
{
required
MyMessageBReferenceA
value
=
1
;
}
message
MyMessageBReferenceA
{
required
MyMessageAReferenceB
value
=
1
;
}
src/ProtocolBuffers.Test/ReusableBuilderTest.cs
View file @
8bd88ea8
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Text
;
using
Google.ProtocolBuffers.Collections
;
using
NUnit.Framework
;
using
Google.ProtocolBuffers.TestProtos
;
using
Google.ProtocolBuffers.Serialization
;
using
UnitTest.Issues.TestProtos
;
namespace
Google.ProtocolBuffers
{
[
TestFixture
]
public
class
ReusableBuilderTest
{
[
Test
,
Description
(
"Issue 28: Circular message dependencies result in null defaults for DefaultInstance"
)]
public
void
EnsureStaticCicularReference
()
{
MyMessageAReferenceB
ab
=
MyMessageAReferenceB
.
DefaultInstance
;
Assert
.
IsNotNull
(
ab
);
Assert
.
IsNotNull
(
ab
.
Value
);
MyMessageBReferenceA
ba
=
MyMessageBReferenceA
.
DefaultInstance
;
Assert
.
IsNotNull
(
ba
);
Assert
.
IsNotNull
(
ba
.
Value
);
}
[
Test
]
public
void
TestModifyDefaultInstance
()
{
...
...
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