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 <[email protected]> Index: trunk/tests/libcgrouptest01.c =================================================================== --- trunk.orig/tests/libcgrouptest01.c +++ trunk/tests/libcgrouptest01.c @@ -1417,6 +1417,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) ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
