iCunit.h 24.1 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 54 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 118 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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 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 287 288 289 290 291 292 293 294 295 296 297 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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
/*
 * 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.
 */

#ifndef _UNI_ICUNIT_H
#define _UNI_ICUNIT_H

#include <string.h>
#include <stdio.h>
#include "los_typedef.h"
#include "los_spinlock.h"

#ifdef TST_DRVPRINT
#include "VOS_typdef.h"
#include "uartdriver.h"
#endif

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cpluscplus */
#endif /* __cpluscplus */

typedef unsigned short iUINT16;
typedef unsigned int iUINT32;
typedef signed short iINT16;
typedef signed long iINT32;
typedef char iCHAR;
typedef void iVOID;

typedef unsigned long iiUINT32;


#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif

#define FUNCTION_TEST (1 << 0)

#define PRESSURE_TEST (1 << 1)

#define PERFORMANCE_TEST (1 << 2)

#define TEST_MODE (FUNCTION_TEST)

#define TEST_LESSER_MEM NO


typedef iUINT32 (*CASE_FUNCTION)(void);

typedef struct {
    const iCHAR *pcCaseID;
    CASE_FUNCTION pstCaseFunc;
    iUINT16 testcase_layer;
    iUINT16 testcase_module;
    iUINT16 testcase_level;
    iUINT16 testcase_type;
    iiUINT32 retCode;
    iUINT16 errLine;
} ICUNIT_CASE_S;

typedef struct {
    iUINT16 uwCaseCnt;
    iCHAR *pcSuitID;
    iCHAR *pucFilename;
    ICUNIT_CASE_S *pstCaseList;
    iUINT16 passCnt;
    iUINT16 failCnt;
} ICUNIT_SUIT_S;

typedef enum {
    TEST_TASK = 0,
    TEST_MEM,
    TEST_VM,
    TEST_SEM,
    TEST_MUX,
    TEST_RWLOCK,
    TEST_EVENT,
    TEST_QUE,
    TEST_SWTMR,
    TEST_HWI,
    TEST_MP,
    TEST_ATO,
    TEST_CPUP,
    TEST_SCATTER,
    TEST_RUNSTOP,
    TEST_TIMER,
    TEST_MMU,
    TEST_ROBIN,
    TEST_LIBC,
    TEST_WAIT,
    TEST_VFAT,
    TEST_JFFS,
    TEST_RAMFS,
    TEST_NFS,
    TEST_PROC,
    TEST_FS,
    TEST_UART,
    TEST_PTHREAD,
    TEST_COMP,
    TEST_HWI_HALFBOTTOM,
    TEST_WORKQ,
    TEST_WAKELOCK,
    TEST_TIMES,
    TEST_LIBM,
    TEST_SUPPORT,
    TEST_STL,
    TEST_MAIL,
    TEST_MSG,
    TEST_CP,
    TEST_SIGNAL,
    TEST_SCHED,
    TEST_MTDCHAR,
    TEST_TIME,
    TEST_WRITE,
    TEST_READ,
    TEST_DYNLOAD,
    TEST_REGISTER,
    TEST_UNAME,
    TEST_ERR,
    TEST_CMD,
    TEST_TICKLESS,
    TEST_TRACE,
    TEST_UNALIGNACCESS,
    TEST_EXC,
    TEST_REQULATOR,
    TEST_DEVFREQ,
    TEST_CPUFREQ,
    TEST_MISC,
#if defined(LOSCFG_3RDPARTY_TEST)
    TEST_THTTPD,
    TEST_BIDIREFC,
    TEST_CJSON,
    TEST_CURL,
    TEST_FFMPEG,
    TEST_FREETYPE,
    TEST_INIPARSER,
    TEST_JSONCPP,
    TEST_LIBICONV,
    TEST_LIBJPEG,
    TEST_LIBPNG,
    TEST_OPENEXIF,
    TEST_OPENSSL,
    TEST_OPUS,
    TEST_SQLITE,
    TEST_TINYXML,
    TEST_XML2,
    TEST_ZBAR,
    TEST_HARFBUZZ,
#endif
    TEST_DRIVERBASE,
    TEST_UDP,
    TEST_TCP,
    TEST_MODULE_ALL,
} LiteOS_test_module;

typedef enum {
    TEST_LOS = 0,
    TEST_POSIX,
    TEST_LIB,
    TEST_VFS,
    TEST_EXTEND,
    TEST_PARTITION,
    TEST_CPP,
    TEST_SHELL,
    TEST_LINUX,
    TEST_USB,
#if defined(LOSCFG_3RDPARTY_TEST)
    TEST_3RDPARTY,
#endif
    TEST_DRIVERFRAME,
    TEST_NET_LWIP,
    TEST_LAYER_ALL,
} LiteOS_test_layer;

typedef enum {
    TEST_LEVEL0 = 0,
    TEST_LEVEL1,
    TEST_LEVEL2,
    TEST_LEVEL3,
    TEST_LEVEL4,
    TEST_LEVEL_ALL,
} LiteOS_test_level;

typedef enum {
    TEST_FUNCTION = 0,
    TEST_PRESSURE,
    TEST_PERFORMANCE,
    TEST_TYPE_ALL,
} LiteOS_test_type;

typedef enum {
    TEST_SEQUENCE = 0,
    TEST_RANDOM
} LiteOS_test_sequence;

extern iUINT16 g_iCunitErrLineNo;
extern iiUINT32 g_iCunitErrCode;
extern void ICunitSaveErr(iiUINT32 line, iiUINT32 retCode);

#define ICUNIT_UNINIT 0x0EF00000
#define ICUNIT_OPENFILE_FAILED 0x0EF00001
#define ICUNIT_ALLOC_FAIL 0x0EF00002
#define ICUNIT_SUIT_FULL 0x0EF00002
#define ICUNIT_CASE_FULL 0x0EF00003
#define ICUNIT_SUIT_ALL 0x0EF0FFFF

#define ICUNIT_SUCCESS 0x00000000

#if 1

#define ICUNIT_TRACK_EQUAL(param, g_value, retcode)     \
    do {                                                \
        if ((param) != (g_value)) {                     \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode); \
        }                                               \
    } while (0)


#define ICUNIT_TRACK_NOT_EQUAL(param, g_value, retcode) \
    do {                                                \
        if ((param) == (g_value)) {                     \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode); \
        }                                               \
    } while (0)

#define ICUNIT_ASSERT_NOT_EQUAL_NULL(param, g_value, retcode) \
    do {                                                      \
        if ((param) == (g_value)) {                           \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);       \
            return NULL;                                      \
        }                                                     \
    } while (0)

#define ICUNIT_ASSERT_EQUAL_NULL(param, g_value, retcode) \
    do {                                                  \
        if ((param) != (g_value)) {                       \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);   \
            return NULL;                                  \
        }                                                 \
    } while (0)

#define ICUNIT_ASSERT_EQUAL_VOID(param, g_value, retcode) \
    do {                                                  \
        if ((param) != (g_value)) {                       \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);   \
            return;                                       \
        }                                                 \
    } while (0)

#define ICUNIT_ASSERT_NOT_EQUAL_VOID(param, g_value, retcode) \
    do {                                                      \
        if ((param) == (g_value)) {                           \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);       \
            return;                                           \
        }                                                     \
    } while (0)

#define ICUNIT_ASSERT_EQUAL(param, g_value, retcode)    \
    do {                                                \
        if ((param) != (g_value)) {                     \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode); \
            return 1;                                   \
        }                                               \
    } while (0)

#define ICUNIT_ASSERT_NOT_EQUAL(param, g_value, retcode) \
    do {                                                 \
        if ((param) == (g_value)) {                      \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);  \
            return 1;                                    \
        }                                                \
    } while (0)

#define ICUNIT_ASSERT_WITHIN_EQUAL(param, value1, value2, retcode) \
    do {                                                           \
        if ((param) < (value1) || (param) > (value2)) {            \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);            \
            return 1;                                              \
        }                                                          \
    } while (0)

#define ICUNIT_ASSERT_WITHIN_EQUAL_VOID(param, value1, value2, retcode) \
    do {                                                                \
        if ((param) < (value1) || (param) > (value2)) {                 \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);                 \
            return;                                                     \
        }                                                               \
    } while (0)

#define ICUNIT_ASSERT_WITHIN_EQUAL_NULL(param, value1, value2, retcode) \
    do {                                                                \
        if ((param) < (value1) || (param) > (value2)) {                 \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);                 \
            return;                                                     \
        }                                                               \
    } while (0)

#define ICUNIT_ASSERT_SIZE_STRING_EQUAL(str1, str2, strsize, retcode) \
    do {                                                              \
        if (strncmp((str1), (str2), (strsize)) != 0) {                \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);               \
            return 1;                                                 \
        }                                                             \
    } while (0)

#define ICUNIT_ASSERT_EQUAL_TIME(param, g_value, retcode, label)  \
    do {                                                          \
        if ((param) < (g_value - 1) || (param) > (g_value + 1)) { \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);           \
            goto label;                                           \
        }                                                         \
    } while (0)

#define ICUNIT_ASSERT_STRING_EQUAL(str1, str2, retcode) \
    do {                                                \
        if (strcmp(str1, str2) != 0) {                  \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode); \
            return 1;                                   \
        }                                               \
    } while (0)

#define ICUNIT_ASSERT_STRING_EQUAL_VOID(str1, str2, retcode) \
    do {                                                     \
        if (strcmp(str1, str2) != 0) {                       \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);      \
            return;                                          \
        }                                                    \
    } while (0)

#define ICUNIT_ASSERT_STRING_NOT_EQUAL(str1, str2, retcode) \
    do {                                                    \
        if (strcmp(str1, str2) == 0) {                      \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);     \
            return 1;                                       \
        }                                                   \
    } while (0)

#define ICUNIT_GOTO_EQUAL(param, g_value, retcode, label) \
    do {                                                  \
        if ((param) != (g_value)) {                       \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);   \
            goto label;                                   \
        }                                                 \
    } while (0)

#define ICUNIT_GOTO_EQUAL_IN(param, value1, value2, retcode, label) \
    do {                                                            \
        if (((param) != (value1)) && ((param) != (value2))) {       \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);             \
            goto label;                                             \
        }                                                           \
    } while (0)

#define ICUNIT_GOTO_NOT_EQUAL(param, g_value, retcode, label) \
    do {                                                      \
        if ((param) == (g_value)) {                           \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);       \
            goto label;                                       \
        }                                                     \
    } while (0)

#define ICUNIT_GOTO_WITHIN_EQUAL(param, value1, value2, retcode, label) \
    do {                                                                \
        if ((param) < (value1) || (param) > (value2)) {                 \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);                 \
            goto label;                                                 \
        }                                                               \
    } while (0)

#define ICUNIT_GOTO_STRING_EQUAL(str1, str2, retcode, label) \
    do {                                                     \
        if (strcmp(str1, str2) != 0) {                       \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);      \
            goto label;                                      \
        }                                                    \
    } while (0)

#define ICUNIT_GOTO_STRING_NOT_EQUAL(str1, str2, retcode, label) \
    do {                                                         \
        if (strcmp(str1, str2) == 0) {                           \
            ICunitSaveErr(__LINE__, (iiUINT32)retcode);          \
            goto label;                                          \
        }                                                        \
    } while (0)

#else

#define ICUNIT_TRACK_EQUAL(param, g_value, retcode)                                         \
    do {                                                                                    \
        if ((param) != (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
        }                                                                                   \
    } while (0)

#define ICUNIT_TRACK_NOT_EQUAL(param, g_value, retcode)                                     \
    do {                                                                                    \
        if ((param) == (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
        }                                                                                   \
    } while (0)

#define ICUNIT_ASSERT_EQUAL_VOID(param, g_value, retcode)                                   \
    do {                                                                                    \
        if ((param) != (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            return;                                                                         \
        }                                                                                   \
    } while (0)

#define ICUNIT_ASSERT_NOT_EQUAL_VOID(param, g_value, retcode)                               \
    do {                                                                                    \
        if ((param) == (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            return;                                                                         \
        }                                                                                   \
    } while (0)
#define ICUNIT_ASSERT_EQUAL(param, g_value, retcode)                                        \
    do {                                                                                    \
        if ((param) != (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            return 1;                                                                       \
        }                                                                                   \
    } while (0)

#define ICUNIT_ASSERT_NOT_EQUAL(param, g_value, retcode)                                    \
    do {                                                                                    \
        if ((param) == (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            return 1;                                                                       \
        }                                                                                   \
    } while (0)

#define ICUNIT_ASSERT_STRING_EQUAL(str1, str2, retcode)                                     \
    do {                                                                                    \
        if (strcmp(str1, str2) != 0) {                                                      \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            return 1;                                                                       \
        }                                                                                   \
    } while (0)

#define ICUNIT_ASSERT_STRING_NOT_EQUAL(str1, str2, retcode)                                 \
    do {                                                                                    \
        if (strcmp(str1, str2) == 0) {                                                      \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            return 1;                                                                       \
        }                                                                                   \
    } while (0)

#define ICUNIT_GOTO_EQUAL(param, g_value, retcode, label)                                   \
    do {                                                                                    \
        if ((param) != (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            goto label;                                                                     \
        }                                                                                   \
    } while (0)

#define ICUNIT_GOTO_NOT_EQUAL(param, g_value, retcode, label)                               \
    do {                                                                                    \
        if ((param) == (g_value)) {                                                         \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            goto label;                                                                     \
        }                                                                                   \
    } while (0)

#define ICUNIT_GOTO_STRING_EQUAL(str1, str2, retcode, label)                                \
    do {                                                                                    \
        if (strcmp(str1, str2) != 0) {                                                      \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            goto label;                                                                     \
        }                                                                                   \
    } while (0)

#define ICUNIT_GOTO_STRING_NOT_EQUAL(str1, str2, retcode, label)                            \
    do {                                                                                    \
        if (strcmp(str1, str2) == 0) {                                                      \
            g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? __LINE__ : g_iCunitErrLineNo;    \
            g_iCunitErrCode = (g_iCunitErrCode == 0) ? (iiUINT32)retcode : g_iCunitErrCode; \
            goto label;                                                                     \
        }                                                                                   \
    } while (0)
#endif

#if (LOSCFG_KERNEL_SMP == YES)
extern SPIN_LOCK_S g_testSuitSpin;
#define TESTSUIT_LOCK(state) LOS_SpinLockSave(&g_testSuitSpin, &(state))
#define TESTSUIT_UNLOCK(state) LOS_SpinUnlockRestore(&g_testSuitSpin, state)
#endif

extern iUINT32 iCunitAddSuit_F(iCHAR *suitName, iCHAR *pfileName);
#define iCunitAddSuit(suitName) iCunitAddSuit_F(suitName, __FILE__)
extern iUINT32 ICunitAddCase(const iCHAR *caseName, CASE_FUNCTION caseFunc, iUINT16 testcaseLayer,
    iUINT16 testcaseModule, iUINT16 testcaseLevel, iUINT16 testcaseType);

extern iUINT32 ICunitRunTestOne(const char *tcId);
extern INT32 ICunitRunTestArray(const char *tcSequence, const char *tcNum, const char *tcLayer, const char *tcModule,
    const char *tcLevel, const char *tcType);
extern iUINT32 ICunitRunTestArraySequence(iUINT32 testcaseNum, iUINT32 testcaseLayer, iUINT32 testcaseModule,
    iUINT32 testcaseLevel, iUINT32 testcaseType);
extern iUINT32 ICunitRunTestArrayRandom(iUINT32 testcaseNum, iUINT32 testcaseLayer, iUINT32 testcaseModule,
    iUINT32 testcaseLevel, iUINT32 testcaseType);
extern iUINT32 ICunitRunTestcaseSatisfied(ICUNIT_CASE_S *testCase, iUINT32 testcaseLayer, iUINT32 testcaseModule,
    iUINT32 testcaseLevel, iUINT32 testcaseType);

extern iUINT32 ICunitInit(void);
extern iUINT32 ICunitRunSingle(ICUNIT_CASE_S *psubCase);
extern iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase);

extern iUINT32 iCunitPrintReport(void);


#define TEST_ADD_CASE(name, casefunc, testcase_layer, testcase_module, testcase_level, testcase_type)         \
do     {                                                                                                         \
        iUINT32 uwRet = 1;                                                                                    \
        uwRet = ICunitAddCase(name, (CASE_FUNCTION)casefunc, testcase_layer, testcase_module, testcase_level, \
            testcase_type);                                                                                   \
        ICUNIT_ASSERT_EQUAL_VOID(uwRet, ICUNIT_SUCCESS, uwRet);                                               \
    } while (0)

#define TEST_RUN_SUITE()                                                   \
do     {                                                                      \
        UINT32 uiRet;                                                      \
        uiRet = iCunitRun();                                               \
        ICUNIT_ASSERT_NOT_EQUAL_VOID(uiRet, ICUNIT_UNINIT, ICUNIT_UNINIT); \
    } while (0)

#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cpluscplus */
#endif /* __cpluscplus */

#endif /* _UNI_ICUNIT_H */