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
09b9e99b
Commit
09b9e99b
authored
Aug 10, 2009
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tests compile on Sun Studio. Patch from Monty Taylor.
parent
bcb791a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
cpp_unittest.cc
src/google/protobuf/compiler/cpp/cpp_unittest.cc
+4
-6
No files found.
src/google/protobuf/compiler/cpp/cpp_unittest.cc
View file @
09b9e99b
...
@@ -451,8 +451,7 @@ TEST(GeneratedMessageTest, SerializationToArray) {
...
@@ -451,8 +451,7 @@ TEST(GeneratedMessageTest, SerializationToArray) {
int
size
=
message1
.
ByteSize
();
int
size
=
message1
.
ByteSize
();
data
.
resize
(
size
);
data
.
resize
(
size
);
uint8
*
start
=
reinterpret_cast
<
uint8
*>
(
string_as_array
(
&
data
));
uint8
*
start
=
reinterpret_cast
<
uint8
*>
(
string_as_array
(
&
data
));
uint8
*
end
=
uint8
*
end
=
message1
.
SerializeWithCachedSizesToArray
(
start
);
message1
.
TestAllTypes
::
SerializeWithCachedSizesToArray
(
start
);
EXPECT_EQ
(
size
,
end
-
start
);
EXPECT_EQ
(
size
,
end
-
start
);
EXPECT_TRUE
(
message2
.
ParseFromString
(
data
));
EXPECT_TRUE
(
message2
.
ParseFromString
(
data
));
TestUtil
::
ExpectAllFieldsSet
(
message2
);
TestUtil
::
ExpectAllFieldsSet
(
message2
);
...
@@ -466,8 +465,7 @@ TEST(GeneratedMessageTest, PackedFieldsSerializationToArray) {
...
@@ -466,8 +465,7 @@ TEST(GeneratedMessageTest, PackedFieldsSerializationToArray) {
int
packed_size
=
packed_message1
.
ByteSize
();
int
packed_size
=
packed_message1
.
ByteSize
();
packed_data
.
resize
(
packed_size
);
packed_data
.
resize
(
packed_size
);
uint8
*
start
=
reinterpret_cast
<
uint8
*>
(
string_as_array
(
&
packed_data
));
uint8
*
start
=
reinterpret_cast
<
uint8
*>
(
string_as_array
(
&
packed_data
));
uint8
*
end
=
uint8
*
end
=
packed_message1
.
SerializeWithCachedSizesToArray
(
start
);
packed_message1
.
TestPackedTypes
::
SerializeWithCachedSizesToArray
(
start
);
EXPECT_EQ
(
packed_size
,
end
-
start
);
EXPECT_EQ
(
packed_size
,
end
-
start
);
EXPECT_TRUE
(
packed_message2
.
ParseFromString
(
packed_data
));
EXPECT_TRUE
(
packed_message2
.
ParseFromString
(
packed_data
));
TestUtil
::
ExpectPackedFieldsSet
(
packed_message2
);
TestUtil
::
ExpectPackedFieldsSet
(
packed_message2
);
...
@@ -485,7 +483,7 @@ TEST(GeneratedMessageTest, SerializationToStream) {
...
@@ -485,7 +483,7 @@ TEST(GeneratedMessageTest, SerializationToStream) {
// Allow the output stream to buffer only one byte at a time.
// Allow the output stream to buffer only one byte at a time.
io
::
ArrayOutputStream
array_stream
(
string_as_array
(
&
data
),
size
,
1
);
io
::
ArrayOutputStream
array_stream
(
string_as_array
(
&
data
),
size
,
1
);
io
::
CodedOutputStream
output_stream
(
&
array_stream
);
io
::
CodedOutputStream
output_stream
(
&
array_stream
);
message1
.
TestAllTypes
::
SerializeWithCachedSizes
(
&
output_stream
);
message1
.
SerializeWithCachedSizes
(
&
output_stream
);
EXPECT_FALSE
(
output_stream
.
HadError
());
EXPECT_FALSE
(
output_stream
.
HadError
());
EXPECT_EQ
(
size
,
output_stream
.
ByteCount
());
EXPECT_EQ
(
size
,
output_stream
.
ByteCount
());
}
}
...
@@ -504,7 +502,7 @@ TEST(GeneratedMessageTest, PackedFieldsSerializationToStream) {
...
@@ -504,7 +502,7 @@ TEST(GeneratedMessageTest, PackedFieldsSerializationToStream) {
// Allow the output stream to buffer only one byte at a time.
// Allow the output stream to buffer only one byte at a time.
io
::
ArrayOutputStream
array_stream
(
string_as_array
(
&
data
),
size
,
1
);
io
::
ArrayOutputStream
array_stream
(
string_as_array
(
&
data
),
size
,
1
);
io
::
CodedOutputStream
output_stream
(
&
array_stream
);
io
::
CodedOutputStream
output_stream
(
&
array_stream
);
message1
.
TestPackedTypes
::
SerializeWithCachedSizes
(
&
output_stream
);
message1
.
SerializeWithCachedSizes
(
&
output_stream
);
EXPECT_FALSE
(
output_stream
.
HadError
());
EXPECT_FALSE
(
output_stream
.
HadError
());
EXPECT_EQ
(
size
,
output_stream
.
ByteCount
());
EXPECT_EQ
(
size
,
output_stream
.
ByteCount
());
}
}
...
...
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