Skip to content

Commit

Permalink
Add test for is_fully_supported
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed May 1, 2024
1 parent c49d3a7 commit 3931259
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion morpheus/_lib/tests/objects/test_dtype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,17 @@ TEST_F(TestDType, FromCudfNotSupported)
EXPECT_THROW(DType::from_cudf(cudf::type_id::DECIMAL128), std::invalid_argument);
EXPECT_THROW(DType::from_cudf(cudf::type_id::STRUCT), std::invalid_argument);
EXPECT_THROW(DType::from_cudf(cudf::type_id::NUM_TYPE_IDS), std::invalid_argument);
}
}

TEST_F(TestDType, IsFullySupported)
{
std::set<TypeId> unsupported_types = {TypeId::EMPTY, TypeId::STRING, TypeId::NUM_TYPE_IDS};
for (auto type_id = static_cast<int32_t>(TypeId::EMPTY); type_id <= static_cast<int32_t>(TypeId::NUM_TYPE_IDS);
++type_id)
{
auto enum_type_id = static_cast<TypeId>(type_id);
auto dtype = DType(enum_type_id);

ASSERT_EQ(dtype.is_fully_supported(), !unsupported_types.contains(enum_type_id));
}
}

0 comments on commit 3931259

Please sign in to comment.