From 3931259185546d8fbc51e9c2c460aa63e63b3512 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Wed, 1 May 2024 11:43:51 -0700 Subject: [PATCH] Add test for is_fully_supported --- morpheus/_lib/tests/objects/test_dtype.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/morpheus/_lib/tests/objects/test_dtype.cpp b/morpheus/_lib/tests/objects/test_dtype.cpp index 230d68dcd6..5b32404d44 100644 --- a/morpheus/_lib/tests/objects/test_dtype.cpp +++ b/morpheus/_lib/tests/objects/test_dtype.cpp @@ -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); -} \ No newline at end of file +} + +TEST_F(TestDType, IsFullySupported) +{ + std::set unsupported_types = {TypeId::EMPTY, TypeId::STRING, TypeId::NUM_TYPE_IDS}; + for (auto type_id = static_cast(TypeId::EMPTY); type_id <= static_cast(TypeId::NUM_TYPE_IDS); + ++type_id) + { + auto enum_type_id = static_cast(type_id); + auto dtype = DType(enum_type_id); + + ASSERT_EQ(dtype.is_fully_supported(), !unsupported_types.contains(enum_type_id)); + } +}