From 209bc14435580ed340b8bdb10f134d6de76b3bb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Thu, 13 Apr 2023 18:06:52 +0200 Subject: [PATCH] tests: provide getuid() mockup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In some build environments the UID of build processes can be arbitrary high which causes some tests to fail due to checks in app2ext_interface.c Change-Id: I29bd686f6305f1a709e89180debc14e0904bb18b Signed-off-by: Łukasz Stelmach --- unit-tests/lib/test_lib.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unit-tests/lib/test_lib.cc b/unit-tests/lib/test_lib.cc index 14a26ae..555a35e 100644 --- a/unit-tests/lib/test_lib.cc +++ b/unit-tests/lib/test_lib.cc @@ -29,6 +29,10 @@ namespace { static GVariant* __last_parameters; static gchar* __last_method_name; +extern "C" uid_t getuid(void) { + return 1; +} + extern "C" GDBusConnection* g_bus_get_sync(GBusType type, GCancellable* cancellable, GError** error) { gpointer dummy = g_object_new(G_TYPE_OBJECT, nullptr); -- 2.7.4