From e231b70d006343b0f6fab51fe94aeb179b032bd6 Mon Sep 17 00:00:00 2001 From: longwei Date: Thu, 2 Mar 2023 13:16:51 +0000 Subject: [PATCH] fix xts for zlib gzungetc Change-Id: Ie7514a36b88eb3f519441ff6a8b1207e1de3c901 Signed-off-by: longwei --- bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp b/bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp index 31b8a14cf..b2fc2bb1e 100644 --- a/bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp +++ b/bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp @@ -1267,13 +1267,12 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzUnGetc, Function | MediumTest | Level2) #else std::lock_guard lock(file_mutex); gzFile file; - file = gzopen(TESTFILE, "wb"); - ASSERT_TRUE(file != NULL); - gzseek(file, 1L, SEEK_CUR); /* add one zero byte */ - gzclose(file); file = gzopen(TESTFILE, "rb"); ASSERT_TRUE(file != NULL); - ASSERT_FALSE(gzungetc(' ', file) != ' '); + ASSERT_FALSE(gzungetc('a', file) != 'a'); + char sz_read[5] = {0}; + gzread(file, sz_read, 1); + ASSERT_TRUE(sz_read[0] == 'a'); gzclose(file); #endif } -- GitLab