Skip to content

Commit

Permalink
Use gtest instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Aug 10, 2022
1 parent 9081d1f commit afd281f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/cpp/data/test_ellpack_page.cu
Expand Up @@ -237,8 +237,10 @@ TEST(EllpackPage, Compact) {
}
}

TEST(EllpackPage, FromGHistIndex) {
auto test = [&](float sparsity) {
namespace {
class EllpackPageTest : public testing::TestWithParam<float> {
protected:
void Run(float sparsity) {
// Only testing with small sample size as the cuts might be different between host and
// device.
size_t n_samples{128}, n_features{13};
Expand Down Expand Up @@ -269,10 +271,10 @@ TEST(EllpackPage, FromGHistIndex) {
EXPECT_EQ(from_ghist_it[i], from_sparse_it[i]);
}
}
};

for (auto s : {0.0, 0.2, 0.4, 0.8}) {
test(s);
}
}
};
} // namespace

TEST_P(EllpackPageTest, FromGHistIndex) { this->Run(GetParam()); }
INSTANTIATE_TEST_SUITE_P(EllpackPage, EllpackPageTest, testing::Values(.0f, .2f, .4f, .8f));
} // namespace xgboost

0 comments on commit afd281f

Please sign in to comment.