summaryrefslogtreecommitdiff
path: root/tests/rendernode.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-12-25 19:51:30 +0100
committerBenjamin Otte <otte@redhat.com>2016-12-26 17:22:01 +0100
commitc7083a5d37d09357581c670ef841eaf556a60b24 (patch)
tree890dad0fe8af84606d226e323d7905fe70162395 /tests/rendernode.c
parent2a7171534e8cf18fa4716da4a4ba1d6aa4533406 (diff)
downloadgtk+-c7083a5d37d09357581c670ef841eaf556a60b24.tar.gz
tests: Make sure number of runs is 1.
Diffstat (limited to 'tests/rendernode.c')
-rw-r--r--tests/rendernode.c7
1 files changed, 6 insertions, 1 deletions
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]);