新增静态队列用例
Signed-off-by: xuxinyu <xuxinyu6@huawei.com> Change-Id: Ib07ab22ee884475d5bc4de54fb43c89eed2c1305
This commit is contained in:
parent
f2b280bdbd
commit
192a2a6e61
|
@ -405,10 +405,10 @@ extern UINT32 LOS_QueueCreate(const CHAR *queueName,
|
|||
|
||||
/**
|
||||
* @ingroup los_queue
|
||||
* @brief Create a message queue.
|
||||
* @brief Create a static message queue.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to create a message queue.
|
||||
* This API is used to create a message queue using static memory for data storage.
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>There are LOSCFG_BASE_IPC_QUEUE_LIMIT queues available, change it's value when necessary.</li>
|
||||
|
|
|
@ -162,6 +162,12 @@ static_library("test_queue") {
|
|||
"It_los_queue_head_040.c",
|
||||
"It_los_queue_head_041.c",
|
||||
"It_los_queue_head_042.c",
|
||||
"It_los_queue_static_001.c",
|
||||
"It_los_queue_static_002.c",
|
||||
"It_los_queue_static_003.c",
|
||||
"It_los_queue_static_004.c",
|
||||
"It_los_queue_static_005.c",
|
||||
"It_los_queue_static_006.c",
|
||||
"LLt_los_queue_003.c",
|
||||
"Llt_los_queue_001.c",
|
||||
]
|
||||
|
|
|
@ -178,4 +178,12 @@ VOID ItSuiteLosQueue(VOID)
|
|||
ItLosQueue095();
|
||||
ItLosQueue110();
|
||||
#endif
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
ItLosQueueStatic001();
|
||||
ItLosQueueStatic002();
|
||||
ItLosQueueStatic003();
|
||||
ItLosQueueStatic004();
|
||||
ItLosQueueStatic005();
|
||||
ItLosQueueStatic006();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -184,6 +184,15 @@ extern VOID ItLosQueueHead040(VOID);
|
|||
extern VOID ItLosQueueHead041(VOID);
|
||||
extern VOID ItLosQueueHead042(VOID);
|
||||
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
extern VOID ItLosQueueStatic001(VOID);
|
||||
extern VOID ItLosQueueStatic002(VOID);
|
||||
extern VOID ItLosQueueStatic003(VOID);
|
||||
extern VOID ItLosQueueStatic004(VOID);
|
||||
extern VOID ItLosQueueStatic005(VOID);
|
||||
extern VOID ItLosQueueStatic006(VOID);
|
||||
#endif
|
||||
|
||||
#if (LOS_KERNEL_MULTI_HWI_TEST == 1)
|
||||
extern VOID ItLosQueue046(VOID);
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2022-2022 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 "It_los_queue.h"
|
||||
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
|
||||
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = "";
|
||||
CHAR buff3[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
|
||||
ret = LOS_QueueCreateStatic("Q1", QUEUE_BASE_NUM, &g_testQueueID01, buff3, 0, QUEUE_BASE_MSGSIZE);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueWrite(g_testQueueID01, &buff1, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueRead(g_testQueueID01, &buff2, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
EXIT:
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
VOID ItLosQueueStatic001(VOID)
|
||||
{
|
||||
TEST_ADD_CASE("ItLosQueueStatic001", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL1, TEST_FUNCTION);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2022-2022 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 "It_los_queue.h"
|
||||
#define QUEUW_INVALID_VALUE 1025
|
||||
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
|
||||
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = "";
|
||||
CHAR buff3[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
|
||||
g_testQueueID01 = QUEUW_INVALID_VALUE;
|
||||
|
||||
ret = LOS_QueueCreateStatic("Q1", QUEUE_BASE_NUM, &g_testQueueID01, buff3, 0, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_PARA_ISZERO, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueWrite(g_testQueueID01, &buff1, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_INVALID, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueRead(g_testQueueID01, &buff2, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_INVALID, ret, EXIT);
|
||||
|
||||
return LOS_OK;
|
||||
|
||||
EXIT:
|
||||
LOS_QueueDelete(g_testQueueID01);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
VOID ItLosQueueStatic002(VOID)
|
||||
{
|
||||
TEST_ADD_CASE("ItLosQueueStatic002", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL0, TEST_FUNCTION);
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2022-2022 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 "It_los_queue.h"
|
||||
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
|
||||
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = "";
|
||||
CHAR buff3[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
|
||||
ret = LOS_QueueCreateStatic("Q1", QUEUE_BASE_NUM, &g_testQueueID01, buff3, 0, 1);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueWrite(g_testQueueID01, &buff1, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueRead(g_testQueueID01, &buff2, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_ISEMPTY, ret, EXIT);
|
||||
|
||||
EXIT:
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
VOID ItLosQueueStatic003(VOID)
|
||||
{
|
||||
TEST_ADD_CASE("ItLosQueueStatic003", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL0, TEST_FUNCTION);
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2022-2022 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 "It_los_queue.h"
|
||||
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
|
||||
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
CHAR buff3[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
|
||||
ret = LOS_QueueCreateStatic("Q1", QUEUE_BASE_NUM, &g_testQueueID01, buff3, 0, QUEUE_BASE_MSGSIZE);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueWriteCopy(g_testQueueID01, &buff1, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueReadCopy(g_testQueueID01, &buff2, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
|
||||
|
||||
ret = strcmp((CHAR *)buff2, (CHAR *)buff3);
|
||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
return ret;
|
||||
|
||||
EXIT:
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
VOID ItLosQueueStatic004(VOID)
|
||||
{
|
||||
TEST_ADD_CASE("ItLosQueueStatic004", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL1, TEST_FUNCTION);
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2022-2022 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 "It_los_queue.h"
|
||||
|
||||
#define QUEUE_OVERSIZE_NUM 30
|
||||
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
|
||||
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = "";
|
||||
CHAR buff3[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
|
||||
g_testQueueID01 = LOSCFG_BASE_IPC_QUEUE_LIMIT - 1;
|
||||
|
||||
ret = LOS_QueueCreateStatic("Q1", QUEUE_OVERSIZE_NUM, &g_testQueueID01, buff3, 0, 0xFFFF);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_SIZE_TOO_BIG, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueWrite(g_testQueueID01, &buff1, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_NOT_CREATE, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueRead(g_testQueueID01, &buff2, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_NOT_CREATE, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_NOT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
return LOS_OK;
|
||||
|
||||
EXIT:
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
VOID ItLosQueueStatic005(VOID)
|
||||
{
|
||||
TEST_ADD_CASE("ItLosQueueStatic005", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL1, TEST_FUNCTION);
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2022-2022 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 "It_los_queue.h"
|
||||
|
||||
#define QUEUW_INVALID_VALUE 1025
|
||||
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
|
||||
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = "";
|
||||
CHAR buff3[QUEUE_SHORT_BUFFER_LENGTH] = {0};
|
||||
|
||||
g_testQueueID01 = QUEUW_INVALID_VALUE;
|
||||
|
||||
ret = LOS_QueueCreateStatic("Q1", QUEUE_BASE_NUM, NULL, buff3, 0, QUEUE_BASE_MSGSIZE);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_CREAT_PTR_NULL, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueWrite(g_testQueueID01, &buff1, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_INVALID, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueRead(g_testQueueID01, &buff2, QUEUE_BASE_MSGSIZE, 0);
|
||||
ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_INVALID, ret, EXIT);
|
||||
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_NOT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
return LOS_OK;
|
||||
|
||||
EXIT:
|
||||
ret = LOS_QueueDelete(g_testQueueID01);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
VOID ItLosQueueStatic006(VOID)
|
||||
{
|
||||
TEST_ADD_CASE("ItLosQueueStatic006", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL1, TEST_FUNCTION);
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue