Fix flag test macro

`RBOOL` is a macro to convert C boolean to Ruby boolean.
This commit is contained in:
Nobuyoshi Nakada 2024-08-09 21:43:32 +09:00
parent 04d57e2c5c
commit 21a9d7664c
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2024-08-11 03:09:03 +00:00
2 changed files with 4 additions and 2 deletions

View File

@ -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;
if (rb_sym2id(key) == rb_intern("rgengc_allow_full_mark")) {
gc_rest(objspace);
gc_config_full_mark_set(RBOOL(value));
gc_config_full_mark_set(RTEST(value));
}
return ST_CONTINUE;
}

View File

@ -74,8 +74,10 @@ class TestGc < Test::Unit::TestCase
new_value = GC.config(rgengc_allow_full_mark: false)[:rgengc_allow_full_mark]
assert_false(new_value)
new_value = GC.config(rgengc_allow_full_mark: nil)[:rgengc_allow_full_mark]
assert_false(new_value)
ensure
GC.config(rgengc_allow_full_mark: true)
GC.config(rgengc_allow_full_mark: old_value)
GC.start
end