From 8356d270a54e18c21f4feac6f5e2b6f1061dc8d5 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 2 Jul 2018 15:11:36 -0700 Subject: 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 --- ruby/ext/google/protobuf_c/storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ruby/ext/google/protobuf_c/storage.c') 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."); -- cgit v1.2.3