diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2013-02-12 14:24:40 +0000 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-02-18 19:54:16 +0100 |
commit | 6526d8c6fcc10f1b100c570f1d924154cd43b2e9 (patch) | |
tree | e6b970161ba600b110758917e96c5459d2f95649 /tests/gem_render_tiled_blits.c | |
parent | 50c45f9586843bb3b83d9bed5d9738145ba05866 (diff) |
tests: Forbid to run the blit tests with count of 1
Invoking say,
sudo ./tests/gem_render_linear_blits 1
does not make a lot of sense as we're creating a single bo. The test
does not yell at you and passes, even if the rendercopy function does
not do anything. This makes it quite harmful when trying to debug
rendercopy without realizing that count is the number of allocated bos
and must be >= 2.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_render_tiled_blits.c')
-rw-r--r-- | tests/gem_render_tiled_blits.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c index 31b2ee18..626e652e 100644 --- a/tests/gem_render_tiled_blits.c +++ b/tests/gem_render_tiled_blits.c @@ -88,6 +88,11 @@ int main(int argc, char **argv) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / SIZE / 2; + else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; + } + printf("Using %d 1MiB buffers\n", count); buf = malloc(sizeof(*buf)*count); |