Skip to content

Commit

Permalink
Fix io/text gtests coded in namespace cudf::test (#12914)
Browse files Browse the repository at this point in the history
Fixes DATA_CHUNK_SOURCE_TEST gtests source files coded in namespace cudf::test
Fixes MULTIBYTE_SPLIT_TEST gtests source files coded in namespace cudf::test

Reference #11734

Authors:
  - Karthikeyan (https://github.com/karthikeyann)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Mike Wilson (https://github.com/hyperbolic2346)
  - Nghia Truong (https://github.com/ttnghia)

URL: #12914
  • Loading branch information
karthikeyann authored Mar 9, 2023
1 parent ff96cd1 commit 01375d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
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

0 comments on commit 01375d0

Please sign in to comment.