tests: Add ringer tests

We mock libfeedback and CallsCall to test the ringer for the following
scenarios:
- Call state changes
- User requested silencing of ringer
- Multiple calls
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-10-22 07:23:29 +02:00
parent f86162da03
commit 7dadb3c50f
7 changed files with 878 additions and 0 deletions

30
tests/mock-call.h Normal file
View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2021 Purism SPC
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Author: Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>
*
*/
#pragma once
#include "calls-call.h"
G_BEGIN_DECLS
#define CALLS_TYPE_MOCK_CALL (calls_mock_call_get_type())
G_DECLARE_FINAL_TYPE (CallsMockCall, calls_mock_call, CALLS, MOCK_CALL, CallsCall)
CallsMockCall *calls_mock_call_new (void);
void calls_mock_call_set_id (CallsMockCall *self,
const char *id);
void calls_mock_call_set_name (CallsMockCall *self,
const char *name);
void calls_mock_call_set_state (CallsMockCall *self,
CallsCallState state);
void calls_mock_call_set_inbound (CallsMockCall *self,
gboolean inbound);
G_END_DECLS