Skip to content

Commit

Permalink
Create Integers for Metrics values. Related to #3316.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Feb 12, 2015
1 parent 86fd75c commit b0825d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vm/metrics.cpp
Expand Up @@ -391,7 +391,7 @@ namespace rubinius {
i != metrics_map_.end();
++i)
{
values->put(state, index, Bignum::from(state, (*i)->second));
values->put(state, index, Integer::from(state, (*i)->second));

Object* key = reinterpret_cast<Object*>(state->symbol((*i)->first.c_str()));
map->store(state, key, Fixnum::from(index++));
Expand Down
4 changes: 4 additions & 0 deletions vm/test/test_integer.hpp
Expand Up @@ -13,6 +13,10 @@ class TestInteger : public CxxTest::TestSuite, public VMTest {
destroy();
}

void test_from_zero_yields_fixnum() {
TS_ASSERT(kind_of<Fixnum>(Integer::from(state, 0)));
}

void test_kind_of_numeric() {
Fixnum* fix = Fixnum::from(13);
Bignum* big = Bignum::from(state, (native_int)14);
Expand Down

0 comments on commit b0825d8

Please sign in to comment.