File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* *
2- * Copyright 2019-2025 , XGBoost contributors
2+ * Copyright 2019-2026 , XGBoost contributors
33 */
44#include < gtest/gtest.h>
55#include < xgboost/c_api.h>
1818
1919#include " ../../../src/c_api/c_api_error.h"
2020#include " ../../../src/common/io.h"
21+ #include " ../../../src/common/utils.h" // for MakeCleanup
2122#include " ../../../src/data/adapter.h" // for ArrayAdapter
2223#include " ../../../src/data/array_interface.h" // for ArrayInterface
2324#include " ../../../src/data/batch_utils.h" // for MatchingPageBytes
@@ -273,6 +274,10 @@ TEST(CAPI, Exception) {
273274}
274275
275276TEST (CAPI, XGBGlobalConfig) {
277+ auto guard = common::MakeCleanup ([cfg_bak = *GlobalConfigThreadLocalStore::Get ()] {
278+ *GlobalConfigThreadLocalStore::Get () = cfg_bak;
279+ });
280+
276281 int ret;
277282 {
278283 const char *config_str = R"json(
You can’t perform that action at this time.
0 commit comments