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
5f254002
Commit
5f254002
authored
Oct 30, 2019
by
Joshua Haberman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed conformance test regression: empty string wrapper.
parent
aae5c491
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
encode_decode.c
ruby/ext/google/protobuf_c/encode_decode.c
+18
-0
common_tests.rb
ruby/tests/common_tests.rb
+0
-1
No files found.
ruby/ext/google/protobuf_c/encode_decode.c
View file @
5f254002
...
...
@@ -626,6 +626,14 @@ static bool uint32wrapper_handler(void* closure, const void* hd, uint32_t val) {
return
true
;
}
static
void
*
startstringwrapper_handler
(
void
*
closure
,
const
void
*
hd
,
size_t
size_hint
)
{
VALUE
*
rbval
=
closure
;
(
void
)
size_hint
;
*
rbval
=
get_frozen_string
(
NULL
,
0
,
false
);
return
closure
;
}
static
size_t
stringwrapper_handler
(
void
*
closure
,
const
void
*
hd
,
const
char
*
ptr
,
size_t
len
,
const
upb_bufhandle
*
handle
)
{
...
...
@@ -634,6 +642,14 @@ static size_t stringwrapper_handler(void* closure, const void* hd,
return
len
;
}
static
void
*
startbyteswrapper_handler
(
void
*
closure
,
const
void
*
hd
,
size_t
size_hint
)
{
VALUE
*
rbval
=
closure
;
(
void
)
size_hint
;
*
rbval
=
get_frozen_string
(
NULL
,
0
,
true
);
return
closure
;
}
static
size_t
byteswrapper_handler
(
void
*
closure
,
const
void
*
hd
,
const
char
*
ptr
,
size_t
len
,
const
upb_bufhandle
*
handle
)
{
...
...
@@ -760,9 +776,11 @@ static void add_handlers_for_wrapper(const upb_msgdef* msgdef,
upb_handlers_setuint32
(
h
,
f
,
uint32wrapper_handler
,
NULL
);
break
;
case
UPB_WELLKNOWN_STRINGVALUE
:
upb_handlers_setstartstr
(
h
,
f
,
startstringwrapper_handler
,
NULL
);
upb_handlers_setstring
(
h
,
f
,
stringwrapper_handler
,
NULL
);
break
;
case
UPB_WELLKNOWN_BYTESVALUE
:
upb_handlers_setstartstr
(
h
,
f
,
startbyteswrapper_handler
,
NULL
);
upb_handlers_setstring
(
h
,
f
,
byteswrapper_handler
,
NULL
);
break
;
case
UPB_WELLKNOWN_BOOLVALUE
:
...
...
ruby/tests/common_tests.rb
View file @
5f254002
...
...
@@ -1411,7 +1411,6 @@ module CommonTests
run_test
.
call
(
m
)
m
.
oneof_bytes_as_value
=
'fun'
run_test
.
call
(
m
)
puts
m
end
def
test_top_level_wrappers
...
...
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