]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup: one more test for cgroup_get_cgroup
authorDhaval Giani <dhaval@linux.vnet.ibm.com>
Mon, 22 Dec 2008 19:03:41 +0000 (19:03 +0000)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Mon, 22 Dec 2008 19:03:41 +0000 (19:03 +0000)
From: Sudhir Kumar <skumar@linux.vnet.ibm.com>

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 <skumar@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@290 4f4bb910-9a46-0410-90c8-c897d4f1cd53

tests/libcgrouptest01.c

index 0024fa105eed992f90460639d2f1270021db7f46..454c466701a70c5b8198653135ac978fa8a2f1e4 100644 (file)
@@ -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)