aboutsummaryrefslogtreecommitdiff
path: root/ruby/ext/google/protobuf_c/storage.c
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2018-07-02 15:11:36 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-07-17 17:34:25 -0700
commit8356d270a54e18c21f4feac6f5e2b6f1061dc8d5 (patch)
tree6224f98ad30e99dc2d896423853892f2142f16ed /ruby/ext/google/protobuf_c/storage.c
parent7fdebf2c2eda381bc7f4701811aae334b0f742ab (diff)
downloadprotobuf-8356d270a54e18c21f4feac6f5e2b6f1061dc8d5.tar.gz
protobuf-8356d270a54e18c21f4feac6f5e2b6f1061dc8d5.tar.bz2
protobuf-8356d270a54e18c21f4feac6f5e2b6f1061dc8d5.zip
Add continuous test for ruby 2.3, 2.4 and 2.5 (#4829)
* Add continuous test for ruby 2.3, 2.4 and 2.5 * Change ruby 2.5 to 2.5.0 * No need to provide argument to rb_funcall when argc is 0 * Fix tests for ruby 2.5 * Use rescue instead of assert_raise to accept subclass of error
Diffstat (limited to 'ruby/ext/google/protobuf_c/storage.c')
-rw-r--r--ruby/ext/google/protobuf_c/storage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ruby/ext/google/protobuf_c/storage.c b/ruby/ext/google/protobuf_c/storage.c
index 1437c0b5..5d842b74 100644
--- a/ruby/ext/google/protobuf_c/storage.c
+++ b/ruby/ext/google/protobuf_c/storage.c
@@ -177,7 +177,7 @@ void native_slot_set_value_and_case(upb_fieldtype_t type, VALUE type_class,
}
case UPB_TYPE_STRING:
if (CLASS_OF(value) == rb_cSymbol) {
- value = rb_funcall(value, rb_intern("to_s"), 0, NULL);
+ value = rb_funcall(value, rb_intern("to_s"), 0);
} else if (CLASS_OF(value) != rb_cString) {
rb_raise(rb_eTypeError, "Invalid argument for string field.");
}
@@ -207,7 +207,7 @@ void native_slot_set_value_and_case(upb_fieldtype_t type, VALUE type_class,
case UPB_TYPE_ENUM: {
int32_t int_val = 0;
if (TYPE(value) == T_STRING) {
- value = rb_funcall(value, rb_intern("to_sym"), 0, NULL);
+ value = rb_funcall(value, rb_intern("to_sym"), 0);
} else if (!is_ruby_num(value) && TYPE(value) != T_SYMBOL) {
rb_raise(rb_eTypeError,
"Expected number or symbol type for enum field.");