diff mbox

acpi: method: add _PCL control method test (LP:1343070)

Message ID 1405567979-31294-1-git-send-email-alex.hung@canonical.com
State Rejected
Headers show

Commit Message

Alex Hung July 17, 2014, 3:32 a.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/method/method.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Colin Ian King July 17, 2014, 10:41 a.m. UTC | #1
On 17/07/14 04:32, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 1de08ec..686ecd8 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -138,7 +138,7 @@
>   * _OSI  5.7.2		n/a
>   * _OST  6.3.5		n/a
>   * _PAI  10.4.4		n/a
> - * _PCL  10.3.2		N
> + * _PCL  10.3.2		Y
>   * _PCT  8.4.4.1	Y
>   * _PDC  8.4.1		N
>   * _PDL  8.4.4.6	Y
> @@ -3845,7 +3845,13 @@ static void method_test_PCL_return(fwts_framework *fw,
>  	FWTS_UNUSED(obj);
>  	FWTS_UNUSED(private);
>  
> -	/* FIXME */
> +	if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
> +		return;
> +
> +	if (method_package_elements_all_type(fw, name, "_PCL", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK)
> +		return;
> +
> +	fwts_passed(fw,	"%s returned a sane package of %" PRIu32 " referneces.", name, obj->Package.Count);

"referneces" -> should be "references"


>  }
>  
>  static int method_test_PCL(fwts_framework *fw)
> @@ -5043,11 +5049,10 @@ static fwts_framework_minor_test method_tests[] = {
>  	{ method_test_BTP, "Test _BTP (Battery Trip Point)." },
>  	{ method_test_BTM, "Test _BTM (Battery Time)." },
>  	/* { method_test_BLT, "Test _BLT (Battery Level Threshold)." }, */
> -	{ method_test_PCL, "Test _PCL (Power Consumer List)." },
>  
>  	/* Section 10.3 AC Adapters and Power Source Objects */
>  
> -	/* { method_test_PCL, "Test _PCL (Power Consumer List)." }, */
> +	{ method_test_PCL, "Test _PCL (Power Consumer List)." },
>  	{ method_test_PIF, "Test _PIF (Power Source Information)." },
>  	/* { method_test_PRL, "Test _PRL (Power Source Redundancy List)." }, */
>  	{ method_test_PSR, "Test _PSR (Power Source)." },
>
diff mbox

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 1de08ec..686ecd8 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -138,7 +138,7 @@ 
  * _OSI  5.7.2		n/a
  * _OST  6.3.5		n/a
  * _PAI  10.4.4		n/a
- * _PCL  10.3.2		N
+ * _PCL  10.3.2		Y
  * _PCT  8.4.4.1	Y
  * _PDC  8.4.1		N
  * _PDL  8.4.4.6	Y
@@ -3845,7 +3845,13 @@  static void method_test_PCL_return(fwts_framework *fw,
 	FWTS_UNUSED(obj);
 	FWTS_UNUSED(private);
 
-	/* FIXME */
+	if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
+		return;
+
+	if (method_package_elements_all_type(fw, name, "_PCL", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK)
+		return;
+
+	fwts_passed(fw,	"%s returned a sane package of %" PRIu32 " referneces.", name, obj->Package.Count);
 }
 
 static int method_test_PCL(fwts_framework *fw)
@@ -5043,11 +5049,10 @@  static fwts_framework_minor_test method_tests[] = {
 	{ method_test_BTP, "Test _BTP (Battery Trip Point)." },
 	{ method_test_BTM, "Test _BTM (Battery Time)." },
 	/* { method_test_BLT, "Test _BLT (Battery Level Threshold)." }, */
-	{ method_test_PCL, "Test _PCL (Power Consumer List)." },
 
 	/* Section 10.3 AC Adapters and Power Source Objects */
 
-	/* { method_test_PCL, "Test _PCL (Power Consumer List)." }, */
+	{ method_test_PCL, "Test _PCL (Power Consumer List)." },
 	{ method_test_PIF, "Test _PIF (Power Source Information)." },
 	/* { method_test_PRL, "Test _PRL (Power Source Redundancy List)." }, */
 	{ method_test_PSR, "Test _PSR (Power Source)." },