From d025dcbb4ea5b08cf5db8dcb77a1170e0dba89b9 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Mon, 22 Dec 2008 19:03:41 +0000 Subject: libcgroup: one more test for cgroup_get_cgroup From: Sudhir Kumar The following patch adds a scenario for testing cgroup_get_cgroup() api. The test is called with a cgroup which has not been created yet. Signed-off-by: Sudhir Kumar Signed-off-by: Dhaval Giani git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@290 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- tests/libcgrouptest01.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/libcgrouptest01.c') diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index 0024fa1..454c466 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -1419,6 +1419,17 @@ void test_cgroup_get_cgroup(int i) else message(i++, FAIL, "get_cgroup()", ret, info[NULLGRP]); + /* Test with invalid name filled cgroup(non existing) */ + cgroup_filled = cgroup_new_cgroup("nogroup"); + if (!cgroup_filled) + message(i++, FAIL, "new_cgroup()", 0, info[NOMESSAGE]); + + ret = cgroup_get_cgroup(cgroup_filled); + if (ret) + message(i++, PASS, "get_cgroup()", ret, info[NOTCRTDGRP]); + else + message(i++, FAIL, "get_cgroup()", ret, info[NOTCRTDGRP]); + /* Test with name filled cgroup */ cgroup_filled = cgroup_new_cgroup("group1"); if (!cgroup_filled) -- cgit