1#include "../../SDL3/sdl_wheel.hpp"
7static bool check(
const char* what,
float notches,
int n, INT32 expect)
11 for (
int i = 0; i < n; i++)
12 sum += axis.add(notches);
15 std::cerr <<
"[TestSDLWheel] " << what <<
": " << n <<
" x " << notches <<
" notches gave "
16 << sum <<
", expected " << expect << std::endl;
22int TestSDLWheel(
int argc,
char* argv[])
29 ok &= check(
"mouse wheel", 1.0f, 3, 360);
30 ok &= check(
"mouse wheel up", -1.0f, 3, -360);
32 ok &= check(
"touchpad 4 px", 4.0f / 100.0f, 50, 240);
33 ok &= check(
"touchpad 4 px up", -4.0f / 100.0f, 50, -240);
35 ok &= check(
"touchpad 0.5 px", 0.5f / 100.0f, 100, 60);
37 ok &= check(
"high resolution wheel", 1.0f / 8.0f, 8, 120);