diff --git a/kernel/include/los_queue.h b/kernel/include/los_queue.h
index ed35c0b8..1239bbe6 100644
--- a/kernel/include/los_queue.h
+++ b/kernel/include/los_queue.h
@@ -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
*
* - There are LOSCFG_BASE_IPC_QUEUE_LIMIT queues available, change it's value when necessary.
diff --git a/testsuites/sample/kernel/queue/BUILD.gn b/testsuites/sample/kernel/queue/BUILD.gn
index 4c10fd13..462496fb 100644
--- a/testsuites/sample/kernel/queue/BUILD.gn
+++ b/testsuites/sample/kernel/queue/BUILD.gn
@@ -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",
]
diff --git a/testsuites/sample/kernel/queue/It_los_queue.c b/testsuites/sample/kernel/queue/It_los_queue.c
index 6830e418..1a2a781b 100644
--- a/testsuites/sample/kernel/queue/It_los_queue.c
+++ b/testsuites/sample/kernel/queue/It_los_queue.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
}
diff --git a/testsuites/sample/kernel/queue/It_los_queue.h b/testsuites/sample/kernel/queue/It_los_queue.h
index 9df2de2e..8b207b1a 100644
--- a/testsuites/sample/kernel/queue/It_los_queue.h
+++ b/testsuites/sample/kernel/queue/It_los_queue.h
@@ -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
diff --git a/testsuites/sample/kernel/queue/It_los_queue_static_001.c b/testsuites/sample/kernel/queue/It_los_queue_static_001.c
new file mode 100644
index 00000000..9dd6bc9c
--- /dev/null
+++ b/testsuites/sample/kernel/queue/It_los_queue_static_001.c
@@ -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
+
diff --git a/testsuites/sample/kernel/queue/It_los_queue_static_002.c b/testsuites/sample/kernel/queue/It_los_queue_static_002.c
new file mode 100644
index 00000000..6de9f60b
--- /dev/null
+++ b/testsuites/sample/kernel/queue/It_los_queue_static_002.c
@@ -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
\ No newline at end of file
diff --git a/testsuites/sample/kernel/queue/It_los_queue_static_003.c b/testsuites/sample/kernel/queue/It_los_queue_static_003.c
new file mode 100644
index 00000000..c82a45de
--- /dev/null
+++ b/testsuites/sample/kernel/queue/It_los_queue_static_003.c
@@ -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
diff --git a/testsuites/sample/kernel/queue/It_los_queue_static_004.c b/testsuites/sample/kernel/queue/It_los_queue_static_004.c
new file mode 100644
index 00000000..37f553c3
--- /dev/null
+++ b/testsuites/sample/kernel/queue/It_los_queue_static_004.c
@@ -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
\ No newline at end of file
diff --git a/testsuites/sample/kernel/queue/It_los_queue_static_005.c b/testsuites/sample/kernel/queue/It_los_queue_static_005.c
new file mode 100644
index 00000000..1b4e47dc
--- /dev/null
+++ b/testsuites/sample/kernel/queue/It_los_queue_static_005.c
@@ -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);
+}
+
diff --git a/testsuites/sample/kernel/queue/It_los_queue_static_006.c b/testsuites/sample/kernel/queue/It_los_queue_static_006.c
new file mode 100644
index 00000000..93ff3fac
--- /dev/null
+++ b/testsuites/sample/kernel/queue/It_los_queue_static_006.c
@@ -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
\ No newline at end of file