fix: 内源检视问题修复

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
This commit is contained in:
arvinzzz
2022-03-21 14:37:31 +08:00
parent 74def19245
commit c24363bc50
149 changed files with 256 additions and 304 deletions

View File

@@ -43,13 +43,13 @@ static VOID TaskF01(VOID)
Atomic atomicTestCounter = 0;
INT32 readCounter = 0;
INT32 atomicRet = 0;
Atomic64 atomic64TestCounter = 0;
INT64 read64Counter = 0;
INT64 atomic64Ret = 0;
ICUNIT_ASSERT_EQUAL(g_testCount, 0, g_testCount);
atomicTestCounter = 0x88888888;
LOS_AtomicSet(&atomicTestCounter, 0x88888888);
atomicRet = LOS_AtomicAdd(&atomicTestCounter, 0x33333333);

0
testsuites/sample/kernel/dynlink/It_los_dynlink.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink.h Executable file → Normal file
View File

2
testsuites/sample/kernel/dynlink/It_los_dynlink_001.c Executable file → Normal file
View File

@@ -35,7 +35,7 @@ STATIC UINT32 TestCase(VOID)
{
INT32 ret;
VOID *handle = NULL;
INT32 (*func)(INT32 ,INT32) = NULL;
INT32 (*func)(INT32, INT32) = NULL;
handle = (VOID *)LOS_SoLoad(NULL, NULL);
ICUNIT_ASSERT_EQUAL(handle, NULL, handle);

2
testsuites/sample/kernel/dynlink/It_los_dynlink_002.c Executable file → Normal file
View File

@@ -30,7 +30,7 @@
#include "los_dynlink.h"
#include "It_los_dynlink.h"
/* Test invalide params */
/* Test invalid params */
STATIC UINT32 TestCase(VOID)
{
VOID *handle = NULL;

0
testsuites/sample/kernel/dynlink/It_los_dynlink_003.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_004.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_005.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_006.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_007.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_008.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_009.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_011.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_012.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_013.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_014.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_015.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_016.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_017.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_018.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_019.c Executable file → Normal file
View File

0
testsuites/sample/kernel/dynlink/It_los_dynlink_020.c Executable file → Normal file
View File

0
testsuites/sample/kernel/hwi/it_los_hwi_039.c Executable file → Normal file
View File

0
testsuites/sample/kernel/hwi/it_los_hwi_040.c Executable file → Normal file
View File

View File

@@ -96,9 +96,9 @@ STATIC UINT32 TestCase(VOID)
ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_LMK_RESTORE_NOT_NEEDED, ret);
firstOpsNode.freeMem = release_OK;
firstOpsNode.restoreTask =restore_OK;
firstOpsNode.restoreTask = restore_OK;
anotherOpsNode.freeMem = release_OK;
anotherOpsNode.restoreTask =restore_OK;
anotherOpsNode.restoreTask = restore_OK;
ret = LOS_LmkTasksKill();
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
ret = LOS_LmkTasksRestore();

View File

@@ -36,9 +36,9 @@ static UINT32 TestCase(VOID)
{
CHAR *p = (CHAR *)LOS_MemAlloc(g_testLmsPool, INDEX_MAX);
ICUNIT_ASSERT_NOT_EQUAL(p, NULL, 0);
memset_s(p, INDEX_MAX, 0, INDEX_MAX + 1);
(void)memset_s(p, INDEX_MAX, 0, INDEX_MAX + 1);
PRINTK("p[0] = %d\n", p[0]);
memset_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
(void)memset_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
return LOS_OK;
}

View File

@@ -40,7 +40,7 @@ static UINT32 TestCase(VOID)
memcpy_s(p, INDEX_MAX, src, INDEX_MAX + 1);
PRINTK("p[0] = %d\n", p[0]);
memcpy_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
(void)memcpy_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
return LOS_OK;
}

View File

@@ -52,7 +52,6 @@ static UINT32 TestCase(VOID)
ICUNIT_GOTO_EQUAL(1, 0, 0, EXIT);
}
size = size;
p0 = LOS_MemAlloc(g_memPool, size);
ICUNIT_GOTO_EQUAL(p0, NULL, p0, EXIT);

View File

@@ -33,21 +33,23 @@
#include "It_los_mem.h"
#if (LOSCFG_MEM_MUL_REGIONS == 1)
#define TC_POOL_SIZE_1 0x200
#define TC_POOL_SIZE_2 0x400
#define TC_GAP_SIZE 0x10
// simulate two non-continuous memory regions
STATIC UINT8 g_memPool_TC46_01[0x200];
STATIC UINT8 g_memGap_TC46[0x10];
STATIC UINT8 g_memPool_TC46_02[0x400];
STATIC UINT8 g_memPool_TC46_01[TC_POOL_SIZE_1];
STATIC UINT8 g_memGap_TC46[TC_GAP_SIZE];
STATIC UINT8 g_memPool_TC46_02[TC_POOL_SIZE_2];
static UINT32 TestCase(VOID)
{
UINT32 ret;
void *p = NULL;
LosMemRegion memRegions[] =
{
{g_memPool_TC46_01, 0x200},
{g_memPool_TC46_02, 0x400}
};
LosMemRegion memRegions[] = {
{g_memPool_TC46_01, TC_POOL_SIZE_1},
{g_memPool_TC46_02, TC_POOL_SIZE_2}
};
// Initialize the LOS_MemRegionsAdd
ret = LOS_MemRegionsAdd(m_aucSysMem0, memRegions, sizeof(memRegions) / sizeof(memRegions[0]));
@@ -56,8 +58,8 @@ static UINT32 TestCase(VOID)
}
// p points to the start address of the gap node between g_memPool_TC46_01 and g_memPool_TC46_02
p = g_memPool_TC46_01 + 0x200;
(void)memset_s(g_memGap_TC46, 0x10, 1, 0x10);
p = g_memPool_TC46_01 + TC_POOL_SIZE_1;
(void)memset_s(g_memGap_TC46, TC_GAP_SIZE, 1, TC_GAP_SIZE);
ret = LOS_MemFree(m_aucSysMem0, p);
ICUNIT_GOTO_EQUAL(ret, LOS_NOK, ret, EXIT);
@@ -76,6 +78,3 @@ VOID ItLosMem046(void)
{
TEST_ADD_CASE("ItLosMem046", TestCase, TEST_LOS, TEST_MEM, TEST_LEVEL1, TEST_FUNCTION);
}

View File

@@ -68,7 +68,7 @@ static UINT32 Testcase(VOID)
g_testCount1 = 0;
// 1, Timeout interval of a periodic software timer.
ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId1, &irqParam
ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId1, (UINT32)&irqParam
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
, OS_SWTMR_ROUSES_ALLOW, OS_SWTMR_ALIGN_INSENSITIVE
#endif

View File

@@ -82,14 +82,14 @@ static UINT32 Testcase(VOID)
TestHwiClear(HWI_NUM_TEST);
// 10, Timeout interval of a periodic software timer.
ret = LOS_SwtmrCreate(10, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)Case3, &g_swtmrId1, &irqParam
ret = LOS_SwtmrCreate(10, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)Case3, &g_swtmrId1, (UINT32)&irqParam
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
, OS_SWTMR_ROUSES_ALLOW, OS_SWTMR_ALIGN_INSENSITIVE
#endif
);
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
// 20, Timeout interval of a periodic software timer.
ret = LOS_SwtmrCreate(20, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId2, &irqParam
ret = LOS_SwtmrCreate(20, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId2, (UINT32)&irqParam
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
, OS_SWTMR_ROUSES_ALLOW, OS_SWTMR_ALIGN_INSENSITIVE
#endif