This is an automated email from the ASF dual-hosted git repository.
pengzheng pushed a commit to branch feature/556-osgi-uninstall
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to refs/heads/feature/556-osgi-uninstall by
this push:
new 3842b6e3 Fix a memory leak in test.
3842b6e3 is described below
commit 3842b6e3bf34d7d3641eb06d14dfac254ea1ab8f
Author: PengZheng <[email protected]>
AuthorDate: Tue May 30 20:05:38 2023 +0800
Fix a memory leak in test.
---
libs/framework/gtest/src/CelixBundleCacheTestSuite.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libs/framework/gtest/src/CelixBundleCacheTestSuite.cc
b/libs/framework/gtest/src/CelixBundleCacheTestSuite.cc
index 675ef0ff..945242db 100644
--- a/libs/framework/gtest/src/CelixBundleCacheTestSuite.cc
+++ b/libs/framework/gtest/src/CelixBundleCacheTestSuite.cc
@@ -51,7 +51,9 @@ TEST_F(CelixBundleCacheTestSuite, ArchiveCreateDestroyTest) {
bundle_archive_t* archive = nullptr;
EXPECT_EQ(CELIX_SUCCESS, celix_bundleCache_createArchive(fw.cache, 1,
SIMPLE_TEST_BUNDLE1_LOCATION, &archive));
EXPECT_NE(nullptr, archive);
- EXPECT_STREQ(SIMPLE_TEST_BUNDLE1_LOCATION,
celix_bundleArchive_getLocation(archive));
+ auto location = celix_bundleArchive_getLocation(archive);
+ EXPECT_STREQ(SIMPLE_TEST_BUNDLE1_LOCATION, location);
+ free(location);
EXPECT_EQ(1, celix_bundleCache_findBundleIdForLocation(fw.cache,
SIMPLE_TEST_BUNDLE1_LOCATION));
EXPECT_TRUE(celix_bundleCache_isBundleIdAlreadyUsed(fw.cache, 1));
std::string loc = celix_bundleArchive_getPersistentStoreRoot(archive);