From c2e7486dbc7662a55205e8fad2f1c85689eef8ec Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 13 Jul 2015 22:39:39 +0100 Subject: add checks to tests to ensure created surface is not zero size. --- test/polystar.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/polystar.c') diff --git a/test/polystar.c b/test/polystar.c index 7ab6cdc..136b6aa 100644 --- a/test/polystar.c +++ b/test/polystar.c @@ -72,6 +72,11 @@ int main(int argc, char **argv) /* get the geometry of the whole screen */ box.x0 = box.y0 = 0; nsfb_get_geometry(nsfb, &box.x1, &box.y1, NULL); + if ((box.x1 == 0) || (box.y1 == 0)) { + /* if surface was created with no size set a default */ + nsfb_set_geometry(nsfb, 800, 600, NSFB_FMT_ANY); + nsfb_get_geometry(nsfb, &box.x1, &box.y1, NULL); + } nsfb_get_buffer(nsfb, &fbptr, &fbstride); -- cgit v1.2.3