From patchwork Thu Sep 11 08:22:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 388117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 7912D14010B; Thu, 11 Sep 2014 18:23:02 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XRzee-0002zv-Ii; Thu, 11 Sep 2014 08:23:00 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XRzeZ-0002ze-2D for fwts-devel@lists.ubuntu.com; Thu, 11 Sep 2014 08:22:55 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XRzeY-0005zG-Fs; Thu, 11 Sep 2014 08:22:55 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: method: add check for _TZD and _TZM Date: Thu, 11 Sep 2014 16:22:49 +0800 Message-Id: <1410423769-28262-1-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/acpi/method/method.c | 55 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index 4458b0f..7e23e5c 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -233,8 +233,8 @@ * _TST 11.4.18 Y * _TTS 7.3.6 Y * _TZ_ 5.3.1 n/a - * _TZD 11.4.19 N - * _TZM 11.4.20 N + * _TZD 11.4.19 Y + * _TZM 11.4.20 Y * _TZP 11.4.21 Y * _UID 6.1.9 Y * _UPC 9.13 N @@ -666,6 +666,24 @@ static void method_test_string_return( } /* + * method_test_reference_return + * check if a reference object was returned + */ +static void method_test_reference_return( + fwts_framework *fw, + char *name, + ACPI_BUFFER *buf, + ACPI_OBJECT *obj, + void *private) +{ + FWTS_UNUSED(obj); + FWTS_UNUSED(private); + + if (method_check_type(fw, name, buf, ACPI_TYPE_LOCAL_REFERENCE) == FWTS_OK) + fwts_passed(fw, "%s correctly returned a reference.", name); +} + +/* * method_test_NULL_return * check if no object was retuned */ @@ -4591,6 +4609,36 @@ static int method_test_TPT(fwts_framework *fw) "_TPT", arg, 1, method_test_NULL_return, NULL); } +static void method_test_TZD_return( + fwts_framework *fw, + char *name, + ACPI_BUFFER *buf, + ACPI_OBJECT *obj, + void *private) +{ + FWTS_UNUSED(private); + + if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK) + return; + + if (method_package_elements_all_type(fw, name, "_TZD", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK) + return; + + fwts_passed(fw, "%s returned a sane package of %" PRIu32 " references.", name, obj->Package.Count); +} + +static int method_test_TZD(fwts_framework *fw) +{ + return method_evaluate_method(fw, METHOD_OPTIONAL, + "_TZD", NULL, 0, method_test_TZD_return, "_TZD"); +} + +static int method_test_TZM(fwts_framework *fw) +{ + return method_evaluate_method(fw, METHOD_OPTIONAL, + "_TZM", NULL, 0, method_test_reference_return, "_TZM"); +} + static int method_test_TZP(fwts_framework *fw) { return method_evaluate_method(fw, METHOD_OPTIONAL, @@ -5397,7 +5445,8 @@ static fwts_framework_minor_test method_tests[] = { /* { method_test_TRT, "Test _TRT (Thermal Relationship Table)." }, */ { method_test_TSP, "Test _TSP (Thermal Sampling Period)." }, { method_test_TST, "Test _TST (Temperature Sensor Threshold)." }, - /* { method_test_TZD, "Test _TZD (Thermal Zone Devices)." }, */ + { method_test_TZD, "Test _TZD (Thermal Zone Devices)." }, + { method_test_TZM, "Test _TZM (Thermal Zone member)." }, { method_test_TZP, "Test _TZP (Thermal Zone Polling)." }, /* Section 16 Waking and Sleeping */