about summary refs log tree commit diff stats
path: root/Dockerfile.debian
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2023-04-03 17:13:00 +0200
committerGitHub <noreply@github.com>2023-04-03 17:13:00 +0200
commit2caae3ed9933cabb6e997631f02493bf08ce9b73 (patch)
tree539900206b450ff5b8369fd1ded11979fb88d6a3 /Dockerfile.debian
parentf2c83fa8ceea29e295509c8b964f1e9ccda2f0e4 (diff)
parentc7f05c9ebf69921cab8ff6f902938982c517d1b9 (diff)
downloadprofani-tty-2caae3ed9933cabb6e997631f02493bf08ce9b73.tar.gz
Merge pull request #1807 from alexandre1985/fix/typos
Fix typos and add codespell configuration
Diffstat (limited to 'Dockerfile.debian')
0 files changed, 0 insertions, 0 deletions
etter <jubalh@iodoru.org> 2020-07-07 13:53:30 +0200 committer Michael Vetter <jubalh@iodoru.org> 2020-07-07 13:53:30 +0200 Revert "Apply coding style"' href='/danisanti/profani-tty/commit/tests/unittests/test_server_events.c?id=a4cadf78faabc157e5db00e42302d495bba432c0'>a4cadf78 ^
9b55f2de ^
a4cadf78 ^


9b55f2de ^
a4cadf78 ^

a7a28506 ^
a2726b6a ^

a7a28506 ^
a7a28506 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
a2726b6a ^
a2c62117 ^
a2726b6a ^
a7a28506 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
0e2fbeb3 ^
055a5f71 ^
a48df401 ^
a7a28506 ^

a2726b6a ^

a7a28506 ^
a7a28506 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
a2726b6a ^
a2c62117 ^
a2726b6a ^
0e2fbeb3 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
a7a28506 ^
055a5f71 ^
a48df401 ^
a7a28506 ^

a2726b6a ^

a7a28506 ^
a7a28506 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
a2726b6a ^
a2c62117 ^
a2726b6a ^
a7a28506 ^
a2c62117 ^


0e2fbeb3 ^
8ebc1d4a ^
0e2fbeb3 ^
055a5f71 ^
a48df401 ^
a7a28506 ^
5afb296e ^
a2726b6a ^

95ad5643 ^
a48df401 ^
055a5f71 ^
6d39f49f ^
95ad5643 ^
a2726b6a ^

95ad5643 ^
a2726b6a ^
95ad5643 ^
51bd4ed3 ^
a2726b6a ^
055a5f71 ^

8aba52f4 ^
a2726b6a ^
95ad5643 ^
9bd2315d ^
95ad5643 ^
055a5f71 ^
95ad5643 ^
a48df401 ^
95ad5643 ^
f180925c ^
a2726b6a ^

f180925c ^
055a5f71 ^
6d39f49f ^
f180925c ^
51bd4ed3 ^

f180925c ^

8aba52f4 ^
f180925c ^
a2726b6a ^

f180925c ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

                   

                   

                   
                 
 
                                

                             
                              


                               
                     

                            
 

                                                           
 
                                                      
                   
                    
                                      
                                   
                                                    
                                                                             
 


                                                                           
 
                                                        
 
                     
                       

 

                                                        
 
                                                   
                   
                    
                                      
                                   
                                                    
                                                                             
 


                                                                           
 
                                                        
 
                     
                       

 

                                                     
 
                                                   
                   
                    
                                      
                                   
                                                    
                                                                             
 


                                                                           
 
                                                        
 
                     
                       
 
 

                                                 
 
                   
                    
                                      
                         

                                             
                                                    
                                                                            
                                                     
                                                            
                                                             

                                                      
                                                   
                                                     
 
                         
 
                     
                          
                       
 
 

                                                  
 
                    
                                      
                         

                                                                       

                                 
                            
 

                                                                 


                          
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#include "event/server_events.h"
#include "xmpp/xmpp.h"
#include "xmpp/roster_list.h"
#include "xmpp/chat_session.h"
#include "config/preferences.h"
#include "ui/ui.h"
#include "ui/stub_ui.h"
#include "xmpp/muc.h"
#include "plugins/plugins.h"
#include "ui/window_list.h"

void
console_shows_online_presence_when_set_online(void** state)
{
    prefs_set_string(PREF_STATUSES_CONSOLE, "online");
    plugins_init();
    roster_create();
    roster_process_pending_presence();
    char* barejid = "test1@server";
    roster_add(barejid, "bob", NULL, "both", FALSE);
    Resource* resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10);

    expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid));
    expect_memory(ui_contact_online, resource, resource, sizeof(resource));
    expect_value(ui_contact_online, last_activity, NULL);

    sv_ev_contact_online(barejid, resource, NULL, NULL);

    roster_destroy();
    plugins_shutdown();
}

void
console_shows_online_presence_when_set_all(void** state)
{
    prefs_set_string(PREF_STATUSES_CONSOLE, "all");
    plugins_init();
    roster_create();
    roster_process_pending_presence();
    char* barejid = "test1@server";
    roster_add(barejid, "bob", NULL, "both", FALSE);
    Resource* resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10);

    expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid));
    expect_memory(ui_contact_online, resource, resource, sizeof(resource));
    expect_value(ui_contact_online, last_activity, NULL);

    sv_ev_contact_online(barejid, resource, NULL, NULL);

    roster_destroy();
    plugins_shutdown();
}

void
console_shows_dnd_presence_when_set_all(void** state)
{
    prefs_set_string(PREF_STATUSES_CONSOLE, "all");
    plugins_init();
    roster_create();
    roster_process_pending_presence();
    char* barejid = "test1@server";
    roster_add(barejid, "bob", NULL, "both", FALSE);
    Resource* resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10);

    expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid));
    expect_memory(ui_contact_online, resource, resource, sizeof(resource));
    expect_value(ui_contact_online, last_activity, NULL);

    sv_ev_contact_online(barejid, resource, NULL, NULL);

    roster_destroy();
    plugins_shutdown();
}

void
handle_offline_removes_chat_session(void** state)
{
    plugins_init();
    roster_create();
    roster_process_pending_presence();
    chat_sessions_init();
    char* barejid = "friend@server.chat.com";
    char* resource = "home";
    roster_add(barejid, "bob", NULL, "both", FALSE);
    Resource* resourcep = resource_new(resource, RESOURCE_ONLINE, NULL, 10);
    roster_update_presence(barejid, resourcep, NULL);
    chat_session_recipient_active(barejid, resource, FALSE);
    ProfConsoleWin* console = malloc(sizeof(ProfConsoleWin));
    will_return(win_create_console, &console->window);
    wins_init();
    sv_ev_contact_offline(barejid, resource, NULL);
    ChatSession* session = chat_session_get(barejid);

    assert_null(session);

    roster_destroy();
    chat_sessions_clear();
    plugins_shutdown();
}

void
lost_connection_clears_chat_sessions(void** state)
{
    roster_create();
    roster_process_pending_presence();
    chat_sessions_init();
    chat_session_recipient_active("bob@server.org", "laptop", FALSE);
    chat_session_recipient_active("steve@server.org", "mobile", FALSE);
    expect_any_cons_show_error();

    sv_ev_lost_connection();

    ChatSession* session1 = chat_session_get("bob@server.org");
    ChatSession* session2 = chat_session_get("steve@server.org");
    assert_null(session1);
    assert_null(session2);
}