monitor: request-handler: Fix wrong hash function when using integer key 50/277450/4
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 6 Jul 2022 09:16:29 +0000 (18:16 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 8 Jul 2022 09:03:24 +0000 (18:03 +0900)
commitaf1f87f100cfafb316285c5a8349530fe379ed62
tree9db46763d911465bf284ccdac73a398e264cc117
parente45c248c8ddd067b9de838af54fc682f19b48a34
monitor: request-handler: Fix wrong hash function when using integer key

The glib hash supports the various hash type. The resource-monitor uses
the integer value of resource id as the key of hash. If want to use
the integer key value, have to use 'g_direct_hash'[1] function
and 'g_direct_equal' function to compare the integer key instead of
pointer key for finding the inserted data.

[1] https://docs.gtk.org/glib/func.direct_hash.html
[2] https://docs.gtk.org/glib/func.direct_equal.html

Fix the following issues by this patch:
[  FAILED  ] ResourceMonitorTest/EachResourceMonitorTest.pass_resource_monitor_set_resource_ctrl/0
[  FAILED  ] ResourceMonitorTest/EachResourceMonitorTest.pass_resource_monitor_set_resource_attr/0
[  FAILED  ] ResourceMonitorTest/EachResourceMonitorTest.pass_resource_monitor_get_value/0

Change-Id: I128fd800d44e5709d55d0c7a44a80db94e6d83d8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/monitor/request-handler.c