Skip to content

Commit

Permalink
Removed using directives for cudf, cudf::test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mythrocks committed Jul 20, 2021
1 parent b0232b3 commit f500c45
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions cpp/tests/transform/row_bit_count_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,7 @@ TEST_F(RowBitCount, NestedTypes)

TEST_F(RowBitCount, NullsInStringsList)
{
using namespace cudf;
using namespace cudf::test;
using offsets_wrapper = fixed_width_column_wrapper<offset_type>;
using offsets_wrapper = cudf::test::fixed_width_column_wrapper<offset_type>;

// clang-format off
auto strings = std::vector<std::string>{ "daïs", "def", "", "z", "bananas", "warp", "", "zing" };
Expand All @@ -470,48 +468,45 @@ TEST_F(RowBitCount, NullsInStringsList)
auto lists_col = cudf::make_lists_column(
4,
offsets_wrapper{0, 2, 4, 6, 8}.release(),
strings_column_wrapper{strings.begin(), strings.end(), valids.begin()}.release(),
cudf::test::strings_column_wrapper{strings.begin(), strings.end(), valids.begin()}.release(),
0,
{});
CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(row_bit_count(table_view{{lists_col->view()}})->view(),
fixed_width_column_wrapper<offset_type>{138, 106, 130, 130});
CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(
cudf::row_bit_count(table_view{{lists_col->view()}})->view(),
cudf::test::fixed_width_column_wrapper<offset_type>{138, 106, 130, 130});
}

TEST_F(RowBitCount, EmptyChildColumnInListOfStrings)
{
using namespace cudf;
using namespace cudf::test;

// Test with a list<string> column with 4 empty list rows.
// Note: Since there are no strings in any of the lists,
// the lists column's child can be empty.
auto offsets = fixed_width_column_wrapper<offset_type>{0, 0, 0, 0, 0};
auto lists_col =
make_lists_column(4, offsets.release(), make_empty_column(data_type{type_id::STRING}), 0, {});
auto offsets = cudf::test::fixed_width_column_wrapper<offset_type>{0, 0, 0, 0, 0};
auto lists_col = cudf::make_lists_column(
4, offsets.release(), cudf::make_empty_column(cudf::data_type{cudf::type_id::STRING}), 0, {});

CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(row_bit_count(table_view{{lists_col->view()}})->view(),
fixed_width_column_wrapper<offset_type>{32, 32, 32, 32});
CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(
cudf::row_bit_count(table_view{{lists_col->view()}})->view(),
cudf::test::fixed_width_column_wrapper<offset_type>{32, 32, 32, 32});
}

TEST_F(RowBitCount, EmptyChildColumnInListOfLists)
{
using namespace cudf;
using namespace cudf::test;

// Test with a list<list> column with 4 empty list rows.
// Note: Since there are no elements in any of the lists,
// the lists column's child can be empty.
auto empty_child_lists_column = [] {
auto exemplar = lists_column_wrapper<int32_t>{{0, 1, 2}, {3, 4, 5}};
return empty_like(exemplar);
auto exemplar = cudf::test::lists_column_wrapper<int32_t>{{0, 1, 2}, {3, 4, 5}};
return cudf::empty_like(exemplar);
};

auto offsets = fixed_width_column_wrapper<offset_type>{0, 0, 0, 0, 0};
auto lists_col = make_lists_column(4, offsets.release(), empty_child_lists_column(), 0, {});
auto offsets = cudf::test::fixed_width_column_wrapper<offset_type>{0, 0, 0, 0, 0};
auto lists_col = cudf::make_lists_column(4, offsets.release(), empty_child_lists_column(), 0, {});
auto constexpr offset_nbits = sizeof(offset_type) * CHAR_BIT;

CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(row_bit_count(table_view{{lists_col->view()}})->view(),
fixed_width_column_wrapper<offset_type>{32, 32, 32, 32});
CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(
cudf::row_bit_count(table_view{{lists_col->view()}})->view(),
cudf::test::fixed_width_column_wrapper<offset_type>{32, 32, 32, 32});
}

struct sum_functor {
Expand Down

0 comments on commit f500c45

Please sign in to comment.