X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcommon%2Ftests_common.h;h=251e111d0d2790244c6600f76df63c81aed94fc7;hb=9ea4e4d2740729974d8c2f80a3d020c420df2d73;hp=0cca75454a1573023d217c0a0bc08bd2a196f2d8;hpb=cb0c3e54fa2ed9fc04c29b98f9ea4d74fd3d6674;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git diff --git a/src/common/tests_common.h b/src/common/tests_common.h index 0cca754..251e111 100644 --- a/src/common/tests_common.h +++ b/src/common/tests_common.h @@ -29,15 +29,17 @@ #include #include #include -#include #include +#include #include #include #include #include -const uid_t APP_UID = 5000; -const gid_t APP_GID = 5000; +const uid_t APP_UID = 5000; +const gid_t APP_GID = 5000; +const uid_t APP_UID_2 = 5200; +const gid_t APP_GID_2 = 5200; const uid_t DB_ALARM_UID = 6001; const gid_t DB_ALARM_GID = 6001; const std::string TMP_DIR("/tmp"); @@ -54,7 +56,8 @@ void mktreeSafe(const std::string &path, mode_t mode); void creatSafe(const std::string &path, mode_t mode); void symlinkSafe(const std::string &targetPath, const std::string &linkPath); void removeDir(const std::string &path); - +void waitPid(pid_t pid); +void change_label(const char* label); #define RUNNER_TEST_SMACK(Proc, ...) \ void Proc(std::tuple<__VA_ARGS__> &optionalArgsTuple); \ @@ -144,40 +147,4 @@ void removeDir(const std::string &path); } \ void Proc##Multi(std::tuple<__VA_ARGS__> &optionalArgsTuple DPL_UNUSED) -namespace DB { - - class Transaction - { - public: - - static int db_result; - - Transaction() { - db_result = perm_begin(); - RUNNER_ASSERT_MSG(PC_OPERATION_SUCCESS == db_result, - "perm_begin returned: " << db_result); - } - - ~Transaction() { - db_result = perm_end(); - } - }; -} // namespace DB - -// Database Transaction macros -// PLEASE NOTE Both DB_BEGIN and DB_END need to be called in the same scope. -// They are used to prevent developer from forgetting to close transaction. -// Also note that variables defined between these macros will not be visible -// after DB_END. -#define DB_BEGIN \ - { \ - DB::Transaction db_transaction; - -#define DB_END } \ - RUNNER_ASSERT_MSG(PC_OPERATION_SUCCESS == DB::Transaction::db_result, \ - "perm_end returned: " << DB::Transaction::db_result); - -// Common macros and labels used in tests -extern const char *WGT_APP_ID; - #endif