Patchwork [2/3] lib: fwts_summary: handle the log_type now that it is a bit map

login
register
mail settings
Submitter Colin King
Date June 11, 2012, 10 a.m.
Message ID <1339408838-31877-3-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/164114/
State Accepted
Headers show

Comments

Colin King - June 11, 2012, 10 a.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_summary.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Chris Van Hoof - June 11, 2012, 3:54 p.m.
On 06/11/2012 06:00 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_summary.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lib/src/fwts_summary.c b/src/lib/src/fwts_summary.c
> index 8070a34..b8fe644 100644
> --- a/src/lib/src/fwts_summary.c
> +++ b/src/lib/src/fwts_summary.c
> @@ -255,8 +255,8 @@ int fwts_summary_report(fwts_framework *fw, fwts_list *test_list)
>  		fwts_log_nl(fw);
>  	}
>  
> -	if ((fw->log_type == LOG_TYPE_PLAINTEXT ||
> -	     fw->log_type == LOG_TYPE_HTML) && fw->total_run > 0) {
> +	if ((fw->log_type & (LOG_TYPE_PLAINTEXT| LOG_TYPE_HTML)) &&
> +	     fw->total_run > 0) {
>  		sorted = fwts_list_new();
>  		fwts_list_foreach(item, test_list)
>  			fwts_list_add_ordered(sorted, fwts_list_data(fwts_framework_test *,item), fwts_framework_compare_test_name);

Gave this a spin with fwts -b --log-type html,plaintext ... results can
be found here:

http://ouwish.com/~vanhoof/pickup/cking/fwts_2012-06-11/

Tested-by: Chris Van Hoof <vanhoof@canonical.com>
Keng-Yu Lin - June 13, 2012, 9:49 a.m.
On Mon, Jun 11, 2012 at 6:00 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_summary.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_summary.c b/src/lib/src/fwts_summary.c
> index 8070a34..b8fe644 100644
> --- a/src/lib/src/fwts_summary.c
> +++ b/src/lib/src/fwts_summary.c
> @@ -255,8 +255,8 @@ int fwts_summary_report(fwts_framework *fw, fwts_list *test_list)
>                fwts_log_nl(fw);
>        }
>
> -       if ((fw->log_type == LOG_TYPE_PLAINTEXT ||
> -            fw->log_type == LOG_TYPE_HTML) && fw->total_run > 0) {
> +       if ((fw->log_type & (LOG_TYPE_PLAINTEXT| LOG_TYPE_HTML)) &&
> +            fw->total_run > 0) {
>                sorted = fwts_list_new();
>                fwts_list_foreach(item, test_list)
>                        fwts_list_add_ordered(sorted, fwts_list_data(fwts_framework_test *,item), fwts_framework_compare_test_name);
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - June 18, 2012, 3:12 a.m.
On 06/11/2012 06:00 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/lib/src/fwts_summary.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_summary.c b/src/lib/src/fwts_summary.c
> index 8070a34..b8fe644 100644
> --- a/src/lib/src/fwts_summary.c
> +++ b/src/lib/src/fwts_summary.c
> @@ -255,8 +255,8 @@ int fwts_summary_report(fwts_framework *fw, fwts_list *test_list)
>   		fwts_log_nl(fw);
>   	}
>
> -	if ((fw->log_type == LOG_TYPE_PLAINTEXT ||
> -	     fw->log_type == LOG_TYPE_HTML)&&  fw->total_run>  0) {
> +	if ((fw->log_type&  (LOG_TYPE_PLAINTEXT| LOG_TYPE_HTML))&&
> +	     fw->total_run>  0) {
>   		sorted = fwts_list_new();
>   		fwts_list_foreach(item, test_list)
>   			fwts_list_add_ordered(sorted, fwts_list_data(fwts_framework_test *,item), fwts_framework_compare_test_name);

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/lib/src/fwts_summary.c b/src/lib/src/fwts_summary.c
index 8070a34..b8fe644 100644
--- a/src/lib/src/fwts_summary.c
+++ b/src/lib/src/fwts_summary.c
@@ -255,8 +255,8 @@  int fwts_summary_report(fwts_framework *fw, fwts_list *test_list)
 		fwts_log_nl(fw);
 	}
 
-	if ((fw->log_type == LOG_TYPE_PLAINTEXT ||
-	     fw->log_type == LOG_TYPE_HTML) && fw->total_run > 0) {
+	if ((fw->log_type & (LOG_TYPE_PLAINTEXT| LOG_TYPE_HTML)) &&
+	     fw->total_run > 0) {
 		sorted = fwts_list_new();
 		fwts_list_foreach(item, test_list)
 			fwts_list_add_ordered(sorted, fwts_list_data(fwts_framework_test *,item), fwts_framework_compare_test_name);