process_pthread_test.cpp 9.5 KB
Newer Older
L
lnlan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
/*
 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
 * of conditions and the following disclaimer in the documentation and/or other materials
 * provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
 * to endorse or promote products derived from this software without specific prior written
 * permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#include "stdio.h"
#include <climits>
#include <gtest/gtest.h>
#include "it_pthread_test.h"
#include <sys/resource.h>

using namespace testing::ext;
namespace OHOS {
class ProcessPthreadTest : public testing::Test {
public:
    static void SetUpTestCase(void)
    {
        struct sched_param param = { 0 };
        int currThreadPolicy, ret;
        ret = pthread_getschedparam(pthread_self(), &currThreadPolicy, &param);
        ICUNIT_ASSERT_EQUAL_VOID(ret, 0, -ret);
        param.sched_priority = TASK_PRIO_TEST;
        ret = pthread_setschedparam(pthread_self(), SCHED_RR, &param);
        ICUNIT_ASSERT_EQUAL_VOID(ret, 0, -ret);
    }
    static void TearDownTestCase(void) {}
};

L
lnlan 已提交
54
#if defined(LOSCFG_USER_TEST_SMOKE)
L
lnlan 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
/* *
 * @tc.name: it_test_pthread_003
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread003, TestSize.Level0)
{
    ItTestPthread003();
}

#ifndef LOSCFG_USER_TEST_SMP
/* *
 * @tc.name: it_test_pthread_006
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread006, TestSize.Level0)
{
    ItTestPthread006();
}
#endif

/* *
 * @tc.name: it_test_pthread_007
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread007, TestSize.Level0)
{
    ItTestPthread007();
}

/* *
 * @tc.name: it_test_pthread_008
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread008, TestSize.Level0)
{
    ItTestPthread008();
}

/* *
 * @tc.name: it_test_pthread_009
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread009, TestSize.Level0)
{
    ItTestPthread009();
}

#ifndef LOSCFG_USER_TEST_SMP
/* *
 * @tc.name: it_test_pthread_010
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread010, TestSize.Level0)
{
    ItTestPthread010();
}
#endif
L
lnlan 已提交
118

L
lnlan 已提交
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
/* *
 * @tc.name: it_test_pthread_011
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread011, TestSize.Level0)
{
    ItTestPthread011();
}

/* *
 * @tc.name: it_test_pthread_012
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread012, TestSize.Level0)
{
    ItTestPthread012();
}

/* *
 * @tc.name: it_test_pthread_013
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread013, TestSize.Level0)
{
    ItTestPthread013();
}

/* *
 * @tc.name: it_test_pthread_015
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread015, TestSize.Level0)
{
    ItTestPthread015();
}

/* *
 * @tc.name: it_test_pthread_016
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread016, TestSize.Level0)
{
    ItTestPthread016();
}

/* *
Z
zhushengle 已提交
170
 * @tc.name: it_test_pthread_018
L
lnlan 已提交
171 172 173
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
Z
zhushengle 已提交
174
HWTEST_F(ProcessPthreadTest, ItTestPthread018, TestSize.Level0)
L
lnlan 已提交
175
{
Z
zhushengle 已提交
176
    ItTestPthread018();
L
lnlan 已提交
177 178 179
}

/* *
Z
zhushengle 已提交
180
 * @tc.name: it_test_pthread_019
L
lnlan 已提交
181 182 183
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
Z
zhushengle 已提交
184
HWTEST_F(ProcessPthreadTest, ItTestPthread019, TestSize.Level0)
L
lnlan 已提交
185
{
Z
zhushengle 已提交
186
    ItTestPthread019();
L
lnlan 已提交
187 188
}

Z
zhangdengyu 已提交
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
/* *
 * @tc.name: it_test_pthread_020
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread020, TestSize.Level0)
{
    ItTestPthread020();
}

/* *
 * @tc.name: it_test_pthread_021
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread021, TestSize.Level0)
{
    ItTestPthread021();
}

/* *
 * @tc.name: it_test_pthread_022
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread022, TestSize.Level0)
{
    ItTestPthread022();
}

/* *
 * @tc.name: it_test_pthread_024
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread024, TestSize.Level0)
{
    ItTestPthread024();
}

/* *
 * @tc.name: it_test_pthread_026
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread026, TestSize.Level0)
{
    ItTestPthread026();
}

/* *
 * @tc.name: it_test_pthread_027
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread027, TestSize.Level0)
{
    ItTestPthread027();
}


/* *
 * @tc.name: it_test_pthread_023
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread023, TestSize.Level0)
{
    ItTestPthread023();
}


/* *
 * @tc.name: it_test_pthread_025
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 * @tc.require: issueI6T3P3
 * @tc.author:
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread025, TestSize.Level0)
{
    ItTestPthread025();
}

L
lnlan 已提交
287
/* *
Z
zhushengle 已提交
288
 * @tc.name: it_test_pthread_017
L
lnlan 已提交
289 290 291
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
Z
zhushengle 已提交
292
HWTEST_F(ProcessPthreadTest, ItTestPthread017, TestSize.Level0)
L
lnlan 已提交
293
{
Z
zhushengle 已提交
294
    ItTestPthread017();
L
lnlan 已提交
295 296
}

Z
zhushengle 已提交
297

L
lnlan 已提交
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
/* *
 * @tc.name: it_test_pthread_once_001
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadOnce001, TestSize.Level0)
{
    ItTestPthreadOnce001();
}

/* *
 * @tc.name: it_test_pthread_atfork_001
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadAtfork001, TestSize.Level0)
{
    ItTestPthreadAtfork001();
}

/* *
 * @tc.name: it_test_pthread_atfork_002
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadAtfork002, TestSize.Level0)
{
    ItTestPthreadAtfork002();
}

/* *
 * @tc.name: it_test_pthread_cond_001
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadCond001, TestSize.Level0)
{
    ItTestPthreadCond001();
}

/* *
 * @tc.name: it_test_pthread_cond_002
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadCond002, TestSize.Level0)
{
    ItTestPthreadCond002();
}
Z
zhushengle 已提交
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370

/* *
 * @tc.name: it_test_pthread_cond_003
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadCond003, TestSize.Level0)
{
    ItTestPthreadCond003();
}

/* *
 * @tc.name: it_test_pthread_cond_004
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthreadCond004, TestSize.Level0)
{
    ItTestPthreadCond004();
}

#endif

#if defined(LOSCFG_USER_TEST_FULL)
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
/* *
 * @tc.name: it_test_pthread_001
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread001, TestSize.Level0)
{
    ItTestPthread001();
}

#ifndef LOSCFG_USER_TEST_SMP
/* *
 * @tc.name: it_test_pthread_002
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread002, TestSize.Level0)
{
    ItTestPthread002();
}
#endif
Z
zhushengle 已提交
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410
/* *
 * @tc.name: it_test_pthread_004
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread004, TestSize.Level0)
{
    ItTestPthread004();
}

/* *
 * @tc.name: it_test_pthread_005
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread005, TestSize.Level0)
{
    ItTestPthread005();
}
411 412 413 414 415 416 417 418 419 420 421 422 423

#ifndef LOSCFG_USER_TEST_SMP
/* *
 * @tc.name: it_test_pthread_014
 * @tc.desc: function for ProcessPthreadTest
 * @tc.type: FUNC
 */
HWTEST_F(ProcessPthreadTest, ItTestPthread014, TestSize.Level0)
{
    ItTestPthread014();
}
#endif

L
lnlan 已提交
424
#endif
L
lnlan 已提交
425
} // namespace OHOS