summaryrefslogtreecommitdiff
path: root/tests/test_lifecycle.c
blob: a334fed0266ffce8dbde209cae642cfd55c4854e (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
#include <yasl/yasl.h>
#include <yasl/cpu.h>
#include <yasl/gl.h>
#include <yasl/desktop.h>
#include <assert.h>
int main(void)
{
    yasl_shutdown(); yasl_wake();
    yasl_event e={.type=YASL_EVENT_QUIT};
    assert(yasl_wait_event(&e,0)==-1 && e.type==YASL_EVENT_NONE);
    assert(yasl_get_error(NULL)==YASL_ERROR_NOT_INITIALIZED);
    assert(!yasl_set_backend((enum yasl_backend)999));
    assert(yasl_get_error(NULL)==YASL_ERROR_INVALID);
    assert(!yasl_surface_create("bad",0,64,0));
    assert(!yasl_surface_create("bad",64,64,16));
    assert(yasl_set_app_id("org.yasl.api"));
    assert(yasl_set_backend(YASL_BACKEND_AUTO));
    yasl_surface_destroy(NULL);
    assert(yasl_time_ns()>0);
    const char *description=NULL;yasl_get_error(&description);assert(description);
    int w=9,h=9;yasl_surface_get_size(NULL,&w,&h);assert(w==0&&h==0);
    assert(yasl_executable_path(NULL,0)>0);
    yasl_shutdown();return 0;
}