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 */
58 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex001, TestSize.Level0)
59 {
60 ItTestPthreadMutex001();
61 }
62
63 /* *
64 * @tc.name: it_test_pthread_mutex_002
65 * @tc.desc: function for ProcessMutexTest
66 * @tc.type: FUNC
67 */
68 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex002, TestSize.Level0)
69 {
70 ItTestPthreadMutex002();
71 }
72
73 /* *
74 * @tc.name: it_test_pthread_mutex_003
75 * @tc.desc: function for ProcessMutexTest
76 * @tc.type: FUNC
77 */
78 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex003, TestSize.Level0)
79 {
80 ItTestPthreadMutex003();
81 }
82
83 /* *
84 * @tc.name: it_test_pthread_mutex_004
85 * @tc.desc: function for ProcessMutexTest
86 * @tc.type: FUNC
87 */
88 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex004, TestSize.Level0)
89 {
90 ItTestPthreadMutex004();
91 }
92
93 /* *
94 * @tc.name: it_test_pthread_mutex_005
95 * @tc.desc: function for ProcessMutexTest
96 * @tc.type: FUNC
97 */
98 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex005, TestSize.Level0)
99 {
100 ItTestPthreadMutex005();
101 }
102
103 /* *
104 * @tc.name: it_test_pthread_mutex_006
105 * @tc.desc: function for ProcessMutexTest
106 * @tc.type: FUNC
107 */
108 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex006, TestSize.Level0)
109 {
110 ItTestPthreadMutex006();
111 }
112
113 /* *
114 * @tc.name: it_test_pthread_mutex_007
115 * @tc.desc: function for ProcessMutexTest
116 * @tc.type: FUNC
117 */
118 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex007, TestSize.Level0)
119 {
120 ItTestPthreadMutex007();
121 }
122
123 /* *
124 * @tc.name: it_test_pthread_mutex_008
125 * @tc.desc: function for ProcessMutexTest
126 * @tc.type: FUNC
127 */
128 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex008, TestSize.Level0)
129 {
130 ItTestPthreadMutex008();
131 }
132
133 /* *
134 * @tc.name: it_test_pthread_mutex_009
135 * @tc.desc: function for ProcessMutexTest
136 * @tc.type: FUNC
137 */
138 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex009, TestSize.Level0)
139 {
140 ItTestPthreadMutex009();
141 }
142
143 /* *
144 * @tc.name: it_test_pthread_mutex_010
145 * @tc.desc: function for ProcessMutexTest
146 * @tc.type: FUNC
147 */
148 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex010, TestSize.Level0)
149 {
150 ItTestPthreadMutex010();
151 }
152
153 /* *
154 * @tc.name: it_test_pthread_mutex_011
155 * @tc.desc: function for ProcessMutexTest
156 * @tc.type: FUNC
157 */
158 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex011, TestSize.Level0)
159 {
160 ItTestPthreadMutex011();
161 }
162
163 /* *
164 * @tc.name: it_test_pthread_mutex_012
165 * @tc.desc: function for ProcessMutexTest
166 * @tc.type: FUNC
167 */
168 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex012, TestSize.Level0)
169 {
170 ItTestPthreadMutex012();
171 }
172
173 /* *
174 * @tc.name: it_test_pthread_mutex_013
175 * @tc.desc: function for ProcessMutexTest
176 * @tc.type: FUNC
177 */
178 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex013, TestSize.Level0)
179 {
180 ItTestPthreadMutex013();
181 }
182
183 /* *
184 * @tc.name: it_test_pthread_mutex_014
185 * @tc.desc: function for ProcessMutexTest
186 * @tc.type: FUNC
187 */
188 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex014, TestSize.Level0)
189 {
190 ItTestPthreadMutex014();
191 }
192
193 /* *
194 * @tc.name: it_test_pthread_mutex_015
195 * @tc.desc: function for ProcessMutexTest
196 * @tc.type: FUNC
197 */
198 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex015, TestSize.Level0)
199 {
200 ItTestPthreadMutex015();
201 }
202
203 /* *
204 * @tc.name: it_test_pthread_mutex_016
205 * @tc.desc: function for ProcessMutexTest
206 * @tc.type: FUNC
207 */
208 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex016, TestSize.Level0)
209 {
210 ItTestPthreadMutex016();
211 }
212
213 /* *
214 * @tc.name: it_test_pthread_mutex_017
215 * @tc.desc: function for ProcessMutexTest
216 * @tc.type: FUNC
217 */
218 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex017, TestSize.Level0)
219 {
220 ItTestPthreadMutex017();
221 }
222
223 #ifndef LOSCFG_USER_TEST_SMP
224 /* *
225 * @tc.name: it_test_pthread_mutex_019
226 * @tc.desc: function for ProcessMutexTest
227 * @tc.type: FUNC
228 */
229 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex019, TestSize.Level0)
230 {
231 ItTestPthreadMutex019();
232 }
233
234 #endif
235 /* *
236 * @tc.name: it_test_pthread_mutex_020
237 * @tc.desc: function for ProcessMutexTest
238 * @tc.type: FUNC
239 */
240 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex020, TestSize.Level0)
241 {
242 ItTestPthreadMutex020();
243 }
244
245 /* *
246 * @tc.name: it_test_pthread_mutex_021
247 * @tc.desc: function for ProcessMutexTest
248 * @tc.type: FUNC
249 */
250 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex021, TestSize.Level0)
251 {
252 ItTestPthreadMutex021();
253 }
254
255 /* *
256 * @tc.name: it_test_pthread_mutex_022
257 * @tc.desc: function for ProcessMutexTest
258 * @tc.type: FUNC
259 */
260 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex022, TestSize.Level0)
261 {
262 ItTestPthreadMutex022();
263 }
264 #endif
265
266 #if defined(LOSCFG_USER_TEST_FULL)
267 #ifndef LOSCFG_USER_TEST_SMP
268 /* *
269 * @tc.name: it_test_pthread_mutex_018
270 * @tc.desc: function for ProcessMutexTest
271 * @tc.type: FUNC
272 */
273 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex018, TestSize.Level0)
274 {
275 ItTestPthreadMutex018();
276 }
277 #endif
278
279 /* *
280 * @tc.name: it_test_pthread_mutex_023
281 * @tc.desc: function for test mutexattr robust
282 * @tc.type: FUNC
283 */
284 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex023, TestSize.Level0)
285 {
286 ItTestPthreadMutex023();
287 }
288
289 /* *
290 * @tc.name: it_test_pthread_mutex_024
291 * @tc.desc: function for test mutexattr robust:error return value
292 * @tc.type: FUNC
293 */
294 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex024, TestSize.Level0)
295 {
296 ItTestPthreadMutex024();
297 }
298
299 /* *
300 * @tc.name: it_test_pthread_mutex_025
301 * @tc.desc: test mutexattr robust:robustness product deadlock is not set
302 * @tc.type: FUNC
303 */
304 HWTEST_F(ProcessMutexTest, ItTestPthreadMutex025, TestSize.Level0)
305 {
306 ItTestPthreadMutex025();
307 }
308 #endif
309 } // namespace OHOS
310