]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup Test: fix-typo-error-in-delete-cgroup
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Wed, 17 Dec 2008 15:14:45 +0000 (15:14 +0000)
committerBalbir Singh <balbir@linux.vnet.ibm.com>
Wed, 17 Dec 2008 15:14:45 +0000 (15:14 +0000)
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 <skumar@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@260 4f4bb910-9a46-0410-90c8-c897d4f1cd53

tests/libcgrouptest01.c

index b27b758376c1d6d0f61e49b663958bdfbe410cac..5eac509903d37935a0db28ed43f1e1795b9a6f63 100644 (file)
@@ -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);