diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-07-13 22:39:39 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-07-13 22:39:39 +0100 |
commit | c2e7486dbc7662a55205e8fad2f1c85689eef8ec (patch) | |
tree | fd666ffe540380b2ed8fdd2c28e7ca6bef3d77e9 /test/polystar2.c | |
parent | 596eeb57dc79eb4ad8293282639194ae5bb7e12e (diff) | |
download | libnsfb-c2e7486dbc7662a55205e8fad2f1c85689eef8ec.tar.gz libnsfb-c2e7486dbc7662a55205e8fad2f1c85689eef8ec.tar.bz2 |
add checks to tests to ensure created surface is not zero size.
Diffstat (limited to 'test/polystar2.c')
-rw-r--r-- | test/polystar2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/polystar2.c b/test/polystar2.c index 164d429..a843f9d 100644 --- a/test/polystar2.c +++ b/test/polystar2.c @@ -72,6 +72,12 @@ 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); radius = (box.x1 / 3); |