1    /*
2     * Some or all of this work - Copyright (c) 2006 - 2021, Intel Corp.
3     * All rights reserved.
4     *
5     * Redistribution and use in source and binary forms, with or without modification,
6     * are permitted provided that the following conditions are met:
7     *
8     * Redistributions of source code must retain the above copyright notice,
9     * this list of conditions and the following disclaimer.
10     * Redistributions in binary form must reproduce the above copyright notice,
11     * this list of conditions and the following disclaimer in the documentation
12     * and/or other materials provided with the distribution.
13     * Neither the name of Intel Corporation nor the names of its contributors
14     * may be used to endorse or promote products derived from this software
15     * without specific prior written permission.
16     *
17     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20     * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21     * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25     * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27     */
28    /*
29     * Check operators under the known critical conditions
30     *
31     * Collection of the tests which exersice the operators under the
32     * known conditions. If some operator was observed failing under some
33     * conditions, do the similar checkings for other operators under the
34     * similar conditions too.
35     */
36    Name (Z055, 0x37)
37    /* Meaningless zero valued parameter */
38
39    Method (M130, 1, Serialized)
40    {
41        Name (B000, Buffer (0x02)
42        {
43             0x21, 0x21                                       // !!
44        })
45        Local0 = 0x00
46        Local2 = ToString (B000, Local0)
47        If ((Local0 != 0x00))
48        {
49            ERR (Arg0, Z055, __LINE__, 0x00, 0x00, Local0, 0x00)
50        }
51
52        CH03 (Arg0, Z055, __LINE__, 0x00, 0x00)
53    }
54
55    /* Store-like actions affect the source objects passed as parameter */
56
57    Method (M131, 1, NotSerialized)
58    {
59        Arg0--
60        /* Store(9, arg0) */
61    }
62
63    /* Operator updates the source object passed to method directly, */
64    /* NOT as a reference to it. */
65    Method (M132, 1, NotSerialized)
66    {
67        Local0 = 0x0A
68        M131 (Local0)
69        If ((Local0 != 0x0A))
70        {
71            ERR (Arg0, Z055, __LINE__, 0x00, 0x00, Local0, 0x0A)
72        }
73
74        CH03 (Arg0, Z055, __LINE__, 0x00, 0x00)
75    }
76
77    /* Operator doesn't update the source object passed to method as a REFERENCE */
78    /* to the object. */
79    Method (M133, 1, NotSerialized)
80    {
81        Local0 = 0x0A
82        Local1 = RefOf (Local0)
83        M131 (Local1)
84        If ((Local0 != 0x09))
85        {
86            ERR (Arg0, Z055, __LINE__, 0x00, 0x00, Local0, 0x09)
87        }
88
89        CH03 (Arg0, Z055, __LINE__, 0x00, 0x00)
90    }
91
92    Method (M134, 1, NotSerialized)
93    {
94        Local0 = 0x0A
95        M131 (RefOf (Local0))
96        If ((Local0 != 0x09))
97        {
98            ERR (Arg0, Z055, __LINE__, 0x00, 0x00, Local0, 0x09)
99        }
100
101        CH03 (Arg0, Z055, __LINE__, 0x00, 0x00)
102    }
103
104    Method (M135, 1, NotSerialized)
105    {
106        Arg0 = 0x05
107    }
108
109    Method (M136, 1, NotSerialized)
110    {
111        Local0 = 0x0A
112        M135 (RefOf (Local0))
113        If ((Local0 != 0x05))
114        {
115            ERR (Arg0, Z055, __LINE__, 0x00, 0x00, Local0, 0x05)
116        }
117
118        CH03 (Arg0, Z055, __LINE__, 0x00, 0x00)
119    }
120
121    /* Run-method */
122
123    Method (PRV0, 0, Serialized)
124    {
125        SRMT ("m130")
126        M130 (__METHOD__)
127        SRMT ("m132")
128        M132 (__METHOD__)
129        SRMT ("m133")
130        M133 (__METHOD__)
131        SRMT ("m134")
132        M134 (__METHOD__)
133        SRMT ("m136")
134        M136 (__METHOD__)
135    }
136