From: Balbir Singh Date: Wed, 17 Dec 2008 15:14:45 +0000 (+0000) Subject: libcgroup Test: fix-typo-error-in-delete-cgroup X-Git-Tag: v0.34~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c92b2b795c153540fea315427b2fd60bc947541;p=thirdparty%2Flibcgroup.git libcgroup Test: fix-typo-error-in-delete-cgroup This patch fixes a testcase which was having some typo errors. (libcgroup api cgroup_delete_cgroup() for a common group in multiple mount scenario) Signed-off-by: Sudhir Kumar git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@260 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index b27b7583..5eac5099 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -836,6 +836,7 @@ int main(int argc, char *argv[]) * Test12: delete this common cgroup * Exp outcome: zero return value */ + strncpy(extra, " Called with commongroup. ", SIZE); retval = cgroup_delete_cgroup(common_cgroup, 1); if (!retval) { /* Check if the group is deleted from both dir tree */ @@ -845,24 +846,25 @@ int main(int argc, char *argv[]) build_path(path2_common_group, mountpoint2, "commongroup", NULL); if (group_exist(path2_common_group) == -1) { - strncpy(extra, " group " + strncat(extra, " group " "deleted globally\n", SIZE); message(++i, PASS, "create_cgroup()", retval, extra); } else { - strncpy(extra, " group not " + strncat(extra, " group not " "deleted globally\n", SIZE); message(++i, FAIL, "create_cgroup()", retval, extra); } } else { - strncpy(extra, " group still found in fs\n", + strncat(extra, " group still found in fs\n", SIZE); - message(++i, FAIL, "create_cgroup()", retval, + message(++i, FAIL, "delete_cgroup()", retval, extra); } } else { - message(++i, FAIL, "create_cgroup()", retval, extra); + strncat(extra, "\n", sizeof("\n")); + message(++i, FAIL, "delete_cgroup()", retval, extra); } strncpy(extra, "\n", SIZE);