summaryrefslogtreecommitdiff
path: root/src/tests/ecore_wl2/ecore_wl2_test_display.c
blob: c79621ac742b2183719cfe5157ee75b9ed79fd3d (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>
#include <unistd.h>
#include <Eina.h>
#include <Ecore.h>
#include <Ecore_Wl2.h>

#include "ecore_wl2_suite.h"
#include "ecore_wl2_tests_helpers.h"

EFL_START_TEST(wl2_display_create)
{
   Ecore_Wl2_Display *disp;

   disp = ECORE_WL2_TEST_DISPLAY_SETUP();
   ck_assert(disp != NULL);
}
EFL_END_TEST

EFL_START_TEST(wl2_display_destroy)
{
   Ecore_Wl2_Display *disp;

   disp = ECORE_WL2_TEST_DISPLAY_SETUP();
   ck_assert(disp != NULL);

   ecore_wl2_display_destroy(disp);
}
EFL_END_TEST

EFL_START_TEST(wl2_display_get)
{
   Ecore_Wl2_Display *disp;
   struct wl_display *wdisp;

   disp = ECORE_WL2_TEST_DISPLAY_SETUP();
   ck_assert(disp != NULL);

   wdisp = ecore_wl2_display_get(disp);
   ck_assert(wdisp != NULL);
}
EFL_END_TEST

EFL_START_TEST(wl2_display_name_get)
{
   Ecore_Wl2_Display *disp;

   disp = ECORE_WL2_TEST_DISPLAY_SETUP();
   ck_assert(disp != NULL);

   ck_assert(ecore_wl2_display_name_get(disp) != NULL);
}
EFL_END_TEST

EFL_START_TEST(wl2_display_connect)
{
   Ecore_Wl2_Display *disp;

   disp = ECORE_WL2_TEST_DISPLAY_CONNECT();
   ck_assert(disp != NULL);
}
EFL_END_TEST

EFL_START_TEST(wl2_display_disconnect)
{
   Ecore_Wl2_Display *disp;

   disp = ECORE_WL2_TEST_DISPLAY_CONNECT();
   ck_assert(disp != NULL);

   ecore_wl2_display_disconnect(disp);
}
EFL_END_TEST

void
ecore_wl2_test_display(TCase *tc)
{
   if (!getenv("WAYLAND_DISPLAY"))
     {
        /* tests here are for server-side functions */
        tcase_add_test(tc, wl2_display_create);
        tcase_add_test(tc, wl2_display_destroy);
        tcase_add_test(tc, wl2_display_get);
        tcase_add_test(tc, wl2_display_name_get);
     }

   if (getenv("WAYLAND_DISPLAY"))
     {
        /* tests here are for client-side functions */
        tcase_add_test(tc, wl2_display_connect);
        tcase_add_test(tc, wl2_display_disconnect);
     }
}