From e7d4d2426590844c6f6994b3727d918fc9a20186 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 20 Aug 2018 14:06:56 +0300 Subject: [PATCH] mdbx-test: add min/max cases for option values. Change-Id: Ie77b828376a75aad09ea4dab202178b1f09bc6ad --- test/config.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/config.cc b/test/config.cc index e920e90c..814187ec 100644 --- a/test/config.cc +++ b/test/config.cc @@ -133,6 +133,16 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option, return true; } + if (strcmp(value_cstr, "min") == 0 || strcmp(value_cstr, "minimal") == 0) { + value = minval; + return true; + } + + if (strcmp(value_cstr, "max") == 0 || strcmp(value_cstr, "maximal") == 0) { + value = maxval; + return true; + } + char *suffix = nullptr; errno = 0; unsigned long long raw = strtoull(value_cstr, &suffix, 0);