Commit 7a8a97cc authored by cremno's avatar cremno

add Mrbtest::FIXNUM_{MAX,MIN,BIT}

parent f0be02fc
......@@ -87,6 +87,7 @@ main(int argc, char **argv)
{
mrb_state *mrb;
struct RClass *krn;
struct RClass *mrbtest;
int ret;
print_hint();
......@@ -106,6 +107,18 @@ main(int argc, char **argv)
krn = mrb->kernel_module;
mrb_define_method(mrb, krn, "__t_printstr__", mrb_t_printstr, MRB_ARGS_REQ(1));
mrbtest = mrb_define_module(mrb, "Mrbtest");
#ifdef MRB_WORD_BOXING
mrb_define_const(mrb, mrbtest, "FIXNUM_MAX", mrb_fixnum_value(MRB_INT_MAX >> MRB_FIXNUM_SHIFT));
mrb_define_const(mrb, mrbtest, "FIXNUM_MIN", mrb_fixnum_value(MRB_INT_MIN >> MRB_FIXNUM_SHIFT));
mrb_define_const(mrb, mrbtest, "FIXNUM_BIT", mrb_fixnum_value(MRB_INT_BIT >> MRB_FIXNUM_SHIFT));
#else
mrb_define_const(mrb, mrbtest, "FIXNUM_MAX", mrb_fixnum_value(MRB_INT_MAX));
mrb_define_const(mrb, mrbtest, "FIXNUM_MIN", mrb_fixnum_value(MRB_INT_MIN));
mrb_define_const(mrb, mrbtest, "FIXNUM_BIT", mrb_fixnum_value(MRB_INT_BIT));
#endif
mrb_init_mrbtest(mrb);
ret = eval_test(mrb);
mrb_close(mrb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment