|
|
@@ -51,35 +51,5 @@ TEST_F(UtestFormatTransfer, build_unsupported_transfer) { |
|
|
|
auto transfer2 = BuildFormatTransfer(args2); |
|
|
|
EXPECT_EQ(transfer2, nullptr); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestFormatTransfer, get_size_by_data_type) { |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_FLOAT), 4); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_FLOAT16), 2); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_INT8), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_INT16), 2); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_UINT16), 2); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_UINT8), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_INT32), 4); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_INT64), 8); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_UINT32), 4); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_UINT64), 8); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_BOOL), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_DOUBLE), 8); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_STRING), -1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_INT8), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_DUAL_SUB_UINT8), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_COMPLEX64), 8); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_COMPLEX128), 16); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_QINT8), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_QINT16), 2); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_QINT32), 4); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_QUINT8), 1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_QUINT16), 2); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_RESOURCE), 8); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_STRING_REF), -1); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_DUAL), 5); |
|
|
|
EXPECT_EQ(GetSizeByDataType(DT_UNDEFINED), -1); |
|
|
|
EXPECT_EQ(DT_UNDEFINED, 28); |
|
|
|
} |
|
|
|
} // namespace formats |
|
|
|
} // namespace ge |