提交 4e6c9d4e 编写于 作者: O openharmony_ci 提交者: Gitee

!615 删除特殊字符校验测试用例

Merge pull request !615 from jiyong/master
......@@ -28,6 +28,9 @@ export default {
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
......
......@@ -334,20 +334,6 @@ LITE_TEST_CASE(UtilsFileFuncTestSuite, testCreatLongNameFile, Function | MediumT
UtilsFileDelete(fileName);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_1700
* @tc.name : Creat file with special characters
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(UtilsFileFuncTestSuite, testCreatFileWithSpecChar, Function | MediumTest | Level1)
{
char* fileName = "case117-~!@#$%^&*()+_/:?<;>|\\";
int fd = UtilsFileOpen(fileName, O_RDONLY_FS | O_CREAT_FS, 0);
TEST_ASSERT_GREATER_THAN_INT(0, fd);
UtilsFileClose(fd);
UtilsFileDelete(fileName);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_1800
* @tc.name : Open none exist file
......@@ -692,23 +678,6 @@ LITE_TEST_CASE(UtilsFileFuncTestSuite, testObtainLongNameFileSize, Function | Me
UtilsFileDelete(fileName);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_3900
* @tc.name : Obtaining size for file with special characters
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(UtilsFileFuncTestSuite, testObtainSizeForFileWithSpecChar, Function | MediumTest | Level1)
{
char* fileName = "case307-~!@#$%^&*()+_/:?<;>|\\";
int fd0 = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS, 0);
UtilsFileWrite(fd0, g_def, strlen(g_def));
UtilsFileClose(fd0);
unsigned int fileLen = 0;
int ret = UtilsFileStat(fileName, &fileLen);
TEST_ASSERT_EQUAL_INT(0, ret);
UtilsFileDelete(fileName);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_4000
* @tc.name : File operation for file copy
......@@ -758,24 +727,6 @@ LITE_TEST_CASE(UtilsFileFuncTestSuite, testCopyLongNameFile, Function | MediumTe
UtilsFileDelete(fileNameCopy);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_4300
* @tc.name : Copy file with special characters
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(UtilsFileFuncTestSuite, testCopyFileWithSpecChar, Function | MediumTest | Level1)
{
char* fileName = "case404-~!@#$%^&*()+_/:?<;>|\\";
int fd0 = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS, 0);
UtilsFileWrite(fd0, g_def, strlen(g_def));
UtilsFileClose(fd0);
char* fileNameCopy = "copy404-~!@#$%^&*()+_/:?<;>|\\";
int ret = UtilsFileCopy(fileName, fileNameCopy);
TEST_ASSERT_EQUAL_INT(0, ret);
UtilsFileDelete(fileName);
UtilsFileDelete(fileNameCopy);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_4400
* @tc.name : File operation for file move
......@@ -823,23 +774,6 @@ LITE_TEST_CASE(UtilsFileFuncTestSuite, testMoveLongNameFile, Function | MediumTe
UtilsFileDelete(fileNameMove);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_4700
* @tc.name : Move file with special characters
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(UtilsFileFuncTestSuite, testMoveFileWithSpecChar, Function | MediumTest | Level1)
{
char* fileName = "case504-~!@#$%^&*()+_/:?<;>|\\";
int fd0 = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS, 0);
UtilsFileWrite(fd0, g_def, strlen(g_def));
UtilsFileClose(fd0);
char* fileNameMove = "move504-~!@#$%^&*()+_/:?<;>|\\";
int ret = UtilsFileMove(fileName, fileNameMove);
TEST_ASSERT_EQUAL_INT(0, ret);
UtilsFileDelete(fileNameMove);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_4800
* @tc.name : File operation for file delete
......@@ -882,19 +816,4 @@ LITE_TEST_CASE(UtilsFileFuncTestSuite, testDeleteLongNameFile, Function | Medium
TEST_ASSERT_EQUAL_INT(0, ret);
};
/**
* @tc.number : SUB_UTILS_FILE_OPERATION_5100
* @tc.name : Delete file with special characters
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(UtilsFileFuncTestSuite, testDeleteFileWithSpecChar, Function | MediumTest | Level1)
{
char* fileName = "delete604-~!@#$%^&*()+_/:?<;>|\\";
int fd0 = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS, 0);
UtilsFileWrite(fd0, g_def, strlen(g_def));
UtilsFileClose(fd0);
int ret = UtilsFileDelete(fileName);
TEST_ASSERT_EQUAL_INT(0, ret);
};
RUN_TEST_SUITE(UtilsFileFuncTestSuite);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册