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
87d61e44
Commit
87d61e44
authored
Sep 24, 2016
by
Feng Xiao
Committed by
GitHub
Sep 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2175 from xfxyjwf/fix_json
Fix VS test failures.
parents
907a075d
5248f61a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
+25
-7
Dockerfile
jenkins/docker/Dockerfile
+1
-1
type_traits.h
src/google/protobuf/stubs/type_traits.h
+8
-0
json_stream_parser_test.cc
src/google/protobuf/util/internal/json_stream_parser_test.cc
+16
-6
No files found.
jenkins/docker/Dockerfile
View file @
87d61e44
...
...
@@ -115,7 +115,7 @@ RUN cd /tmp && \
cd
protobuf
&&
\
./autogen.sh
&&
\
./configure
&&
\
make
-j
7
&&
\
make
-j
4
&&
\
cd
java
&&
\
$MVN
install
dependency:go-offline
-Dmaven
.repo.local
=
$MAVEN_REPO
&&
\
cd
../javanano
&&
\
...
...
src/google/protobuf/stubs/type_traits.h
View file @
87d61e44
...
...
@@ -143,6 +143,14 @@ template<> struct is_integral<unsigned long> : true_type { };
template
<>
struct
is_integral
<
long
long
>
:
true_type
{
};
template
<>
struct
is_integral
<
unsigned
long
long
>
:
true_type
{
};
#endif
#if defined(_MSC_VER)
// With VC, __int8, __int16, and __int32 are synonymous with standard types
// with the same size, but __int64 has not equivalent (i.e., it's neither
// long, nor long long and should be treated differnetly).
// https://msdn.microsoft.com/en-us/library/29dh1w7z.aspx
template
<>
struct
is_integral
<
__int64
>
:
true_type
{
};
template
<>
struct
is_integral
<
unsigned
__int64
>
:
true_type
{};
#endif
template
<
class
T
>
struct
is_integral
<
const
T
>
:
is_integral
<
T
>
{
};
template
<
class
T
>
struct
is_integral
<
volatile
T
>
:
is_integral
<
T
>
{
};
template
<
class
T
>
struct
is_integral
<
const
volatile
T
>
:
is_integral
<
T
>
{
};
...
...
src/google/protobuf/util/internal/json_stream_parser_test.cc
View file @
87d61e44
...
...
@@ -315,18 +315,28 @@ TEST_F(JsonStreamParserTest, ObjectKeyTypes) {
}
}
// - array containing
array, object,
values (true, false, null, num, string)
TEST_F
(
JsonStreamParserTest
,
ArrayValues
)
{
// - array containing
primitive
values (true, false, null, num, string)
TEST_F
(
JsonStreamParserTest
,
Array
Primitive
Values
)
{
StringPiece
str
=
"[true, false, null, 'a',
\"
an
\"
, [22, -127, 45.3, "
"-1056.4, 11779497823553162765], {'key': true}]"
;
"[true, false, null, 'one',
\"
two
\"
]"
;
for
(
int
i
=
0
;
i
<=
str
.
length
();
++
i
)
{
ow_
.
StartList
(
""
)
->
RenderBool
(
""
,
true
)
->
RenderBool
(
""
,
false
)
->
RenderNull
(
""
)
->
RenderString
(
""
,
"a"
)
->
RenderString
(
""
,
"an"
)
->
RenderString
(
""
,
"one"
)
->
RenderString
(
""
,
"two"
)
->
EndList
();
DoTest
(
str
,
i
);
}
}
// - array containing array, object
TEST_F
(
JsonStreamParserTest
,
ArrayComplexValues
)
{
StringPiece
str
=
"[[22, -127, 45.3, -1056.4, 11779497823553162765], {'key': true}]"
;
for
(
int
i
=
0
;
i
<=
str
.
length
();
++
i
)
{
ow_
.
StartList
(
""
)
->
StartList
(
""
)
->
RenderUint64
(
""
,
22
)
->
RenderInt64
(
""
,
-
127
)
...
...
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