Patchwork acpi: method: fix some tests that don't indicate passed when they are complete

login
register
mail settings
Submitter Colin King
Date Jan. 10, 2013, 11:42 a.m.
Message ID <1357818139-22798-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/210979/
State Accepted
Headers show

Comments

Colin King - Jan. 10, 2013, 11:42 a.m.
From: Colin Ian King <colin.king@canonical.com>

Update some ACPI method tests that don't show that they have passed when they
have completed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/method/method.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
Keng-Yu Lin - Jan. 29, 2013, 5:36 a.m.
On Thu, Jan 10, 2013 at 7:42 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Update some ACPI method tests that don't show that they have passed when they
> have completed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/method/method.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 3864e88..baf9c36 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -900,6 +900,7 @@ static void method_test_PLD_return(
>         void *private)
>  {
>         uint32_t i;
> +       bool failed = false;
>
>         FWTS_UNUSED(private);
>
> @@ -914,9 +915,13 @@ static void method_test_PLD_return(
>                                 "%s package element %" PRIu32 " was not a buffer.",
>                                 name, i);
>                         fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
> +                       failed = true;
>                 }
>                 /* We should sanity check the PLD further */
>         }
> +
> +       if (!failed)
> +               method_passed_sane(fw, name, "package");
>  }
>
>  static int method_test_PLD(fwts_framework *fw)
> @@ -1851,6 +1856,7 @@ static void method_test_EDL_return(
>         void *private)
>  {
>         uint32_t i;
> +       bool failed = false;
>
>         FWTS_UNUSED(private);
>
> @@ -1865,8 +1871,12 @@ static void method_test_EDL_return(
>                                 "%s package element %" PRIu32 " was not a reference.",
>                                 name, i);
>                         fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
> +                       failed = true;
>                 }
>         }
> +
> +       if (!failed)
> +               method_passed_sane(fw, name, "package");
>  }
>
>  static int method_test_EDL(fwts_framework *fw)
> @@ -2092,6 +2102,7 @@ static void method_test_power_resources_return(
>         void *private)
>  {
>         uint32_t i;
> +       bool failed = false;
>
>         FWTS_UNUSED(private);
>
> @@ -2106,8 +2117,12 @@ static void method_test_power_resources_return(
>                                 "%s package element %" PRIu32 " was not a reference.",
>                                 name, i);
>                         fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
> +                       failed = true;
>                 }
>         }
> +
> +       if (!failed)
> +               method_passed_sane(fw, name, "package");
>  }
>
>  #define method_test_POWER(name)                                                \
> @@ -3267,6 +3282,7 @@ static void method_test_GRT_return(
>          * Should sanity check this, but we can't read the
>          * the data in this emulated mode, so ignore
>          */
> +       method_passed_sane(fw, name, "buffer");
>  }
>
>  static int method_test_GRT(fwts_framework *fw)
> @@ -3895,6 +3911,8 @@ static void method_test_BMD_return(
>                 }
>         }
>         /* TODO: check return values */
> +       if (!failed)
> +               method_passed_sane(fw, name, "package");
>  }
>
>  static int method_test_BMD(fwts_framework *fw)
> @@ -4527,7 +4545,8 @@ static void method_test_ROM_return(
>         FWTS_UNUSED(obj);
>         FWTS_UNUSED(private);
>
> -       method_check_type(fw, name, buf, ACPI_TYPE_BUFFER);
> +       if (method_check_type(fw, name, buf, ACPI_TYPE_BUFFER) == FWTS_OK)
> +               method_passed_sane(fw, name, "package");
>  }
>
>  static int method_test_ROM(fwts_framework *fw)
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Jan. 31, 2013, 8:51 a.m.
On 01/10/2013 07:42 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Update some ACPI method tests that don't show that they have passed when they
> have completed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/method/method.c | 21 ++++++++++++++++++++-
>   1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 3864e88..baf9c36 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -900,6 +900,7 @@ static void method_test_PLD_return(
>   	void *private)
>   {
>   	uint32_t i;
> +	bool failed = false;
>
>   	FWTS_UNUSED(private);
>
> @@ -914,9 +915,13 @@ static void method_test_PLD_return(
>   				"%s package element %" PRIu32 " was not a buffer.",
>   				name, i);
>   			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
> +			failed = true;
>   		}
>   		/* We should sanity check the PLD further */
>   	}
> +
> +	if (!failed)
> +		method_passed_sane(fw, name, "package");
>   }
>
>   static int method_test_PLD(fwts_framework *fw)
> @@ -1851,6 +1856,7 @@ static void method_test_EDL_return(
>   	void *private)
>   {
>   	uint32_t i;
> +	bool failed = false;
>
>   	FWTS_UNUSED(private);
>
> @@ -1865,8 +1871,12 @@ static void method_test_EDL_return(
>   				"%s package element %" PRIu32 " was not a reference.",
>   				name, i);
>   			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
> +			failed = true;
>   		}
>   	}
> +
> +	if (!failed)
> +		method_passed_sane(fw, name, "package");
>   }
>
>   static int method_test_EDL(fwts_framework *fw)
> @@ -2092,6 +2102,7 @@ static void method_test_power_resources_return(
>   	void *private)
>   {
>   	uint32_t i;
> +	bool failed = false;
>
>   	FWTS_UNUSED(private);
>
> @@ -2106,8 +2117,12 @@ static void method_test_power_resources_return(
>   				"%s package element %" PRIu32 " was not a reference.",
>   				name, i);
>   			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
> +			failed = true;
>   		}
>   	}
> +
> +	if (!failed)
> +		method_passed_sane(fw, name, "package");
>   }
>
>   #define method_test_POWER(name)						\
> @@ -3267,6 +3282,7 @@ static void method_test_GRT_return(
>   	 * Should sanity check this, but we can't read the
>   	 * the data in this emulated mode, so ignore
>   	 */
> +	method_passed_sane(fw, name, "buffer");
>   }
>
>   static int method_test_GRT(fwts_framework *fw)
> @@ -3895,6 +3911,8 @@ static void method_test_BMD_return(
>   		}
>   	}
>   	/* TODO: check return values */
> +	if (!failed)
> +		method_passed_sane(fw, name, "package");
>   }
>
>   static int method_test_BMD(fwts_framework *fw)
> @@ -4527,7 +4545,8 @@ static void method_test_ROM_return(
>   	FWTS_UNUSED(obj);
>   	FWTS_UNUSED(private);
>
> -	method_check_type(fw, name, buf, ACPI_TYPE_BUFFER);
> +	if (method_check_type(fw, name, buf, ACPI_TYPE_BUFFER) == FWTS_OK)
> +		method_passed_sane(fw, name, "package");
>   }
>
>   static int method_test_ROM(fwts_framework *fw)
>
Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 3864e88..baf9c36 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -900,6 +900,7 @@  static void method_test_PLD_return(
 	void *private)
 {
 	uint32_t i;
+	bool failed = false;
 
 	FWTS_UNUSED(private);
 
@@ -914,9 +915,13 @@  static void method_test_PLD_return(
 				"%s package element %" PRIu32 " was not a buffer.",
 				name, i);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
+			failed = true;
 		}
 		/* We should sanity check the PLD further */
 	}
+
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_PLD(fwts_framework *fw)
@@ -1851,6 +1856,7 @@  static void method_test_EDL_return(
 	void *private)
 {
 	uint32_t i;
+	bool failed = false;
 
 	FWTS_UNUSED(private);
 
@@ -1865,8 +1871,12 @@  static void method_test_EDL_return(
 				"%s package element %" PRIu32 " was not a reference.",
 				name, i);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
+			failed = true;
 		}
 	}
+
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_EDL(fwts_framework *fw)
@@ -2092,6 +2102,7 @@  static void method_test_power_resources_return(
 	void *private)
 {
 	uint32_t i;
+	bool failed = false;
 
 	FWTS_UNUSED(private);
 
@@ -2106,8 +2117,12 @@  static void method_test_power_resources_return(
 				"%s package element %" PRIu32 " was not a reference.",
 				name, i);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
+			failed = true;
 		}
 	}
+
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 #define method_test_POWER(name)						\
@@ -3267,6 +3282,7 @@  static void method_test_GRT_return(
 	 * Should sanity check this, but we can't read the
 	 * the data in this emulated mode, so ignore
 	 */
+	method_passed_sane(fw, name, "buffer");
 }
 
 static int method_test_GRT(fwts_framework *fw)
@@ -3895,6 +3911,8 @@  static void method_test_BMD_return(
 		}
 	}
 	/* TODO: check return values */
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_BMD(fwts_framework *fw)
@@ -4527,7 +4545,8 @@  static void method_test_ROM_return(
 	FWTS_UNUSED(obj);
 	FWTS_UNUSED(private);
 
-	method_check_type(fw, name, buf, ACPI_TYPE_BUFFER);
+	if (method_check_type(fw, name, buf, ACPI_TYPE_BUFFER) == FWTS_OK)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_ROM(fwts_framework *fw)