1
0
forked from drath/libratbag

test: add dpi min/max tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2017-10-13 11:53:45 +10:00
committed by Benjamin Tissoires
parent aeaa69b9e1
commit b140bc2827
4 changed files with 17 additions and 3 deletions

View File

@@ -342,7 +342,7 @@ START_TEST(device_resolutions)
struct ratbag_resolution *res;
int nprofiles, nresolutions;
int i, j;
int xres, yres, rate;
int xres, yres, rate, dpi_min, dpi_max;
int device_freed_count = 0;
bool is_active;
@@ -353,7 +353,7 @@ START_TEST(device_resolutions)
.profiles = {
{
.resolutions = {
{ .xres = 100, .yres = 200, .hz = 1000 },
{ .xres = 100, .yres = 200, .hz = 1000, .dpi_min = 50, .dpi_max = 5000},
{ .xres = 200, .yres = 300, .hz = 1000, .active = true },
{ .xres = 300, .yres = 400, .hz = 1000 },
},
@@ -394,12 +394,17 @@ START_TEST(device_resolutions)
yres = ratbag_resolution_get_dpi_y(res);
rate = ratbag_resolution_get_report_rate(res);
is_active = ratbag_resolution_is_active(res);
dpi_min = ratbag_resolution_get_dpi_minimum(res);
dpi_max = ratbag_resolution_get_dpi_maximum(res);
ck_assert_int_eq(xres, i * 1000 + (j + 1) * 100);
ck_assert_int_eq(yres, i * 1000 + (j + 1) * 100 + 100);
ck_assert_int_eq(xres, ratbag_resolution_get_dpi(res));
ck_assert_int_eq(is_active, (j == 1));
ck_assert_int_eq(dpi_min, 50);
ck_assert_int_eq(dpi_max, 5000);
ck_assert_int_eq(rate, (i + 1) * 1000);
ratbag_resolution_unref(res);