blob: d1b3eb88c8538464c65ffade477151e7d6e70cea (
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
|
#define _POSIX_C_SOURCE 200809L
#include "yasl/yasl.h"
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
int main(void)
{
struct yasl_display_spec spec = {.backend = (enum yasl_backend)999};
errno = 0;
assert(!yasl_display_open(NULL, &spec));
assert(errno == EINVAL);
assert(yasl_display_backend(NULL) == YASL_BACKEND_AUTO);
#if !YASL_HAS_COCOA
spec.backend = YASL_BACKEND_COCOA;
errno = 0;
assert(!yasl_display_open(NULL, &spec));
assert(errno == ENOSYS);
#endif
#if !YASL_HAS_WAYLAND
spec.backend = YASL_BACKEND_WAYLAND;
errno = 0;
assert(!yasl_display_open(NULL, &spec));
assert(errno == ENOSYS);
#endif
#if !YASL_HAS_X11
spec.backend = YASL_BACKEND_X11;
errno = 0;
assert(!yasl_display_open(NULL, &spec));
assert(errno == ENOSYS);
#endif
return 0;
}
|