Fix error handlings for mrb_open_core().

This commit is contained in:
Tatsuhiko Kubo
2014-08-20 05:48:09 +09:00
parent d49f8517a6
commit effc44f265
3 changed files with 9 additions and 0 deletions
+4
View File
@@ -18,6 +18,10 @@ mrb_init_mrbtest(mrb_state *mrb)
mrb_load_irep(mrb, mrbtest_assert_irep);
core_test = mrb_open_core(mrb_default_allocf, NULL);
if (core_test == NULL) {
fprintf(stderr, "Invalid mrb_state, exiting %s", __FUNCTION__);
exit(EXIT_FAILURE);
}
mrb_init_test_driver(core_test, mrb_test(mrb_gv_get(mrb, mrb_intern_lit(mrb, "$mrbtest_verbose"))));
mrb_load_irep(core_test, mrbtest_assert_irep);
mrb_load_irep(core_test, mrbtest_irep);