| 1 |
context('Test global configuration') |
| 2 |
|
| 3 |
test_that('Global configuration works with verbosity', { |
| 4 |
old_verbosity <- xgb.get.config()$verbosity |
| 5 |
for (v in c(0, 1, 2, 3)) { |
| 6 |
xgb.set.config(verbosity = v) |
| 7 |
expect_equal(xgb.get.config()$verbosity, v) |
| 8 |
} |
| 9 |
xgb.set.config(verbosity = old_verbosity) |
| 10 |
expect_equal(xgb.get.config()$verbosity, old_verbosity) |
| 11 |
}) |
| 12 |
|
| 13 |
test_that('Global configuration works with use_rmm flag', { |
| 14 |
old_use_rmm_flag <- xgb.get.config()$use_rmm |
| 15 |
for (v in c(TRUE, FALSE)) { |
| 16 |
xgb.set.config(use_rmm = v) |
| 17 |
expect_equal(xgb.get.config()$use_rmm, v) |
| 18 |
} |
| 19 |
xgb.set.config(use_rmm = old_use_rmm_flag) |
| 20 |
expect_equal(xgb.get.config()$use_rmm, old_use_rmm_flag) |
| 21 |
}) |