Compare commits

...

8 Commits

Author SHA1 Message Date
openharmony_ci
c70295cc30 !1096 xts用例
Merge pull request !1096 from 乔克叔叔/wxliu
2023-08-31 09:10:48 +00:00
liuwenxin
c19dc1bc94 fix:xts用例
Signed-off-by: liuwenxin <liuwenxin11@huawei.com>
Change-Id: I2d3f856eb94e5ced0bc5a9c0211f10f453a4ad03
2023-08-31 16:49:50 +08:00
openharmony_ci
d2bf535696 !1091 支持可配置是否生成asm文件
Merge pull request !1091 from wangchen/0817_m
2023-08-18 01:52:50 +00:00
wangchen
bda25829af Fix: 支持可配置是否生成asm文件
Close #I7U2V4
Signed-off-by: wangchen <wangchen240@huawei.com>
2023-08-17 21:41:43 +08:00
openharmony_ci
a1e215f16a !1090 liteos_m内核xts用例补齐cmsis中task剩余
Merge pull request !1090 from zwx1232718/master
2023-08-17 02:14:08 +00:00
zwx1232718
5e36b8b599 test:xts用例,task补充
Signed-off-by: zwx1232718 <zhenghui23@huawei.com>
2023-08-17 09:06:40 +08:00
openharmony_ci
954aa6fb70 !1087 liteos_m内核xts用例补齐cmsis剩余task部分
Merge pull request !1087 from zwx1232718/master
2023-08-16 01:18:57 +00:00
zwx1232718
64a73724b3 test:xts用例补齐,cmsis中task部分
Signed-off-by: zwx1232718 <zhenghui23@huawei.com>
2023-08-15 10:40:53 +08:00
9 changed files with 3619 additions and 2 deletions

View File

@@ -44,6 +44,10 @@ if (defined(LOSCFG_COMPILER_ICCARM)) {
}
}
declare_args() {
liteos_build_asm = true
}
config("arch_config") {
cflags = arch_config_cflags
asmflags = arch_config_asmflags
@@ -215,4 +219,7 @@ build_ext_component("build_kernel_image") {
exec_path = rebase_path(root_out_dir)
command = toochain_config_command
if (liteos_build_asm) {
command += toochain_asm_command
}
}

View File

@@ -206,5 +206,6 @@ toochain_config_objdump = "${compile_prefix}objdump$toolchain_cmd_suffix"
toochain_config_command =
"$toochain_config_objcopy -O binary $liteos_name $liteos_name.bin"
toochain_config_command += " && sh -c '$toochain_config_objdump -t $liteos_name | sort >$liteos_name.sym.sorted'"
toochain_config_command +=
toochain_asm_command =
" && sh -c '$toochain_config_objdump -d $liteos_name >$liteos_name.asm'"

View File

@@ -149,4 +149,5 @@ toochain_config_objdump = "${compile_prefix}ielfdumparm$toolchain_cmd_suffix"
toochain_config_command =
"$toochain_config_objcopy --bin --verbose $liteos_name $liteos_name.bin"
toochain_config_command += " && sh -c '$toochain_config_objdump --source --all $liteos_name -o $liteos_name.asm'"
toochain_asm_command = " && sh -c '$toochain_config_objdump --source --all $liteos_name -o $liteos_name.asm'"

View File

@@ -34,6 +34,8 @@ static_library("cmsis_test") {
"cmsis_msg_func_test.c",
"cmsis_mutex_func_test.c",
"cmsis_sem_func_test.c",
"cmsis_task_func_test.c",
"cmsis_task_pri_func_test.c",
"cmsis_timer_func_test.c",
"xts_cmsis.c",
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -36,5 +36,7 @@ void CmsisFuncTest(void)
CmsisMsgFuncTest();
CmsisMutexFuncTest();
CmsisSemFuncTest();
CmsisTaskFuncTest();
CmsisTaskPriFuncTest();
CmsisTimerFuncTest();
}

View File

@@ -78,4 +78,12 @@
#define DELAY_TICKS_5 5
#define DELAY_TICKS_10 10
#define PRIORITY_COUNT_NOT_MIN 3
#define PRIORITY_COUNT_MIN_1 4
#define PRIORITY_COUNT_MIN_2 5
#define PRIORITY_COUNT_MIN_3 6
#define PRIORITY_COUNT_MIN_4 7
#define MAX_UINT32 0xFFFFFFFF
#define ALIVE_INFO_DIS 10000
#endif

View File

@@ -647,6 +647,200 @@ LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqSetAttrEBADFEINVAL, Function |
return 0;
}
/* *
* @tc.number SUB_KERNEL_IPC_MQ_OPEN_0100
* @tc.name mq_open function errno for EEXIST test
* @tc.desc [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqOpenEEXIST, Function | MediumTest | Level2)
{
int ret;
char qName[MQ_NAME_LEN];
mqd_t queue, queueOther;
ret = sprintf_s(qName, sizeof(qName), "testMqOpenEEXIST_%d", GetRandom(10000)); /* 10000, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(ret, strlen(qName), ret);
queue = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL);
ICUNIT_ASSERT_NOT_EQUAL(queue, (mqd_t)-1, queue); /* 1, common data for test, no special meaning */
queueOther = mq_open(qName, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR, NULL);
ICUNIT_ASSERT_EQUAL(queueOther, (mqd_t)-1, queueOther); /* 1, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(errno, EEXIST, errno);
ret = mq_close(queue);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = mq_unlink(qName);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
return 0;
}
/* *
* @tc.number SUB_KERNEL_IPC_MQ_OPEN_0200
* @tc.name mq_open function errno for EINVAL test
* @tc.desc [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqOpenEINVAL, Function | MediumTest | Level2)
{
int i, ret;
mqd_t queue;
struct mq_attr attr = { 0 };
char qName[MQ_NAME_LEN];
const int max = 65535; /* 65535, common data for test, no special meaning */
ret = sprintf_s(qName, sizeof(qName), "testMqOpenEINVAL_%d", GetRandom(10000)); /* 10000, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(ret, strlen(qName), ret);
for (i = 0; i < 6; i++) {
switch (i) {
case 0:
attr.mq_msgsize = -1; /* -1, common data for test, no special meaning */
attr.mq_maxmsg = max;
break;
case 1:
attr.mq_msgsize = max;
attr.mq_maxmsg = max;
break;
case 2:
attr.mq_msgsize = 10; /* 10, common data for test, no special meaning */
attr.mq_maxmsg = -1; /* -1, common data for test, no special meaning */
break;
case 3:
attr.mq_msgsize = 10; /* 10, common data for test, no special meaning */
attr.mq_maxmsg = max + 1;
break;
case 4:
attr.mq_msgsize = 0; /* 0, common data for test, no special meaning */
attr.mq_maxmsg = 16; /* 16, common data for test, no special meaning */
break;
case 5:
attr.mq_msgsize = 64; /* 64, common data for test, no special meaning */
attr.mq_maxmsg = 0; /* 0, common data for test, no special meaning */
break;
}
queue = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr);
ICUNIT_ASSERT_EQUAL(queue, (mqd_t)-1, queue); /* 1, common data for test, no special meaning */
if (queue != (mqd_t)-1) { /* 1, common data for test, no special meaning */
ret = mq_close(queue);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = mq_unlink(qName);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
}
ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno);
}
for (i = 0; i < MQ_NAME_LEN; i++) {
qName[i] = 0;
}
attr.mq_msgsize = MQ_MSG_SIZE;
attr.mq_maxmsg = MQ_MAX_MSG;
queue = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr);
ICUNIT_ASSERT_EQUAL(queue, (mqd_t)-1, queue); /* 1, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno);
return 0;
}
/* *
* @tc.number SUB_KERNEL_IPC_MQ_OPEN_0300
* @tc.name mq_open function errno for ENAMETOOLONG test
* @tc.desc [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqOpenENAMETOOLONG, Function | MediumTest | Level2)
{
char qName[MAX_MQ_NAME_LEN + 10]; /* 10, common data for test, no special meaning */
mqd_t queue;
int i, ret;
for (i = 0; i < MAX_MQ_NAME_LEN + 5; i++) { /* 5, common data for test, no special meaning */
qName[i] = '8';
}
qName[i] = '\0';
queue = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL);
ICUNIT_ASSERT_EQUAL(queue, (mqd_t)-1, queue); /* -1, common data for test, no special meaning */
if (queue != (mqd_t)-1) { /* -1, common data for test, no special meaning */
ret = mq_close(queue);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = mq_unlink(qName);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
}
ICUNIT_ASSERT_EQUAL(errno, ENAMETOOLONG, errno);
return 0;
}
/* *
* @tc.number SUB_KERNEL_IPC_MQ_OPEN_0400
* @tc.name mq_open function errno for ENOENT test
* @tc.desc [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqOpenENOENT, Function | MediumTest | Level3)
{
int ret;
mqd_t queue;
char qName[MQ_NAME_LEN];
ret = sprintf_s(qName, MQ_NAME_LEN, "testMqOpenENOENT_%d", GetRandom(10000)); /* 10000, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(ret, strlen(qName), ret);
queue = mq_open(qName, O_RDWR, S_IRUSR | S_IWUSR, NULL);
ICUNIT_ASSERT_EQUAL(queue, (mqd_t)-1, queue); /* -1, common data for test, no special meaning */
if (queue != (mqd_t)-1) { /* -1, common data for test, no special meaning */
ret = mq_close(queue);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = mq_unlink(qName);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
}
ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno);
return 0;
}
/* *
* @tc.number SUB_KERNEL_IPC_MQ_OPEN_0600
* @tc.name mq_open function errno for ENOSPC test
* @tc.desc [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqOpenENOSPC, Function | MediumTest | Level3)
{
int ret;
mqd_t queue;
struct mq_attr setAttr = { 0 };
char qName[MQ_NAME_LEN];
ret = sprintf_s(qName, MQ_NAME_LEN, "testMqOpenENOSPC_%d", GetRandom(10000)); /* 10000, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(ret, strlen(qName), ret);
setAttr.mq_msgsize = MAX_MQ_MSG_SIZE + 1; /* 1, common data for test, no special meaning */
setAttr.mq_maxmsg = MAX_MQ_NAME_LEN;
queue = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &setAttr);
ICUNIT_ASSERT_EQUAL(queue, (mqd_t)-1, queue); /* -1, common data for test, no special meaning */
if (queue != (mqd_t)-1) { /* -1, common data for test, no special meaning */
ret = mq_close(queue);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = mq_unlink(qName);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
}
ICUNIT_ASSERT_EQUAL(errno, ENOSPC, errno);
return 0;
}
/* *
* @tc.number SUB_KERNEL_IPC_MQ_CLOSE_0100
* @tc.name mq_close function errno for EBADF test
* @tc.desc [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(IpcMqExceptionApiTestSuite, testMqCloseEBADF, Function | MediumTest | Level2)
{
int ret = mq_close(NULL);
ICUNIT_ASSERT_EQUAL(ret, -1, ret); /* -1, common data for test, no special meaning */
ICUNIT_ASSERT_EQUAL(errno, EBADF, errno);
return 0;
}
RUN_TEST_SUITE(IpcMqExceptionApiTestSuite);
void IpcMqExceptionFuncTest(void)
@@ -667,4 +861,10 @@ void IpcMqExceptionFuncTest(void)
RUN_ONE_TESTCASE(testMqUnlinkEINVAL);
RUN_ONE_TESTCASE(testMqGetAttrEBADFEINVAL);
RUN_ONE_TESTCASE(testMqSetAttrEBADFEINVAL);
RUN_ONE_TESTCASE(testMqOpenEEXIST);
RUN_ONE_TESTCASE(testMqOpenEINVAL);
RUN_ONE_TESTCASE(testMqOpenENAMETOOLONG);
RUN_ONE_TESTCASE(testMqOpenENOENT);
RUN_ONE_TESTCASE(testMqOpenENOSPC);
RUN_ONE_TESTCASE(testMqCloseEBADF);
}