diff --git a/test/embed_ruby.cpp b/test/embed_ruby.cpp index 5b1d4d10..f356be00 100644 --- a/test/embed_ruby.cpp +++ b/test/embed_ruby.cpp @@ -7,14 +7,9 @@ void embed_ruby() if (!initialized__) { - int argc = 0; - char* argv = nullptr; - char** pArgv = &argv; - - ruby_sysinit(&argc, &pArgv); + RUBY_INIT_STACK; ruby_init(); ruby_init_loadpath(); - rb_gc_disable(); #if RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR >= 1 // Force the prelude / builtins diff --git a/test/test_Keep_Alive.cpp b/test/test_Keep_Alive.cpp index b6675574..f12f5ea3 100644 --- a/test/test_Keep_Alive.cpp +++ b/test/test_Keep_Alive.cpp @@ -160,7 +160,7 @@ TESTCASE(test_return) Module m = define_module("TestingModule"); Object column = getColumn(m, 3); - //rb_gc_start(); + rb_gc_start(); String name = column.call("name"); ASSERT_EQUAL("column_3", name.c_str()); } diff --git a/test/test_Tracking.cpp b/test/test_Tracking.cpp index 4215ff36..e506a04c 100644 --- a/test/test_Tracking.cpp +++ b/test/test_Tracking.cpp @@ -225,11 +225,11 @@ TESTCASE(RubyObjectGced) { // Track the C++ object returned by keepPointer Data_Object my_class1 = factory.call("keep_pointer"); - //rb_gc_start(); + rb_gc_start(); } // Make my_class1 invalid - //rb_gc_start(); + rb_gc_start(); // Get the object again - this should *not* return the previous value Data_Object my_class2 = factory.call("keep_pointer");