summaryrefslogtreecommitdiff
path: root/tests/test_api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_api.cpp')
-rw-r--r--tests/test_api.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/test_api.cpp b/tests/test_api.cpp
index c0693eb..acfbbb8 100644
--- a/tests/test_api.cpp
+++ b/tests/test_api.cpp
@@ -19,8 +19,17 @@
int main()
{
yasl_event e{};
- e.pen.x=1.5;e.pen.pressure=0.25;
- assert(e.pen.pressure==0.25);
- assert(!yasl_surface_create("invalid",-1,10,0));
- yasl_shutdown();return 0;
+ e.pen.x = 1.5;
+ e.pen.pressure = 0.25;
+ assert(e.pen.pressure == 0.25);
+ yasl_surface_options options{};
+ options.width = -1;
+ options.height = 10;
+ assert(!yasl_surface_create(&options) && errno == EINVAL);
+ yasl_gl_options gl = YASL_GL_OPTIONS_INIT;
+ assert(gl.major == 3 && gl.minor == 2 && gl.share == nullptr);
+ yasl_cpu_buffer buffer{};
+ assert(yasl_cpu_acquire(nullptr, &buffer) == -ENODEV);
+ yasl_shutdown();
+ return 0;
}