未验证 提交 cab57d6c 编写于 作者: O openharmony_ci 提交者: Gitee

!3806 【OpenHarmony开源贡献者计划2022】fix code style for 'utils_lite'

Merge pull request !3806 from c01dface/dev2
......@@ -64,8 +64,7 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testCreatFileAfterMaxFilesOpened, Functio
{
// Open 32 files
int fd32[MAX_NUM_OF_OPENED_FILES] = {0};
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -85,12 +84,10 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testCreatFileAfterMaxFilesOpened, Functio
TEST_ASSERT_GREATER_THAN_INT(0, fd33);
UtilsFileClose(fd33);
// Delete all files
for (int i = 1; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 1; i < MAX_NUM_OF_OPENED_FILES; i++) {
UtilsFileClose(fd32[i]);
}
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -111,8 +108,7 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testDeleteFileAfterMaxFilesOpened, Functi
{
// Open 32 files
int fd32[MAX_NUM_OF_OPENED_FILES] = {0};
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -128,12 +124,10 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testDeleteFileAfterMaxFilesOpened, Functi
int ret = UtilsFileDelete(fileName1);
TEST_ASSERT_EQUAL_INT(0, ret);
// Delete all files
for (int i = 1; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 1; i < MAX_NUM_OF_OPENED_FILES; i++) {
UtilsFileClose(fd32[i]);
}
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -153,8 +147,7 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testCopyFileAfterMaxFilesOpened, Function
{
// Open 32 files
int fd32[MAX_NUM_OF_OPENED_FILES] = {0};
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -178,12 +171,10 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testCopyFileAfterMaxFilesOpened, Function
ret = UtilsFileCopy(fileName1, fileNameCopy);
TEST_ASSERT_EQUAL_INT(0, ret);
// Delete all files
for (int i = 2; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 2; i < MAX_NUM_OF_OPENED_FILES; i++) {
UtilsFileClose(fd32[i]);
}
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -204,8 +195,7 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testMoveFileAfterMaxFilesOpened, Function
{
// Open 32 files
int fd32[MAX_NUM_OF_OPENED_FILES] = {0};
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......@@ -229,12 +219,10 @@ LITE_TEST_CASE(UtilsFileReliTestSuite, testMoveFileAfterMaxFilesOpened, Function
ret = UtilsFileMove(fileName1, fileNameMove);
TEST_ASSERT_EQUAL_INT(0, ret);
// Delete all files
for (int i = 2; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 2; i < MAX_NUM_OF_OPENED_FILES; i++) {
UtilsFileClose(fd32[i]);
}
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++)
{
for (int i = 0; i < MAX_NUM_OF_OPENED_FILES; i++) {
int j = i + 1;
char fileName32[LENGTH_OF_FILE_NAME_BUF] = {0};
int size = sprintf_s(fileName32, sizeof(fileName32), "%s%d", "testReli101-", j);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册