summaryrefslogtreecommitdiffstats
path: root/server/tests/test_empty_success.c
blob: 82436dc8000589e93ba14ac5ba1bf1a0742807d9 (plain)
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
#include <config.h>
#include <stdlib.h>
#include <string.h>

#include <spice.h>

struct SpiceTimer {
    int a,b;
};

SpiceTimer* timer_add(SPICE_GNUC_UNUSED SpiceTimerFunc func,
                      SPICE_GNUC_UNUSED void *opaque)
{
    static struct SpiceTimer t = {0,};

    return &t;
}

void timer_start(SPICE_GNUC_UNUSED SpiceTimer *timer,
                 SPICE_GNUC_UNUSED uint32_t ms)
{
}

void timer_cancel(SPICE_GNUC_UNUSED SpiceTimer *timer)
{
}

void timer_remove(SPICE_GNUC_UNUSED SpiceTimer *timer)
{
}

SpiceWatch *watch_add(SPICE_GNUC_UNUSED int fd,
                      SPICE_GNUC_UNUSED int event_mask,
                      SPICE_GNUC_UNUSED SpiceWatchFunc func,
                      SPICE_GNUC_UNUSED void *opaque)
{
    return NULL;
}

void watch_update_mask(SPICE_GNUC_UNUSED SpiceWatch *watch,
                       SPICE_GNUC_UNUSED int event_mask)
{
}

void watch_remove(SPICE_GNUC_UNUSED SpiceWatch *watch)
{
}

void channel_event(SPICE_GNUC_UNUSED int event,
                   SPICE_GNUC_UNUSED SpiceChannelEventInfo *info)
{
}

int main(void)
{
    SpiceServer *server = spice_server_new();
    SpiceCoreInterface core;

    memset(&core, 0, sizeof(core));
    core.base.major_version = SPICE_INTERFACE_CORE_MAJOR;
    core.timer_add = timer_add;
    core.timer_start = timer_start;
    core.timer_cancel = timer_cancel;
    core.timer_remove = timer_remove;
    core.watch_add = watch_add;
    core.watch_update_mask = watch_update_mask;
    core.watch_remove = watch_remove;
    core.channel_event = channel_event;

    spice_server_set_port(server, 5911);
    spice_server_init(server, &core);

    spice_server_destroy(server);

    return 0;
}