1 /*
2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 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 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 * of conditions and the following disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
16 * to endorse or promote products derived from this software without specific prior written
17 * permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 #include "stdio.h"
32 #include <climits>
33 #include <gtest/gtest.h>
34 #include <sys/syscall.h>
35 #include <unistd.h>
36
Gettid()37 __attribute__((weak)) int Gettid()
38 {
39 return syscall(SYS_gettid);
40 }
41
42 #include "it_mutex_test.h"
43
44 using namespace testing::ext;
45 namespace OHOS {
46 class ProcessMutexTest : public testing::Test {
47 public:
SetUpTestCase(void)48 static void SetUpTestCase(void) {}
TearDownTestCase(void)49 static void TearDownTestCase(void) {}
50 };
51
52 #if defined(LOSCFG_USER_TEST_SMOKE)
53 /* *
54 * @tc.name: it_test_pthread_mutex_001
55 * @tc.desc: function for ProcessMutexTest
56 * @tc.type: FUNC
57 * @tc.require: AR000EEMQ9
58 */
59 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex001, TestSize.Level0)
60 {
61 ItTestPthreadMutex001();
62 }
63
64 /* *
65 * @tc.name: it_test_pthread_mutex_002
66 * @tc.desc: function for ProcessMutexTest
67 * @tc.type: FUNC
68 * @tc.require: AR000EEMQ9
69 */
70 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex002, TestSize.Level0)
71 {
72 ItTestPthreadMutex002();
73 }
74
75 /* *
76 * @tc.name: it_test_pthread_mutex_003
77 * @tc.desc: function for ProcessMutexTest
78 * @tc.type: FUNC
79 * @tc.require: AR000EEMQ9
80 */
81 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex003, TestSize.Level0)
82 {
83 ItTestPthreadMutex003();
84 }
85
86 /* *
87 * @tc.name: it_test_pthread_mutex_004
88 * @tc.desc: function for ProcessMutexTest
89 * @tc.type: FUNC
90 * @tc.require: AR000EEMQ9
91 */
92 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex004, TestSize.Level0)
93 {
94 ItTestPthreadMutex004();
95 }
96
97 /* *
98 * @tc.name: it_test_pthread_mutex_005
99 * @tc.desc: function for ProcessMutexTest
100 * @tc.type: FUNC
101 * @tc.require: AR000EEMQ9
102 */
103 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex005, TestSize.Level0)
104 {
105 ItTestPthreadMutex005();
106 }
107
108 /* *
109 * @tc.name: it_test_pthread_mutex_006
110 * @tc.desc: function for ProcessMutexTest
111 * @tc.type: FUNC
112 * @tc.require: AR000EEMQ9
113 */
114 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex006, TestSize.Level0)
115 {
116 ItTestPthreadMutex006();
117 }
118
119 /* *
120 * @tc.name: it_test_pthread_mutex_007
121 * @tc.desc: function for ProcessMutexTest
122 * @tc.type: FUNC
123 * @tc.require: AR000EEMQ9
124 */
125 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex007, TestSize.Level0)
126 {
127 ItTestPthreadMutex007();
128 }
129
130 /* *
131 * @tc.name: it_test_pthread_mutex_008
132 * @tc.desc: function for ProcessMutexTest
133 * @tc.type: FUNC
134 * @tc.require: AR000EEMQ9
135 */
136 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex008, TestSize.Level0)
137 {
138 ItTestPthreadMutex008();
139 }
140
141 /* *
142 * @tc.name: it_test_pthread_mutex_009
143 * @tc.desc: function for ProcessMutexTest
144 * @tc.type: FUNC
145 * @tc.require: AR000EEMQ9
146 */
147 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex009, TestSize.Level0)
148 {
149 ItTestPthreadMutex009();
150 }
151
152 /* *
153 * @tc.name: it_test_pthread_mutex_010
154 * @tc.desc: function for ProcessMutexTest
155 * @tc.type: FUNC
156 * @tc.require: AR000EEMQ9
157 */
158 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex010, TestSize.Level0)
159 {
160 ItTestPthreadMutex010();
161 }
162
163 /* *
164 * @tc.name: it_test_pthread_mutex_011
165 * @tc.desc: function for ProcessMutexTest
166 * @tc.type: FUNC
167 * @tc.require: AR000EEMQ9
168 */
169 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex011, TestSize.Level0)
170 {
171 ItTestPthreadMutex011();
172 }
173
174 /* *
175 * @tc.name: it_test_pthread_mutex_012
176 * @tc.desc: function for ProcessMutexTest
177 * @tc.type: FUNC
178 * @tc.require: AR000EEMQ9
179 */
180 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex012, TestSize.Level0)
181 {
182 ItTestPthreadMutex012();
183 }
184
185 /* *
186 * @tc.name: it_test_pthread_mutex_013
187 * @tc.desc: function for ProcessMutexTest
188 * @tc.type: FUNC
189 * @tc.require: AR000EEMQ9
190 */
191 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex013, TestSize.Level0)
192 {
193 ItTestPthreadMutex013();
194 }
195
196 /* *
197 * @tc.name: it_test_pthread_mutex_014
198 * @tc.desc: function for ProcessMutexTest
199 * @tc.type: FUNC
200 * @tc.require: AR000EEMQ9
201 */
202 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex014, TestSize.Level0)
203 {
204 ItTestPthreadMutex014();
205 }
206
207 /* *
208 * @tc.name: it_test_pthread_mutex_015
209 * @tc.desc: function for ProcessMutexTest
210 * @tc.type: FUNC
211 * @tc.require: AR000EEMQ9
212 */
213 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex015, TestSize.Level0)
214 {
215 ItTestPthreadMutex015();
216 }
217
218 /* *
219 * @tc.name: it_test_pthread_mutex_016
220 * @tc.desc: function for ProcessMutexTest
221 * @tc.type: FUNC
222 * @tc.require: AR000EEMQ9
223 */
224 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex016, TestSize.Level0)
225 {
226 ItTestPthreadMutex016();
227 }
228
229 /* *
230 * @tc.name: it_test_pthread_mutex_017
231 * @tc.desc: function for ProcessMutexTest
232 * @tc.type: FUNC
233 * @tc.require: AR000EEMQ9
234 */
235 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex017, TestSize.Level0)
236 {
237 ItTestPthreadMutex017();
238 }
239
240 #ifndef LOSCFG_USER_TEST_SMP
241 /* *
242 * @tc.name: it_test_pthread_mutex_019
243 * @tc.desc: function for ProcessMutexTest
244 * @tc.type: FUNC
245 * @tc.require: AR000EEMQ9
246 */
247 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex019, TestSize.Level0)
248 {
249 ItTestPthreadMutex019();
250 }
251
252 #endif
253 /* *
254 * @tc.name: it_test_pthread_mutex_020
255 * @tc.desc: function for ProcessMutexTest
256 * @tc.type: FUNC
257 * @tc.require: AR000EEMQ9
258 */
259 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex020, TestSize.Level0)
260 {
261 ItTestPthreadMutex020();
262 }
263
264 /* *
265 * @tc.name: it_test_pthread_mutex_021
266 * @tc.desc: function for ProcessMutexTest
267 * @tc.type: FUNC
268 * @tc.require: AR000EEMQ9
269 */
270 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex021, TestSize.Level0)
271 {
272 ItTestPthreadMutex021();
273 }
274
275 /* *
276 * @tc.name: it_test_pthread_mutex_022
277 * @tc.desc: function for ProcessMutexTest
278 * @tc.type: FUNC
279 * @tc.require: AR000EEMQ9
280 */
281 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex022, TestSize.Level0)
282 {
283 ItTestPthreadMutex022();
284 }
285 #endif
286
287 #if defined(LOSCFG_USER_TEST_FULL)
288 #ifndef LOSCFG_USER_TEST_SMP
289 /* *
290 * @tc.name: it_test_pthread_mutex_018
291 * @tc.desc: function for ProcessMutexTest
292 * @tc.type: FUNC
293 * @tc.require: AR000EEMQ9
294 */
295 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex018, TestSize.Level0)
296 {
297 ItTestPthreadMutex018();
298 }
299 #endif
300
301 /* *
302 * @tc.name: it_test_pthread_mutex_023
303 * @tc.desc: function for test mutexattr robust
304 * @tc.type: FUNC
305 * @tc.require: AR000E0QAB
306 */
307 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex023, TestSize.Level0)
308 {
309 ItTestPthreadMutex023();
310 }
311
312 /* *
313 * @tc.name: it_test_pthread_mutex_024
314 * @tc.desc: function for test mutexattr robust:error return value
315 * @tc.type: FUNC
316 * @tc.require: AR000E0QAB
317 */
318 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex024, TestSize.Level0)
319 {
320 ItTestPthreadMutex024();
321 }
322
323 /* *
324 * @tc.name: it_test_pthread_mutex_025
325 * @tc.desc: test mutexattr robust:robustness product deadlock is not set
326 * @tc.type: FUNC
327 * @tc.require: AR000E0QAB
328 */
329 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex025, TestSize.Level0)
330 {
331 ItTestPthreadMutex025();
332 }
333 #endif
334 } // namespace OHOS
335