Fix flag test macro
`RBOOL` is a macro to convert C boolean to Ruby boolean.
This commit is contained in:
parent
04d57e2c5c
commit
21a9d7664c
Notes:
git
2024-08-11 03:09:03 +00:00
@ -8035,7 +8035,7 @@ gc_config_set_key(st_data_t key, st_data_t value, st_data_t data)
|
|||||||
rb_objspace_t *objspace = (rb_objspace_t *)data;
|
rb_objspace_t *objspace = (rb_objspace_t *)data;
|
||||||
if (rb_sym2id(key) == rb_intern("rgengc_allow_full_mark")) {
|
if (rb_sym2id(key) == rb_intern("rgengc_allow_full_mark")) {
|
||||||
gc_rest(objspace);
|
gc_rest(objspace);
|
||||||
gc_config_full_mark_set(RBOOL(value));
|
gc_config_full_mark_set(RTEST(value));
|
||||||
}
|
}
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,10 @@ class TestGc < Test::Unit::TestCase
|
|||||||
|
|
||||||
new_value = GC.config(rgengc_allow_full_mark: false)[:rgengc_allow_full_mark]
|
new_value = GC.config(rgengc_allow_full_mark: false)[:rgengc_allow_full_mark]
|
||||||
assert_false(new_value)
|
assert_false(new_value)
|
||||||
|
new_value = GC.config(rgengc_allow_full_mark: nil)[:rgengc_allow_full_mark]
|
||||||
|
assert_false(new_value)
|
||||||
ensure
|
ensure
|
||||||
GC.config(rgengc_allow_full_mark: true)
|
GC.config(rgengc_allow_full_mark: old_value)
|
||||||
GC.start
|
GC.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user