MCPcopy Create free account
hub / github.com/dmlc/xgboost / TEST

Function TEST

tests/cpp/test_learner.cc:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44namespace xgboost {
45TEST(Learner, Basic) {
46 using Arg = std::pair<std::string, std::string>;
47 auto args = {Arg("tree_method", "exact")};
48 auto mat_ptr = RandomDataGenerator{10, 10, 0.0f}.GenerateDMatrix();
49 auto learner = std::unique_ptr<Learner>(Learner::Create({mat_ptr}));
50 learner->SetParams(args);
51
52 auto major = XGBOOST_VER_MAJOR;
53 auto minor = XGBOOST_VER_MINOR;
54 auto patch = XGBOOST_VER_PATCH;
55
56 static_assert(std::is_integral_v<decltype(major)>, "Wrong major version type");
57 static_assert(std::is_integral_v<decltype(minor)>, "Wrong minor version type");
58 static_assert(std::is_integral_v<decltype(patch)>, "Wrong patch version type");
59}
60
61TEST(Learner, ParameterValidation) {
62 ConsoleLogger::Configure({{"verbosity", "2"}});

Callers

nothing calls this directly

Calls 15

GMockThrowFunction · 0.85
Make1dInterfaceTestFunction · 0.85
LoadSequentialFileFunction · 0.85
RandomDataGeneratorClass · 0.85
CPUFunction · 0.85
TransformIdxKernelFunction · 0.85
GenerateDMatrixMethod · 0.80
SetParamsMethod · 0.80
SetParamMethod · 0.80
UpdateOneIterMethod · 0.80
resizeMethod · 0.80

Tested by

no test coverage detected