提交 ad3b1681 编写于 作者: M Mupceet

fix: codestyle

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 fee0d696
......@@ -44,8 +44,6 @@
#include <policycoreutils.h>
#endif
#define ARRAY_LEN(array) (sizeof(array) / (sizeof((array)[0])))
static const char *g_fscryptPolicyKey = "fscrypt.policy.config";
int GetParamValue(const char *symValue, unsigned int symLen, char *paramValue, unsigned int paramLen)
......@@ -425,7 +423,7 @@ static void DoInitGlobalKey(const struct CmdArgs *ctx)
"init_global_key",
NULL
};
int argc = ARRAY_LEN(argv);
int argc = ARRAY_LENGTH(argv);
int ret = SyncExecCommand(argc, argv);
INIT_LOGI("DoInitGlobalKey: end, ret = %d", ret);
}
......@@ -443,7 +441,7 @@ static void DoInitMainUser(const struct CmdArgs *ctx)
"init_main_user",
NULL
};
int argc = ARRAY_LEN(argv);
int argc = ARRAY_LENGTH(argv);
int ret = SyncExecCommand(argc, argv);
INIT_LOGI("DoInitMainUser: end, ret = %d", ret);
}
......@@ -477,7 +475,7 @@ static void DoMkswap(const struct CmdArgs *ctx)
ctx->argv[0],
NULL
};
int argc = ARRAY_LEN(argv);
int argc = ARRAY_LENGTH(argv);
int ret = SyncExecCommand(argc, argv);
INIT_LOGI("DoMkswap: end, ret = %d", ret);
}
......@@ -494,7 +492,7 @@ static void DoSwapon(const struct CmdArgs *ctx)
ctx->argv[0],
NULL
};
int argc = ARRAY_LEN(argv);
int argc = ARRAY_LENGTH(argv);
int ret = SyncExecCommand(argc, argv);
INIT_LOGI("DoSwapon: end, ret = %d", ret);
}
......
......@@ -37,7 +37,11 @@ typedef struct EventLoop_ {
uint32_t maxevents;
uint32_t timeout;
uint32_t stop;
#ifdef LOOP_EVENT_USE_MUTEX
LoopMutex mutex;
#else
char mutex;
#endif
HashMapHandle taskMap;
} EventLoop;
......
......@@ -23,10 +23,9 @@
#include "loop_event.h"
#ifndef LOOP_EVENT_USE_MUTEX
#define LoopMutex char
#define LoopMutexInit(x)
#define LoopMutexLock(x)
#define LoopMutexUnlock(x)
#define LoopMutexInit(x) (void)(x)
#define LoopMutexLock(x) (void)(x)
#define LoopMutexUnlock(x) (void)(x)
#else
#include <pthread.h>
#define LoopMutex pthread_mutex_t
......@@ -79,7 +78,11 @@ typedef struct {
typedef struct {
BaseTask base;
#ifdef LOOP_EVENT_USE_MUTEX
LoopMutex mutex;
#else
char mutex;
#endif
ListHead buffHead;
} StreamTask;
......
......@@ -15,10 +15,10 @@
#include "watcher_manager_kits.h"
#include "if_system_ability_manager.h"
#include "init_param.h"
#include "iservice_registry.h"
#include "iwatcher.h"
#include "iwatcher_manager.h"
#include "init_param.h"
#include "system_ability_definition.h"
#include "watcher_utils.h"
......
......@@ -23,6 +23,7 @@
using namespace testing::ext;
using namespace std;
namespace init_ut {
class DacUnitTest : public ::testing::Test {
public:
DacUnitTest() {}
......@@ -252,3 +253,4 @@ HWTEST_F(DacUnitTest, TestClientDacCheckFilePermission, TestSize.Level0)
DacUnitTest test;
test.TestClientDacCheckFilePermission(STARTUP_INIT_UT_PATH "/trigger_test.cfg");
}
}
\ No newline at end of file
......@@ -29,6 +29,8 @@ extern "C" {
#endif
#endif
#define TEST_PATH "/data/ueventd_ut"
void PrepareInitUnitTestEnv(void);
void TestSetSelinuxOps(void);
void SetTestPermissionResult(int result);
......
......@@ -40,6 +40,7 @@ static int CheckServerParamValue(const char *name, const char *expectValue)
return 0;
}
namespace init_ut {
class ParamUnitTest : public ::testing::Test {
public:
ParamUnitTest() {}
......@@ -388,3 +389,4 @@ HWTEST_F(ParamUnitTest, TestDumpParamMemory, TestSize.Level0)
ParamUnitTest test;
test.TestDumpParamMemory();
}
}
......@@ -23,6 +23,7 @@
using namespace testing::ext;
using namespace std;
namespace init_ut {
class SelinuxUnitTest : public ::testing::Test {
public:
SelinuxUnitTest() {}
......@@ -174,3 +175,4 @@ HWTEST_F(SelinuxUnitTest, TestClientDacCheckParaPermission, TestSize.Level0)
test.TestClientSelinuxCheckParaPermissionWrite("aaa.bbb.bbb.ccc", "user:group1:r");
test.TestClientSelinuxCheckParaPermissionRead("aaa.bbb.bbb.ccc", "user:group1:r");
}
}
\ No newline at end of file
......@@ -27,7 +27,6 @@
using namespace std;
using namespace testing::ext;
#define TEST_PATH "/data/ueventd_ut"
namespace ueventd_ut {
static bool FileExists(const std::string &file)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册