From e5a6ace32daee0156bb0884ef40d534680b2be5e Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sun, 15 Jan 2023 10:49:12 +0100 Subject: [PATCH] tests: Don't mock calls_contacts_provider_new() Having set which folks backends to use the real function can be used without causing any warnings leading to the build to fail. --- tests/meson.build | 10 +++------- tests/mock-contacts-provider.h | 14 -------------- tests/test-manager.c | 7 ------- tests/test-ringer.c | 9 --------- tests/test-ui-call.c | 8 -------- 5 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 tests/mock-contacts-provider.h diff --git a/tests/meson.build b/tests/meson.build index 7a528a4..b0c084b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -23,16 +23,12 @@ test_link_args = [ '-fPIC', ] -mock_link_args = [ test_link_args, - '-Wl,--wrap=calls_contacts_provider_new', - ] - test_sources = [ 'test-manager.c' ] t = executable('manager', test_sources, c_args : test_cflags, - link_args: mock_link_args, + link_args: test_link_args, pie: true, link_with : [calls_vala, libcalls], dependencies: calls_deps, @@ -73,7 +69,7 @@ test('util', t, env: test_env) test_sources = [ 'test-ui-call.c', 'mock-call.c', 'mock-call.h' ] t = executable('ui-call', test_sources, c_args : test_cflags, - link_args : mock_link_args, + link_args : test_link_args, pie: true, link_with : [calls_vala, libcalls], dependencies : calls_deps, @@ -90,7 +86,7 @@ test_sources = [ t = executable('ringer', test_sources, c_args : test_cflags, - link_args: mock_link_args, + link_args: test_link_args, pie: true, link_with : [calls_vala, libcalls, libfeedback], dependencies: calls_deps, diff --git a/tests/mock-contacts-provider.h b/tests/mock-contacts-provider.h deleted file mode 100644 index c79d801..0000000 --- a/tests/mock-contacts-provider.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (C) 2021 Purism SPC - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * Author: Evangelos Ribeiro Tzaras - * - */ - -#pragma once - -#include "calls-contacts-provider.h" - -CallsContactsProvider *__wrap_calls_contacts_provider_new (void); diff --git a/tests/test-manager.c b/tests/test-manager.c index 9caa4e9..04165e3 100644 --- a/tests/test-manager.c +++ b/tests/test-manager.c @@ -5,18 +5,11 @@ */ #include "calls-manager.h" -#include "mock-contacts-provider.h" #include #include #include -CallsContactsProvider * -__wrap_calls_contacts_provider_new (void) -{ - return NULL; -} - struct TestData { GMainLoop *loop; CallsManager *manager; diff --git a/tests/test-ringer.c b/tests/test-ringer.c index 4c44ea2..e82dcfa 100644 --- a/tests/test-ringer.c +++ b/tests/test-ringer.c @@ -11,15 +11,6 @@ #include "calls-ringer.h" #include "calls-ui-call-data.h" #include "mock-call.h" -#include "mock-contacts-provider.h" - - -/* mock calls_contacts_provider_new() */ -CallsContactsProvider * -__wrap_calls_contacts_provider_new (void) -{ - return NULL; -} /* add or remove calls */ diff --git a/tests/test-ui-call.c b/tests/test-ui-call.c index fd9b3c6..5cd84c1 100644 --- a/tests/test-ui-call.c +++ b/tests/test-ui-call.c @@ -9,17 +9,9 @@ #include "calls-ui-call-data.h" #include "mock-call.h" -#include "mock-contacts-provider.h" #include -CallsContactsProvider * -__wrap_calls_contacts_provider_new (void) -{ - return NULL; -} - - static void test_cui_call_state_mapping (void) {