diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2018-07-02 15:11:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-02 15:11:36 -0700 |
commit | 78ba021b846e060d5b8f3424259d30a1f3ae4eef (patch) | |
tree | 901d1625c4e796aa89f4e2bdd331e59b48eaac3f /ruby/ext | |
parent | 2c30fa71e7af67ef42a3c71651ee5baedfb2fbfe (diff) |
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')
-rw-r--r-- | ruby/ext/google/protobuf_c/storage.c | 4 |
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 5d0ac976..163b2f81 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(cTypeError, "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(cTypeError, "Expected number or symbol type for enum field."); |