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.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_api.cpp b/tests/test_api.cpp
new file mode 100644
index 0000000..70c4ff7
--- /dev/null
+++ b/tests/test_api.cpp
@@ -0,0 +1,27 @@
+#include "yasl/native.h"
+#include "yasl/loop.h"
+#include <yasl/timing.h>
+#include <yasl/yasl.h>
+#include <cassert>
+
+int main()
+{
+ yasl_timing timing = yasl_surface_timing(nullptr);
+ assert(timing.source == YASL_TIMING_UNKNOWN);
+ assert(yasl_scale_to_device(10.0, 240) == 20);
+ yasl_geometry geometry = yasl_surface_geometry(nullptr);
+ assert(geometry.scale_120 == YASL_SCALE_UNIT);
+ assert(!yasl_display_get_native_handle(nullptr));
+ assert(!yasl_surface_get_native_handle(nullptr));
+ yasl_native_frame native{};
+ assert(!yasl_surface_get_native_frame(nullptr, nullptr, &native));
+
+ yasl_loop *loop = yasl_loop_create();
+ assert(loop);
+ assert(yasl_loop_step(loop, 0) >= 0);
+ yasl_loop_destroy(loop);
+
+ yasl_input_event event{};
+ assert(!yasl_surface_input_poll(nullptr, &event));
+ return 0;
+}