aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/optional/capi
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-18 23:19:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-18 23:19:38 +0000
commit24aa9ecc47e6e0ea8f7e52389b3942566e7d6642 (patch)
tree38bf6d7b3688181b76a322b77d28131893c50da9 /spec/ruby/optional/capi
parent7f4fbc1f09e04a6d3c8e28f20835ebd4c43ef998 (diff)
downloadruby-24aa9ecc47e6e0ea8f7e52389b3942566e7d6642.tar.gz
Removed unobservable behavior
The klass for Data_Wrap_Struct can be NULL, but it MUST NOT appear in the Ruby level. It is only for the C level implementation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/optional/capi')
-rw-r--r--spec/ruby/optional/capi/data_spec.rb5
-rw-r--r--spec/ruby/optional/capi/ext/data_spec.c7
2 files changed, 0 insertions, 12 deletions
diff --git a/spec/ruby/optional/capi/data_spec.rb b/spec/ruby/optional/capi/data_spec.rb
index 679c238804..b7d1b8fd65 100644
--- a/spec/ruby/optional/capi/data_spec.rb
+++ b/spec/ruby/optional/capi/data_spec.rb
@@ -19,11 +19,6 @@ describe "CApiWrappedStruct" do
@s.get_struct(a).should == 1024
end
- it "allows for using NULL as the klass for Data_Wrap_Struct" do
- a = @s.wrap_struct_null(1024)
- @s.get_struct(a).should == 1024
- end
-
describe "RDATA()" do
it "returns the struct data" do
a = @s.wrap_struct(1024)
diff --git a/spec/ruby/optional/capi/ext/data_spec.c b/spec/ruby/optional/capi/ext/data_spec.c
index ed79497897..52adeee59f 100644
--- a/spec/ruby/optional/capi/ext/data_spec.c
+++ b/spec/ruby/optional/capi/ext/data_spec.c
@@ -38,12 +38,6 @@ VALUE sws_wrap_struct(VALUE self, VALUE val) {
return Data_Wrap_Struct(rb_cObject, &sample_wrapped_struct_mark, &sample_wrapped_struct_free, bar);
}
-VALUE sws_wrap_struct_null(VALUE self, VALUE val) {
- struct sample_wrapped_struct* bar = (struct sample_wrapped_struct *)malloc(sizeof(struct sample_wrapped_struct));
- bar->foo = FIX2INT(val);
- return Data_Wrap_Struct(0, &sample_wrapped_struct_mark, &sample_wrapped_struct_free, bar);
-}
-
VALUE sws_get_struct(VALUE self, VALUE obj) {
struct sample_wrapped_struct* bar;
Data_Get_Struct(obj, struct sample_wrapped_struct, bar);
@@ -84,7 +78,6 @@ void Init_data_spec(void) {
cls = rb_define_class("CApiWrappedStructSpecs", rb_cObject);
rb_define_method(cls, "wrap_struct", sws_wrap_struct, 1);
- rb_define_method(cls, "wrap_struct_null", sws_wrap_struct_null, 1);
rb_define_method(cls, "get_struct", sws_get_struct, 1);
rb_define_method(cls, "get_struct_rdata", sws_get_struct_rdata, 1);
rb_define_method(cls, "get_struct_data_ptr", sws_get_struct_data_ptr, 1);