summaryrefslogtreecommitdiff
path: root/tests/benchmark.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 15:41:39 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 15:41:39 +0300
commit482f799d356a8fbb8f585c4de7cc0992b8dc6fd3 (patch)
tree85551a69e3c356da7b9b514224e25a6c2f8d29b9 /tests/benchmark.c
parent537b2d768b31deb0f95c5122e0d562e4406ae9a0 (diff)
Migrate tests to the unified event API
Port backend, input, tablet and app tests from yasl_input_event and YASL_INPUT_* to struct yasl_event and YASL_EVENT_*. The input allocation test links input.c on its own, so it stubs yasl_loop_now_ns() for the new event timestamps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/benchmark.c')
-rw-r--r--tests/benchmark.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/benchmark.c b/tests/benchmark.c
index 7431715..1cea614 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -135,9 +135,9 @@ static void bench_input_queue_resize(void) {
for (int b = 0; b < batches; b++) {
struct input_queue q = {0};
for (int i = 0; i < size; i++) {
- struct yasl_input_event ev = {
- .kind = YASL_INPUT_MOUSE,
- .mouse = { .pos = { .x = i, .y = b } },
+ struct yasl_event ev = {
+ .type = YASL_EVENT_POINTER_MOTION,
+ .pointer = { .pos = { .x = i, .y = b } },
};
input_queue_push(&q, &ev);
}
@@ -160,13 +160,13 @@ static void bench_input_queue_push_pop(void) {
uint64_t t0 = get_time_ns();
for (int r = 0; r < rounds; r++) {
for (int i = 0; i < events_per_round; i++) {
- struct yasl_input_event ev = {
- .kind = YASL_INPUT_MOUSE,
- .mouse = { .pos = { .x = i, .y = r }, .button = 1 },
+ struct yasl_event ev = {
+ .type = YASL_EVENT_POINTER_DOWN,
+ .pointer = { .pos = { .x = i, .y = r }, .button = YASL_BUTTON_MIDDLE },
};
input_queue_push(&q, &ev);
}
- struct yasl_input_event out;
+ struct yasl_event out;
while (input_queue_pop(&q, &out)) {
/* consume */
}