Compare commits

..

4 Commits

Author SHA1 Message Date
openharmony_ci
73a9587f02 !1046 Fix : 内核告警清理
Merge pull request !1046 from yinjiaming/fix
2022-10-27 12:50:29 +00:00
openharmony_ci
cbd03bd7e0 !913 删除PLATFORM_QEMU_ARM_VIRT_CA7侵入内核的所有代码
Merge pull request !913 from laokz/jffs2fat
2022-10-26 03:52:16 +00:00
yinjiaming
8d55bb1d8c fix: 内核告警清理
【背景】
内核告警清理

【修改方案】
删去了多余的空格,更改了魔数字

【影响】
对现有的产品编译不会有影响。

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Iba21be6cb23027dfb369576847d7d21e85f936b4
2022-10-26 10:57:08 +08:00
laokz
059c1c22b1 fix(PLATFORM_QEMU_ARM_VIRT_CA7): remove all invasive code
arm-virt emulation rootfs change to vfat from jffs2,
root device change to eMMC from CFI flash

Signed-off-by: laokz <laokz@foxmail.com>
Change-Id: If284809b989918cf10f5d32803df42c8c57830b2
2022-06-25 18:25:39 +08:00
27 changed files with 140 additions and 106 deletions

View File

@@ -82,9 +82,6 @@ endif
ifeq ($(LOSCFG_STORAGE_SPINAND), y)
FSTYPE = yaffs2
endif
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
FSTYPE = jffs2
endif
ROOTFS_DIR = $(OUT)/rootfs
ROOTFS_ZIP = $(OUT)/rootfs.zip

View File

@@ -49,7 +49,7 @@ ShellCB *OsGetShellCb()
return g_shellCB;
}
static void ShellDeinit(ShellCB *shellCB)
void ShellDeinit(ShellCB *shellCB)
{
(void)pthread_mutex_destroy(&shellCB->historyMutex);
(void)pthread_mutex_destroy(&shellCB->keyMutex);
@@ -65,23 +65,27 @@ static int OsShellCreateTask(ShellCB *shellCB)
ret = sched_getparam(getpid(), &param);
if (ret != SH_OK) {
return ret;
goto OUT;
}
param.sched_priority = SHELL_PROCESS_PRIORITY_INIT;
ret = sched_setparam(getpid(), &param);
if (ret != SH_OK) {
return ret;
goto OUT;
}
ret = ShellTaskInit(shellCB);
if (ret != SH_OK) {
return ret;
goto OUT;
}
shellCB->shellEntryHandle = pthread_self();
return 0;
OUT:
ShellDeinit(shellCB);
return ret;
}
static int DoShellExec(char **argv)
@@ -144,7 +148,7 @@ int main(int argc, char **argv)
shellCB = (ShellCB *)malloc(sizeof(ShellCB));
if (shellCB == NULL) {
return SH_NOK;
goto ERR_OUT1;
}
ret = memset_s(shellCB, sizeof(ShellCB), 0, sizeof(ShellCB));
if (ret != SH_OK) {
@@ -172,9 +176,7 @@ int main(int argc, char **argv)
g_shellCB = shellCB;
ret = OsShellCreateTask(shellCB);
if (ret != SH_OK) {
ShellDeinit(shellCB);
g_shellCB = NULL;
return ret;
goto ERR_OUT3;
}
ShellEntry(shellCB);

View File

@@ -1465,7 +1465,7 @@ INT32 los_disk_init(const CHAR *diskName, const struct block_operations *bops,
ret = VnodeLookup(diskName, &blkDriver, 0);
if (ret < 0) {
VnodeDrop();
PRINT_ERR("disk_init : %s, failed to find the vnode, ERRNO=%d\n", diskName, ret);
ret = ENOENT;
goto DISK_FIND_ERROR;
}
struct block_operations *bops2 = (struct block_operations *)((struct drv_data *)blkDriver->data)->ops;

View File

@@ -39,10 +39,6 @@ kernel_module(module_name) {
include_dirs = [ "$LITEOSTOPDIR/fs/jffs2/include" ]
if (defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)) {
include_dirs += [ "//device/qemu/drivers/cfiflash" ]
}
public_configs = [ ":public" ]
}

View File

@@ -36,10 +36,6 @@ LOCAL_SRCS := $(wildcard src/*.c)
LOCAL_INCLUDE := \
-I $(LITEOSTOPDIR)/fs/jffs2/include
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash
endif
LOCAL_FLAGS := $(LOCAL_INCLUDE)
include $(MODULE)

View File

@@ -39,11 +39,6 @@
#include "fs/driver.h"
#include "mtd/mtd_legacy_lite.h"
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#include "cfiflash.h"
#endif
#define DRIVER_NAME_ADD_SIZE 3
pthread_mutex_t g_mtdPartitionLock = PTHREAD_MUTEX_INITIALIZER;
@@ -134,17 +129,10 @@ static VOID MtdNorParamAssign(partition_param *spinorParam, const struct MtdDev
* you can change the SPIBLK_NAME or SPICHR_NAME to NULL.
*/
spinorParam->flash_mtd = (struct MtdDev *)spinorMtd;
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
spinorParam->flash_ops = GetDevSpinorOps();
spinorParam->char_ops = GetMtdCharFops();
spinorParam->blockname = SPIBLK_NAME;
spinorParam->charname = SPICHR_NAME;
#else
spinorParam->flash_ops = GetCfiBlkOps();
spinorParam->char_ops = NULL;
spinorParam->blockname = CFI_DRIVER;
spinorParam->charname = NULL;
#endif
spinorParam->partition_head = g_spinorPartitionHead;
spinorParam->block_size = spinorMtd->eraseSize;
}
@@ -158,11 +146,7 @@ static VOID MtdDeinitSpinorParam(VOID)
static partition_param *MtdInitSpinorParam(partition_param *spinorParam)
{
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
struct MtdDev *spinorMtd = GetMtd("spinor");
#else
struct MtdDev *spinorMtd = GetCfiMtdDev();
#endif
if (spinorMtd == NULL) {
return NULL;
}

View File

@@ -33,10 +33,6 @@ MODULE_NAME := rootfs
LOCAL_SRCS := $(wildcard los_rootfs.c los_bootargs.c)
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash
endif
LOCAL_FLAGS := $(LOCAL_INCLUDE)
include $(MODULE)

View File

@@ -32,14 +32,10 @@
#include "los_base.h"
#include "string.h"
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND)
#include "mtd_list.h"
#endif
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#include "cfiflash.h"
#endif
#ifdef LOSCFG_STORAGE_EMMC
#include "disk.h"
#endif
@@ -98,19 +94,6 @@ INT32 LOS_GetCmdLine(VOID)
}
#endif
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
struct MtdDev *mtd = GetCfiMtdDev();
if (mtd == NULL) {
PRINT_ERR("Get CFI mtd failed!\n");
goto ERROUT;
}
g_alignSize = mtd->eraseSize;
ret = mtd->read(mtd, CFIFLASH_BOOTARGS_ADDR, COMMAND_LINE_SIZE, g_cmdLine);
if (ret == COMMAND_LINE_SIZE) {
return LOS_OK;
}
#endif
PRINT_ERR("Read cmdline error!\n");
ERROUT:
free(g_cmdLine);

View File

@@ -37,15 +37,11 @@
#include "sys/stat.h"
#include "sys/types.h"
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND)
#include "mtd_list.h"
#include "mtd_partition.h"
#endif
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#include "cfiflash.h"
#endif
#ifdef LOSCFG_STORAGE_EMMC
#include "disk.h"
#include "ff.h"
@@ -128,14 +124,7 @@ STATIC INT32 AddEmmcParts(INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32
STATIC INT32 AddPartitions(CHAR *dev, UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize)
{
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
if ((strcmp(dev, "cfi-flash") == 0) && (rootAddr != CFIFLASH_ROOT_ADDR)) {
PRINT_ERR("Error rootAddr, must be %#0x!\n", CFIFLASH_ROOT_ADDR);
return LOS_NOK;
}
#endif
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND)
INT32 ret;
INT32 blk0 = 0;
INT32 blk2 = 2;

View File

@@ -59,12 +59,6 @@
#define ROOTFS_ADDR 0x600000
#define ROOTFS_SIZE 0x800000
#define USERFS_SIZE 0x80000
#elif defined (LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
#define ROOT_DEV_NAME "/dev/cfiflash0"
#define USER_DEV_NAME "/dev/cfiflash2"
#define ROOTFS_ADDR CFIFLASH_ROOT_ADDR
#define ROOTFS_SIZE 0x1B00000
#define USERFS_SIZE (CFIFLASH_CAPACITY - ROOTFS_ADDR - ROOTFS_SIZE)
#elif defined (LOSCFG_STORAGE_EMMC)
#define ROOT_DEV_NAME "/dev/mmcblk0p0"
#ifdef LOSCFG_PLATFORM_PATCHFS

View File

@@ -146,6 +146,7 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm)
LosVmSpace *space = NULL;
LOS_DL_LIST *spaceList = NULL;
UINT32 UProcessUsed = 0;
UINT32 pmTmp;
if (actualPm == NULL) {
return 0;
@@ -166,7 +167,8 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm)
if (space == LOS_GetKVmSpace()) {
continue;
}
UProcessUsed += OsUProcessPmUsage(space, NULL, NULL);
(VOID)OsUProcessPmUsage(space, NULL, &pmTmp);
UProcessUsed += pmTmp;
}
(VOID)LOS_MuxRelease(vmSpaceListMux);

View File

@@ -233,8 +233,14 @@ static int HiLogWriteRingBuffer(unsigned char *buffer, size_t bufLen)
static void HiLogHeadInit(struct HiLogEntry *header, size_t len)
{
struct timespec now = {0};
(void)clock_gettime(CLOCK_REALTIME, &now);
struct timespec now;
int ret;
ret = clock_gettime(CLOCK_REALTIME, &now);
if (ret != 0) {
PRINTK("In %s line %d,clock_gettime fail\n", __FUNCTION__, __LINE__);
return;
}
header->len = len;
header->pid = LOS_GetCurrProcessID();

View File

@@ -2175,6 +2175,8 @@ u32_t osShellPing6(int argc, const char **argv)
/* Setting the start time of the entire ping task for statistics */
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &first);
nsent = 0;
for (nsent = 0; nsent < ping6_params.pingcount; nsent++) {
/* capture the start tick to calculate rtt */
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &start);
@@ -3168,6 +3170,7 @@ void netstat_internal(void *ctx)
}
/* For listen PCBs */
recvQlen = 0;
sendQlen = 0;
for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
@@ -3667,7 +3670,7 @@ u32_t netdebug_sock(int argc, const char **argv)
int idx;
u32_t ret = LOS_NOK;
if (argc == 2) { /* 2: Number of command parameters */
if (argc == 2) {
if (!strcmp("-i", argv[1])) {
/* netdebug sock -i */
for (idx = 0; idx < (int)LWIP_CONFIG_NUM_SOCKETS; idx++) {
@@ -3675,9 +3678,10 @@ u32_t netdebug_sock(int argc, const char **argv)
}
ret = LOS_OK;
}
} else if (argc == 3) { /* 3: Number of command parameters */
} else if (argc == 3) {
if (!strcmp("-d", argv[1])) {
idx = atoi(argv[2]); /* 2: netdebug sock -d <idx> */
/* netdebug sock -d <idx> */
idx = atoi(argv[2]);
if (idx >= 0) {
debug_socket_info(idx, 1, 1);
ret = LOS_OK;

View File

@@ -109,7 +109,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
{
int ret;
struct itimerval svalue;
struct itimerval sovalue = { 0 };
struct itimerval sovalue;
if (value == NULL) {
errno = EINVAL;
@@ -137,7 +137,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
int SysGetiTimer(int which, struct itimerval *value)
{
int ret;
struct itimerval svalue = { 0 };
struct itimerval svalue;
if (value == NULL) {
errno = EINVAL;
@@ -189,7 +189,7 @@ int SysTimerCreate(clockid_t clockID, struct ksigevent *evp, timer_t *timerID)
int SysTimerGettime(timer_t timerID, struct itimerspec *value)
{
int ret;
struct itimerspec svalue = { 0 };
struct itimerspec svalue;
if (value == NULL) {
errno = EINVAL;
@@ -213,7 +213,7 @@ int SysTimerSettime(timer_t timerID, int flags, const struct itimerspec *value,
{
int ret;
struct itimerspec svalue;
struct itimerspec soldValue = { 0 };
struct itimerspec soldValue;
if (value == NULL) {
errno = EINVAL;
@@ -285,7 +285,7 @@ int SysClockSettime(clockid_t clockID, const struct timespec *tp)
int SysClockGettime(clockid_t clockID, struct timespec *tp)
{
int ret;
struct timespec stp = { 0 };
struct timespec stp;
if (tp == NULL) {
errno = EINVAL;
@@ -308,7 +308,7 @@ int SysClockGettime(clockid_t clockID, struct timespec *tp)
int SysClockGetres(clockid_t clockID, struct timespec *tp)
{
int ret;
struct timespec stp = { 0 };
struct timespec stp;
if (tp == NULL) {
errno = EINVAL;
@@ -356,7 +356,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
{
int ret;
struct timespec srqtp;
struct timespec srmtp = { 0 };
struct timespec srmtp;
if (!rqtp || LOS_ArchCopyFromUser(&srqtp, rqtp, sizeof(struct timespec))) {
errno = EFAULT;
@@ -384,7 +384,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
clock_t SysTimes(struct tms *buf)
{
clock_t ret;
struct tms sbuf = { 0 };
struct tms sbuf;
if (buf == NULL) {
errno = EFAULT;
@@ -436,7 +436,7 @@ int SysClockGettime64(clockid_t clockID, struct timespec64 *tp)
{
int ret;
struct timespec t;
struct timespec64 stp = { 0 };
struct timespec64 stp;
if (tp == NULL) {
errno = EINVAL;
@@ -463,7 +463,7 @@ int SysClockGetres64(clockid_t clockID, struct timespec64 *tp)
{
int ret;
struct timespec t;
struct timespec64 stp = { 0 };
struct timespec64 stp;
if (tp == NULL) {
errno = EINVAL;
@@ -525,7 +525,7 @@ int SysTimerGettime64(timer_t timerID, struct itimerspec64 *value)
{
int ret;
struct itimerspec val;
struct itimerspec64 svalue = { 0 };
struct itimerspec64 svalue;
if (value == NULL) {
errno = EINVAL;
@@ -584,7 +584,6 @@ int SysTimerSettime64(timer_t timerID, int flags, const struct itimerspec64 *val
}
if (oldValue != NULL) {
(void)memset_s(&soldValue, sizeof(struct itimerspec64), 0, sizeof(struct itimerspec64));
soldValue.it_interval.tv_sec = oldVal.it_interval.tv_sec;
soldValue.it_interval.tv_nsec = oldVal.it_interval.tv_nsec;
soldValue.it_value.tv_sec = oldVal.it_value.tv_sec;

View File

@@ -55,6 +55,7 @@ static int Testcase(VOID)
ICUNIT_GOTO_EQUAL(ds.shm_perm.uid, getuid(), ds.shm_perm.uid, ERROR_OUT);
ret = shmctl(shmid, SHM_STAT, &ds);
// ICUNIT_GOTO_EQUAL(ret, 0x10000, ret, ERROR_OUT);
ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, ERROR_OUT);
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, ERROR_OUT);
@@ -69,7 +70,7 @@ static int Testcase(VOID)
ICUNIT_GOTO_EQUAL(info.shmmax, 0x1000000, info.shmmax, ERROR_OUT);
ICUNIT_GOTO_EQUAL(info.shmmin, 1, info.shmmin, ERROR_OUT);
ICUNIT_GOTO_EQUAL(info.shmmni, 192, info.shmmni, ERROR_OUT);
ICUNIT_GOTO_EQUAL(info.shmseg, 128, info.shmseg, ERROR_OUT); // 128: expected value of shmseg
ICUNIT_GOTO_EQUAL(info.shmseg, 128, info.shmseg, ERROR_OUT);
ICUNIT_GOTO_EQUAL(info.shmall, 0x1000, info.shmall, ERROR_OUT);
ret = shmdt(shm);

View File

@@ -63,11 +63,13 @@ static int LiteIpcTest(void)
/* testing mmap liteipc mem pool with different size and flag */
retptr = mmap(nullptr, 1024 * 4096, PROT_READ, MAP_PRIVATE, fd, 0);
ICUNIT_ASSERT_EQUAL(static_cast<int>(static_cast<intptr_t>(retptr)), -1, retptr);
//retptr = mmap(nullptr, 0, PROT_READ, MAP_PRIVATE, fd, 0);
//ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr);
retptr = mmap(nullptr, -1, PROT_READ, MAP_PRIVATE, fd, 0);
ICUNIT_ASSERT_EQUAL(static_cast<int>(static_cast<intptr_t>(retptr)), -1, retptr);
retptr = mmap(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
ICUNIT_ASSERT_EQUAL(static_cast<int>(static_cast<intptr_t>(retptr)), -1, retptr);
retptr = mmap(nullptr, 4096, PROT_READ, MAP_SHARED, fd, 0); // 4096: length of mapped memory
retptr = mmap(nullptr, 4096, PROT_READ, MAP_SHARED, fd, 0);
ICUNIT_ASSERT_EQUAL(static_cast<int>(static_cast<intptr_t>(retptr)), -1, retptr);
retptr = mmap(nullptr, 1, PROT_READ, MAP_PRIVATE, fd, 0);
@@ -79,7 +81,7 @@ static int LiteIpcTest(void)
char buf[10] = {0};
ret = read(fd, buf, 10);
ICUNIT_ASSERT_EQUAL(ret, -1, ret);
ret = write(fd, buf, 10); // 10: size of buf
ret = write(fd, buf, 10);
ICUNIT_ASSERT_EQUAL(ret, -1, ret);
/* before set cms, testing ioctl cmd */
@@ -94,7 +96,7 @@ static int LiteIpcTest(void)
sleep(2);
/* after set cms, testing set cms cmd */
ret = ioctl(fd, IPC_SET_CMS, 200); // 200: use 200 for set cms cmd testing
ret = ioctl(fd, IPC_SET_CMS, 200);
ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret);
exit(0);

View File

@@ -60,6 +60,17 @@ static int TestCase()
exit(0);
}
/* sig = SIGTERM;
ret = sigaction(sig, (struct sigaction *)1, &oldAct);
printf("ret == %d\n", ret);
ICUNIT_ASSERT_EQUAL(ret, -1, ret);
ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno);
ret = sigaction(sig, &sigAct, (struct sigaction *)1);
printf("ret === %d\n", ret);
ICUNIT_ASSERT_EQUAL(ret, -1, ret);
ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); */
ret = waitpid(fpid, &status, 0);
ICUNIT_ASSERT_EQUAL(ret, fpid, ret);
ICUNIT_ASSERT_EQUAL(WEXITSTATUS(status), 0, WEXITSTATUS(status));

View File

@@ -37,6 +37,7 @@ static UINT32 testcase(VOID)
time_t currtime;
struct tm *timer = {nullptr};
char buffer[80];
//locale_t loc = malloc(sizeof(locale_t);
time(&currtime);
timer = localtime(&currtime);
@@ -45,17 +46,17 @@ static UINT32 testcase(VOID)
printf("getenv MUSL_LOCPATH=%s\n", getenv("MUSL_LOCPATH"));
printf("Locale is: %s\n", setlocale(LC_TIME, "en_US.UTF-8"));
(void)strftime(buffer, sizeof(buffer), "%c", timer);
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
printf("Locale is: %s\n", setlocale(LC_TIME, "zh_CN.UTF-8"));
(void)strftime(buffer, sizeof(buffer), "%c", timer);
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
printf("Locale is: %s\n", setlocale(LC_TIME, ""));
(void)strftime(buffer, sizeof(buffer), "%c", timer);
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
setlocale(LC_ALL, "C");

View File

@@ -145,6 +145,26 @@ HWTEST_F(MiscTest, ItTestMisc009, TestSize.Level0)
ItTestMisc009();
}
/* *
* @tc.name: IT_TEST_MISC_010
* @tc.desc: function for MiscTest
* @tc.type: FUNC
*/
/*HWTEST_F(MiscTest, ItTestMisc010, TestSize.Level0)
{
ItTestMisc010();
}*/
/* *
* @tc.name: IT_TEST_MISC_011
* @tc.desc: function for MiscTest
* @tc.type: FUNC
*/
/*HWTEST_F(MiscTest, ItTestMisc011, TestSize.Level0)
{
ItTestMisc011();
}*/
/* *
* @tc.name: IT_TEST_MISC_012
* @tc.desc: function for MiscTest
@@ -154,6 +174,16 @@ HWTEST_F(MiscTest, ItTestMisc012, TestSize.Level0)
{
ItTestMisc012();
}
/* *
* @tc.name: IT_TEST_MISC_013
* @tc.desc: function for MiscTest
* @tc.type: FUNC
*/
/*HWTEST_F(MiscTest, ItTestMisc013, TestSize.Level0)
{
ItTestMisc013();
}*/
#endif
} // namespace OHOS

View File

@@ -56,7 +56,7 @@
#define TEST_HwiTrigger(HWI_NUM_TEST)
#define LOS_TaskLock()
#define LOS_TaskUnlock()
#define LOS_MS2Tick(ms) ((ms) / 10)
#define LOS_MS2Tick(ms) (ms / 10)
#define OS_TASK_PRIORITY_HIGHEST 0
#define OS_TASK_PRIORITY_LOWEST 31
@@ -228,7 +228,12 @@ struct testdata {
};
extern struct testdata g_td;
extern unsigned int sleep(unsigned int seconds);
extern unsigned int alarm(unsigned int seconds);
extern int map_errno(UINT32 err);
extern long sysconf(int name);
extern void posix_signal_start(void);
VOID ScenarInit(VOID);

View File

@@ -34,6 +34,7 @@ static void *pthread_f01(void *tmp)
{
int rc = 0;
g_testCount++;
// printf("www\n");
/* acquire the mutex */
rc = pthread_mutex_lock(&g_pthreadMutexTest1);
@@ -68,7 +69,7 @@ static UINT32 Testcase(VOID)
/* Let the other thread run */
LosTaskDelay(2);
ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount); // 2: expected value of g_testCount
ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount);
/* Try to destroy the cond var. This should return an error */
rc = pthread_cond_destroy(&g_pthreadCondTest1);
@@ -78,7 +79,7 @@ static UINT32 Testcase(VOID)
ICUNIT_ASSERT_EQUAL(rc, 0, rc);
LosTaskDelay(2);
ICUNIT_ASSERT_EQUAL(g_testCount, 4, g_testCount); // 4: expected value of g_testCount
ICUNIT_ASSERT_EQUAL(g_testCount, 4, g_testCount);
rc = pthread_cond_destroy(&g_pthreadCondTest1);
ICUNIT_ASSERT_EQUAL(rc, 0, rc);

View File

@@ -51,6 +51,10 @@ static UINT32 Testcase(VOID)
tmp = pthread_equal(a, b);
// pthread_join(a, NULL);
// pthread_detach(a);
pthread_attr_init(&aa);
pthread_attr_getdetachstate(&aa, &detachstate);
@@ -59,6 +63,19 @@ static UINT32 Testcase(VOID)
pthread_attr_destroy(&aa);
// pthread_mutex_init(&c, NULL);
// pthread_mutex_destroy(&c);
// pthread_mutex_lock(&c);
// pthread_mutex_trylock(&c);
// pthread_mutex_unlock(&c);
// pthread_mutexattr_init(&c);
// pthread_mutexattr_destroy(&c);
ret = pthread_join(aThread, NULL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);

View File

@@ -36,6 +36,8 @@ static void *ThreadF01(void *arg)
/* Shouldn't reach here. If we do, then the pthread_cancel()
* function did not succeed. */
// uart_printf_func("Could not send cancel request correctly\n");
// ICUNIT_TRACK_EQUAL(1, 0, errno);
pthread_exit(nullptr);
return NULL;
}
@@ -60,6 +62,7 @@ static UINT32 Testcase(VOID)
ret = pthread_join(newTh, (void **)&temp);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
// ICUNIT_ASSERT_EQUAL(temp, (UINTPTR)PTHREAD_CANCELED, temp);
return PTHREAD_NO_ERROR;
}

View File

@@ -34,6 +34,7 @@ static void *ThreadF01(void *arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
// while (1)
sleep(1);
pthread_exit(nullptr);
@@ -47,6 +48,7 @@ static UINT32 Testcase(VOID)
pthread_t a;
/* SIGALRM will be sent in 5 seconds. */
// alarm(5);//alarm NOT SUPPORT
/* Create a new thread. */
if (pthread_create(&a, NULL, ThreadF01, NULL) != 0) {
@@ -59,6 +61,7 @@ static UINT32 Testcase(VOID)
/* If 'main' has reached here, then the test passed because it means
* that the thread is truly asynchronise, and main isn't waiting for
* it to return in order to move on. */
// printf("Test PASSED\n");
ret = pthread_join(a, &temp);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);

View File

@@ -176,5 +176,16 @@ HWTEST_F(NetSocketTest, NetSocketTest012, TestSize.Level0)
NetSocketTest012();
}
/* *
* @tc.name: NetSocketTest013
* @tc.desc: function for NetSocketTest
* @tc.type: FUNC
*/
/*
HWTEST_F(NetSocketTest, NetSocketTest013, TestSize.Level0)
{
//NetSocketTest013(); // broadcast to self to be supported.
}
*/
#endif
}

View File

@@ -131,6 +131,7 @@ def parse_user_pc_ulr(excinfo_file, rootfs_dir, string, addr2line_cmd, objdump_c
ret = commands.getoutput(cmd)
print(ret)
cmd = "%s%s%s %s" % (addr2line_cmd, rootfs_dir, strlist[4], strlist[6])
#print(cmd)
ret = commands.getoutput(cmd)
ret = ret.split('\n')
print("<%s>%s<%s><%s>\n" % (string, ret[0], strlist[6], strlist[4]))

View File

@@ -38,7 +38,7 @@ get_line()
{
SYM_ADDR=$(echo $1 | awk '{print $2}')
ELF_OFFSET=$(echo ${SYM_ADDR} | cut -d '[' -f2 | cut -d ']' -f1)
FILE_LINE=$(${ADDR2LINE} -f -e $2 ${ELF_OFFSET} | awk 'NR==2')
FILE_LINE=$(${ADDR2LINE} -f -e $2 ${ELF_OFFSET} | awk 'NR==2'`)
if [[ "${FILE_LINE}" == *"?"* ]]; then
typeset ELF_OFFSET=$((ELF_OFFSET+LOAD_BASE))
ELF_OFFSET=$(echo "obase=16;${ELF_OFFSET}" | bc)