From 1f8a18d6459ecea15b6ca2b4ec9bcaceef3b2208 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 6 Jan 2025 16:32:02 +0800 Subject: [PATCH] test/tcs: fix UT for community edition --- source/libs/tcs/test/tcsTest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/libs/tcs/test/tcsTest.cpp b/source/libs/tcs/test/tcsTest.cpp index 4b5afc5b85..40d9eac7a0 100644 --- a/source/libs/tcs/test/tcsTest.cpp +++ b/source/libs/tcs/test/tcsTest.cpp @@ -287,12 +287,12 @@ TEST(TcsTest, InterfaceNonBlobTest) { uint8_t *pBlock = NULL; code = tcsGetObjectBlock(object_name, 0, size, check, &pBlock); GTEST_ASSERT_EQ(code, 0); - - for (int i = 0; i < size / 2; ++i) { - GTEST_ASSERT_EQ(pBlock[i * 2], 0); - GTEST_ASSERT_EQ(pBlock[i * 2 + 1], 1); + if (pBlock) { + for (int i = 0; i < size / 2; ++i) { + GTEST_ASSERT_EQ(pBlock[i * 2], 0); + GTEST_ASSERT_EQ(pBlock[i * 2 + 1], 1); + } } - taosMemoryFree(pBlock); code = tcsGetObjectToFile(object_name, path_download);