From c7083a5d37d09357581c670ef841eaf556a60b24 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 25 Dec 2016 19:51:30 +0100 Subject: tests: Make sure number of runs is 1. --- tests/rendernode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/rendernode.c') diff --git a/tests/rendernode.c b/tests/rendernode.c index 5222b7b741..d7924d233a 100644 --- a/tests/rendernode.c +++ b/tests/rendernode.c @@ -3,7 +3,7 @@ static gboolean benchmark = FALSE; static gboolean dump_variant = FALSE; static gboolean fallback = FALSE; -static int runs; +static int runs = 1; static GOptionEntry options[] = { { "benchmark", 'b', 0, G_OPTION_ARG_NONE, &benchmark, "Time operations", NULL }, @@ -32,6 +32,11 @@ main(int argc, char **argv) return 1; } + if (runs < 1) + { + g_printerr ("Number of runs given with -r/--runs must be at least 1 and not %d.\n", runs); + return 1; + } if (!(argc == 3 || (argc == 2 && (dump_variant || benchmark)))) { g_printerr ("Usage: %s [OPTIONS] NODE-FILE PNG-FILE\n", argv[0]); -- cgit v1.2.1