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
abd7083b
Commit
abd7083b
authored
Jul 31, 2015
by
Jan Tattermusch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #667 from jskeet/fix-field-orderings
Fix trivial bug in field orderings.
parents
c20f67fd
fd02e45b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
DescriptorsTest.cs
...rp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
+13
-0
MessageDescriptor.cs
csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
+1
-1
No files found.
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
View file @
abd7083b
...
...
@@ -238,5 +238,18 @@ namespace Google.Protobuf.Reflection
Assert
.
IsNull
(
fieldDescriptor
.
Accessor
);
Assert
.
IsNull
(
messageDescriptor
.
GeneratedType
);
}
// From TestFieldOrdering:
// string my_string = 11;
// int64 my_int = 1;
// float my_float = 101;
// NestedMessage single_nested_message = 200;
[
Test
]
public
void
FieldListOrderings
()
{
var
fields
=
TestFieldOrderings
.
Descriptor
.
Fields
;
Assert
.
AreEqual
(
new
[]
{
11
,
1
,
101
,
200
},
fields
.
InDeclarationOrder
().
Select
(
x
=>
x
.
FieldNumber
));
Assert
.
AreEqual
(
new
[]
{
1
,
11
,
101
,
200
},
fields
.
InFieldNumberOrder
().
Select
(
x
=>
x
.
FieldNumber
));
}
}
}
csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
View file @
abd7083b
...
...
@@ -250,7 +250,7 @@ namespace Google.Protobuf.Reflection
/// </value>
public
IList
<
FieldDescriptor
>
InFieldNumberOrder
()
{
return
messageDescriptor
.
fieldsIn
Declaration
Order
;
return
messageDescriptor
.
fieldsIn
Number
Order
;
}
/// <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