#include "yasl/yasl.h" #include #include static void test_scaling(void) { assert(yasl_scale_to_device(10.0, 120) == 10); assert(yasl_scale_to_device(10.0, 240) == 20); assert(yasl_scale_to_logical(20, 240) == 10); } static void test_timing_clock(void) { struct yasl_frame_clock clock = { .refresh_ns = 16666666.0 }; yasl_clock_presented(&clock, 1000000000, true); assert(clock.last_present_ns == 1000000000); uint64_t next = yasl_clock_next_present_ns(&clock); assert(next > 1000000000); yasl_clock_note_resize(&clock, 500000); struct yasl_resize_stats stats; yasl_clock_resize_stats(&clock, &stats); assert(stats.count == 1); assert(stats.max_us == 500.0); } int main(void) { test_scaling(); test_timing_clock(); printf("All YASL basic tests passed.\n"); return 0; }