Fix efl base unit test 63/269863/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 21 Jan 2022 02:28:50 +0000 (11:28 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 21 Jan 2022 02:28:50 +0000 (11:28 +0900)
- Add fake function for sqlite3_release_memory()

Change-Id: I6f14ca62413d78ce40099d0af9d83b65fae802a1
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
unittests/app_core_efl_base_test.cc

index 9de1a3c..3deb752 100644 (file)
@@ -105,6 +105,10 @@ int __ui_plugin_fini_dummy(void) {
   return 0;
 }
 
+int __sqlite3_release_memory(int n) {
+  return 0;
+}
+
 }  // namespace
 
 namespace tizen_cpp {
@@ -174,6 +178,13 @@ TEST_F(AppCoreEflBaseTest, AppCoreEflBase_AddEvent_OnTrimMemory) {
       .Times(1);
   EXPECT_CALL(core, OnTrimMemory())
       .Times(1);
+  EXPECT_CALL(GetMock<DlMock>(), dlsym(_, _))
+      .WillRepeatedly(Invoke([&](void* handle, const char* name) -> void* {
+        if (!strcmp(name, "sqlite3_release_memory"))
+          return (void*)__sqlite3_release_memory;
+
+        return nullptr;
+      }));
 
   ::DummyArgs da;
   core.SetFeature(AppCoreBase::FEATURE_BACKGROUND_MANAGEMENT);