test/test_Data_Object.cpp in rice-1.4.3 vs test/test_Data_Object.cpp in rice-1.5.0
- old
+ new
@@ -49,11 +49,11 @@
Mark_Func(Mark_Func_Foo(ruby_mark<Foo>));
ASSERT_EQUAL(
expected_mark_func,
RDATA(wrapped_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(wrapped_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(wrapped_foo.value()));
}
TESTCASE(construct_from_pointer_and_klass)
@@ -69,11 +69,11 @@
Mark_Func(Mark_Func_Foo(ruby_mark<Foo>));
ASSERT_EQUAL(
expected_mark_func,
RDATA(wrapped_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(wrapped_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(wrapped_foo.value()));
}
TESTCASE(construct_from_pointer_and_alternate_klass)
@@ -89,11 +89,11 @@
Mark_Func(Mark_Func_Foo(ruby_mark<Foo>));
ASSERT_EQUAL(
expected_mark_func,
RDATA(wrapped_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(wrapped_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(wrapped_foo.value()));
}
namespace
@@ -110,11 +110,11 @@
Data_Object<Foo> wrapped_foo(foo, rb_cFoo, dummy_mark);
ASSERT_EQUAL(foo, wrapped_foo.get());
ASSERT_EQUAL(Data_Type<Foo>::klass(), wrapped_foo.class_of());
ASSERT_EQUAL((void *)dummy_mark, RDATA(wrapped_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(wrapped_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(wrapped_foo.value()));
}
namespace
@@ -140,43 +140,43 @@
}
TESTCASE(construct_from_ruby_object)
{
Foo * foo = new Foo;
- VALUE wrapped_foo = Data_Wrap_Struct(Data_Type<Foo>::klass(), 0, Default_Allocation_Strategy<Foo>::free, foo);
+ VALUE wrapped_foo = Data_Wrap_Struct(Data_Type<Foo>::klass(), 0, Default_Free_Function<Foo>::free, foo);
Data_Object<Foo> data_object_foo(wrapped_foo);
ASSERT_EQUAL(foo, data_object_foo.get());
ASSERT_EQUAL(Data_Type<Foo>::klass(), data_object_foo.class_of());
ASSERT_EQUAL(RDATA(wrapped_foo), RDATA(data_object_foo.value()));
ASSERT_EQUAL(RUBY_DATA_FUNC(0), RDATA(data_object_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(data_object_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(data_object_foo.value()));
}
TESTCASE(construct_from_ruby_object_and_class)
{
Data_Type<Foo> rb_cFoo;
Foo * foo = new Foo;
- VALUE wrapped_foo = Data_Wrap_Struct(Data_Type<Foo>::klass(), 0, Default_Allocation_Strategy<Foo>::free, foo);
+ VALUE wrapped_foo = Data_Wrap_Struct(Data_Type<Foo>::klass(), 0, Default_Free_Function<Foo>::free, foo);
Data_Object<Foo> data_object_foo(wrapped_foo, rb_cFoo);
ASSERT_EQUAL(foo, data_object_foo.get());
ASSERT_EQUAL(Data_Type<Foo>::klass(), data_object_foo.class_of());
ASSERT_EQUAL(RDATA(wrapped_foo), RDATA(data_object_foo.value()));
ASSERT_EQUAL(RUBY_DATA_FUNC(0), RDATA(data_object_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(data_object_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(data_object_foo.value()));
}
TESTCASE(construct_from_ruby_object_and_wrong_class)
{
Foo * foo = new Foo;
Data_Type<Foo> rb_cFoo;
- VALUE wrapped_foo = Data_Wrap_Struct(rb_cObject, 0, Default_Allocation_Strategy<Foo>::free, foo);
+ VALUE wrapped_foo = Data_Wrap_Struct(rb_cObject, 0, Default_Free_Function<Foo>::free, foo);
ASSERT_EXCEPTION_CHECK(
Exception,
Data_Object<Foo> data_object_foo(wrapped_foo, rb_cFoo),
ASSERT_EQUAL(
Object(rb_eTypeError),
@@ -187,18 +187,18 @@
TESTCASE(copy_construct)
{
Data_Type<Foo> rb_cFoo;
Foo * foo = new Foo;
- VALUE wrapped_foo = Data_Wrap_Struct(Data_Type<Foo>::klass(), 0, Default_Allocation_Strategy<Foo>::free, foo);
+ VALUE wrapped_foo = Data_Wrap_Struct(Data_Type<Foo>::klass(), 0, Default_Free_Function<Foo>::free, foo);
Data_Object<Foo> orig_data_object_foo(wrapped_foo, rb_cFoo);
Data_Object<Foo> data_object_foo(orig_data_object_foo);
ASSERT_EQUAL(foo, data_object_foo.get());
ASSERT_EQUAL(Data_Type<Foo>::klass(), data_object_foo.class_of());
ASSERT_EQUAL(RDATA(wrapped_foo), RDATA(data_object_foo.value()));
ASSERT_EQUAL(RUBY_DATA_FUNC(0), RDATA(data_object_foo.value())->dmark);
ASSERT_EQUAL(
- RUBY_DATA_FUNC(Default_Allocation_Strategy<Foo>::free),
+ RUBY_DATA_FUNC(Default_Free_Function<Foo>::free),
RUBY_DATA_FUNC(RDATA(data_object_foo.value())->dfree));
ASSERT_EQUAL(foo, DATA_PTR(data_object_foo.value()));
}
TESTCASE(dereference)