Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix io/text gtests coded in namespace cudf::test #12914

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cpp/tests/io/text/data_chunk_source_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
#include <fstream>
#include <random>

using namespace cudf::test;
auto const temp_env = static_cast<cudf::test::TempDirTestEnvironment*>(
::testing::AddGlobalTestEnvironment(new cudf::test::TempDirTestEnvironment));

auto const temp_env = static_cast<TempDirTestEnvironment*>(
::testing::AddGlobalTestEnvironment(new TempDirTestEnvironment));

struct DataChunkSourceTest : public BaseFixture {
struct DataChunkSourceTest : public cudf::test::BaseFixture {
};

std::string chunk_to_host(const cudf::io::text::device_data_chunk& chunk)
Expand Down
38 changes: 21 additions & 17 deletions cpp/tests/io/text/multibyte_split_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,13 +30,11 @@
#include <cudf/strings/strings_column_view.hpp>
#include <cudf/utilities/default_stream.hpp>

using namespace cudf;
using namespace test;

using cudf::test::strings_column_wrapper;
// 😀 | F0 9F 98 80 | 11110000 10011111 10011000 10000000
// 😎 | F0 9F 98 8E | 11110000 10011111 10011000 10001110

struct MultibyteSplitTest : public BaseFixture {
struct MultibyteSplitTest : public cudf::test::BaseFixture {
};

TEST_F(MultibyteSplitTest, Simple)
Expand Down Expand Up @@ -265,7 +263,7 @@ TEST_F(MultibyteSplitTest, HandpickedInput)
auto source = cudf::io::text::make_source(host_input);
auto out = cudf::io::text::multibyte_split(*source, delimiters);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, LargeInputMultipleRange)
Expand All @@ -290,7 +288,8 @@ TEST_F(MultibyteSplitTest, LargeInputMultipleRange)

auto expected = cudf::io::text::multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected->view(), *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(
expected->view(), *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, LargeInputSparseMultipleRange)
Expand All @@ -317,7 +316,8 @@ TEST_F(MultibyteSplitTest, LargeInputSparseMultipleRange)

auto expected = cudf::io::text::multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected->view(), *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(
expected->view(), *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, LargeInputMultipleRangeSingleByte)
Expand All @@ -342,7 +342,8 @@ TEST_F(MultibyteSplitTest, LargeInputMultipleRangeSingleByte)

auto expected = cudf::io::text::multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected->view(), *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(
expected->view(), *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, LargeInputSparseMultipleRangeSingleByte)
Expand All @@ -368,7 +369,8 @@ TEST_F(MultibyteSplitTest, LargeInputSparseMultipleRangeSingleByte)

auto expected = cudf::io::text::multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected->view(), *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(
expected->view(), *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, SmallInputAllPossibleRanges)
Expand Down Expand Up @@ -398,7 +400,8 @@ TEST_F(MultibyteSplitTest, SmallInputAllPossibleRanges)

auto expected = multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected->view(), *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(
expected->view(), *out, cudf::test::debug_output_level::ALL_ERRORS);
}
}
}
Expand Down Expand Up @@ -430,7 +433,8 @@ TEST_F(MultibyteSplitTest, SmallInputAllPossibleRangesSingleByte)

auto expected = multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected->view(), *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(
expected->view(), *out, cudf::test::debug_output_level::ALL_ERRORS);
}
}
}
Expand All @@ -447,7 +451,7 @@ TEST_F(MultibyteSplitTest, SingletonRangeAtEnd)

auto out = multibyte_split(*source, delimiter, byte_range_info{5, 1});

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, EmptyInput)
Expand All @@ -460,7 +464,7 @@ TEST_F(MultibyteSplitTest, EmptyInput)

auto out = multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, EmptyInputSingleByte)
Expand All @@ -473,7 +477,7 @@ TEST_F(MultibyteSplitTest, EmptyInputSingleByte)

auto out = multibyte_split(*source, delimiter);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, EmptyRange)
Expand All @@ -486,7 +490,7 @@ TEST_F(MultibyteSplitTest, EmptyRange)

auto out = multibyte_split(*source, delimiter, byte_range_info{4, 0});

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, EmptyRangeSingleByte)
Expand All @@ -499,7 +503,7 @@ TEST_F(MultibyteSplitTest, EmptyRangeSingleByte)

auto out = multibyte_split(*source, delimiter, byte_range_info{3, 0});

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, debug_output_level::ALL_ERRORS);
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *out, cudf::test::debug_output_level::ALL_ERRORS);
}

TEST_F(MultibyteSplitTest, EmptySplitDeviceSpan)
Expand Down