diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-12-17 15:04:52 +0000 |
---|---|---|
committer | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-12-17 15:04:52 +0000 |
commit | ac4886945e25189e5be30fadb51496e44638c772 (patch) | |
tree | e72adb7cec682db378e0d1503dd88868f225412d /tests/libcgrouptest.h | |
parent | 0adf296297252e7ad4cb7821bbd44ba84b31333f (diff) | |
download | libcg-ac4886945e25189e5be30fadb51496e44638c772.tar.gz libcg-ac4886945e25189e5be30fadb51496e44638c772.tar.xz libcg-ac4886945e25189e5be30fadb51496e44638c772.zip |
libcgroup Test: cleanup1
Hi,
This patch does cleanup in first set of testcases.
It defines a new function to print test results.
Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@248 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests/libcgrouptest.h')
-rw-r--r-- | tests/libcgrouptest.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/libcgrouptest.h b/tests/libcgrouptest.h index 3583289..8a11241 100644 --- a/tests/libcgrouptest.h +++ b/tests/libcgrouptest.h @@ -29,6 +29,10 @@ #include <libcgroup.h> +#define SIZE 100 /* Max size of a message to be printed */ +#define PASS 1 /* test passed */ +#define FAIL 0 /* test failed */ + int cpu = 0, memory = 0; enum cgroup_mount_t { @@ -61,6 +65,9 @@ uid_t tasks_uid; gid_t tasks_gid; static int i; +/* No extra message unless specified */ +char extra[SIZE] = "\n"; + void get_controllers(char *name, int *exist); static int group_exist(char *path_group); static int set_controller(int controller, char *controller_name, @@ -70,6 +77,8 @@ struct cgroup *new_cgroup(char *group, char *controller_name, char *control_file, int value_type); int check_fsmounted(int multimnt); static int check_task(char *tasksfile); +/* function to print messages in better format */ +static inline void message(int num, int pass, char *api, int ret, char *extra); static inline pid_t cgrouptest_gettid() { |