Fix build break issue 51/299751/3
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 10 Oct 2023 01:31:10 +0000 (10:31 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 10 Oct 2023 01:36:29 +0000 (10:36 +0900)
commit6c5849716cd81619c6d0c086bbf0c6b986c99f82
treed551a476584e2a1368370d1e7463d48e44f2aa9b
parentacbe245f1cb3125b5cef23040e8220b227b9be8e
Fix build break issue

This patch removes access hook code about EXPECT_CALL(). While calling
the exit handlers, the gcov calls the access() function. In that time,
the TestFixture instance was destroyed. It causes the crash issue.

+------------------------------------------------------------------------------+
| #0  0xb7fd4a51 in __kernel_vsyscall ()
| #1  0xb746a246 in __libc_signal_restore_set (set=0xbfffed00) at ../sysdeps/unix/sysv/linux/internal-signals.h:84
| #2  __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:48
| #3  0xb74513ce in __GI_abort () at abort.c:79
| #4  0xb76a4c1c in ?? () from /lib/libstdc++.so.6
| #5  0xb76b3336 in ?? () from /lib/libstdc++.so.6
| #6  0xb76b339f in std::terminate() () from /lib/libstdc++.so.6
| #7  0xb76b3682 in __cxa_throw () from /lib/libstdc++.so.6
| #8  0x08383cab in TestFixture::GetMock<GlibMock> () at /usr/lib/gcc/i586-tizen-linux-gnu/9.2.0/include/c++/ext/new_allocator.h:89
| #9  0x08674944 in access (arg1=0x8a14f90 "/home", arg2=0) at /usr/src/debug/notification-0.7.4-1.i386/tests/mock/glib_mock.cc:40
| #10 0x087313c1 in gcov_do_dump ()
| #11 0x08731b73 in __gcov_exit ()
| #12 0xb7fe6cc2 in _dl_fini () at dl-fini.c:138
| #13 0xb746cfff in __run_exit_handlers (status=status@entry=0, listp=0xb760439c <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true,
|     run_dtors=run_dtors@entry=true) at exit.c:108
| #14 0xb746d1d5 in __GI_exit (status=0) at exit.c:139
| #15 0xb7452f5d in __libc_start_main (main=0x8136330 <main(int, char**)>, argc=1, argv=0xbffff4a4, init=0x8731cb0 <__libc_csu_init>,
|     fini=0x8731d20 <__libc_csu_fini>, rtld_fini=0xb7fe6ad0 <_dl_fini>, stack_end=0xbffff49c) at ../csu/libc-start.c:342
| #16 0x08149d01 in _start () at ../sysdeps/i386/start.S:126
+------------------------------------------------------------------------------+

Change-Id: Ic722adb053122e312e42cc2868777c1afb13b495
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tests/mock/glib_mock.cc
tests/noti_unittest/CMakeLists.txt
tests/noti_unittest/src/test_notification_db.cc
tests/noti_unittest/src/test_notification_noti.cc