From 7dbb99bf75cc2e66590e7225883dbb9ac95de9c0 Mon Sep 17 00:00:00 2001 From: Andrea Calabrese Date: Mon, 29 Jul 2024 08:24:58 +0200 Subject: [PATCH] Add test for reserved tensor Reserved tensor now has a proper test, allocating 3 uint32_t. Signed-off-by: Andrea Calabrese --- test/TestTensor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/TestTensor.cpp b/test/TestTensor.cpp index 7eeff4af..0aaeb995 100644 --- a/test/TestTensor.cpp +++ b/test/TestTensor.cpp @@ -15,6 +15,14 @@ TEST(TestTensor, ConstructorData) EXPECT_EQ(tensor->vector(), vec); } +TEST(TestTensor, ReserveData) +{ + kp::Manager mgr; + std::shared_ptr> tensor = mgr.tensor(3, sizeof(uint32_t), Tensor::TensorDataType::eUnsignedInt); + EXPECT_EQ(tensor->size(), 0); + EXPECT_EQ(tensor->dataTypeMemorySize(), sizeof(uint32_t)); +} + TEST(TestTensor, DataTypes) { kp::Manager mgr;