[PATCH 2/3] lib: fwts_framework: sanity check new options
Keng-Yu Lin
kengyu at canonical.com
Tue Nov 27 08:11:33 UTC 2012
On Fri, Nov 23, 2012 at 12:30 AM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The --filter-error-discard and --filter-error-keep options are
> mutually exclusive. So check for this.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_framework.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index 1f01466..eac05bd 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -1233,6 +1233,16 @@ int fwts_framework_args(const int argc, char **argv)
> goto tidy_close;
> }
>
> + /* These are mutually exclusive, both cannot have items */
> + if ((fwts_list_len(&fw->errors_filter_keep) > 0) &&
> + (fwts_list_len(&fw->errors_filter_discard) > 0)) {
> + fprintf(stderr,
> + "The --filter-error-discard and --filter-error-keep options are\n"
> + "mutually exclusive. Specify one or the other, but not both.\n");
> + ret = FWTS_ERROR;
> + goto tidy_close;
> + }
> +
> /* Ensure we have just one log type specified for non-filename logging */
> if (fwts_log_type_count(fw->log_type) > 1 &&
> fwts_log_get_filename_type(fw->results_logname) != LOG_FILENAME_TYPE_FILE) {
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>
More information about the fwts-devel
mailing list