瀏覽代碼

TEST: fix the print out when cpg_finalize() fails

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Angus Salkeld 15 年之前
父節點
當前提交
25751d12d2
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 1 1
      test/cpgbench.c
  2. 3 2
      test/cpgbenchzc.c

+ 1 - 1
test/cpgbench.c

@@ -190,7 +190,7 @@ int main (void) {
 
 
 	res = cpg_finalize (handle);
 	res = cpg_finalize (handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		printf ("cpg_join failed with result %d\n", res);
+		printf ("cpg_finalize failed with result %d\n", res);
 		exit (1);
 		exit (1);
 	}
 	}
 	return (0);
 	return (0);

+ 3 - 2
test/cpgbenchzc.c

@@ -53,6 +53,7 @@
 
 
 #include <corosync/corotypes.h>
 #include <corosync/corotypes.h>
 #include <corosync/cpg.h>
 #include <corosync/cpg.h>
+#include "../lib/util.h"
 
 
 #ifndef timersub
 #ifndef timersub
 #define timersub(a, b, result)					\
 #define timersub(a, b, result)					\
@@ -176,7 +177,7 @@ int main (void) {
 
 
 	res = cpg_join (handle, &group_name);
 	res = cpg_join (handle, &group_name);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		printf ("cpg_join failed with result %d\n", res);
+		printf ("cpg_join failed with result %s\n", cs_strerror(res));
 		exit (1);
 		exit (1);
 	}
 	}
 
 
@@ -187,7 +188,7 @@ int main (void) {
 
 
 	res = cpg_finalize (handle);
 	res = cpg_finalize (handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		printf ("cpg_join failed with result %d\n", res);
+		printf ("cpg_finalize failed with result %s\n", cs_strerror(res));
 		exit (1);
 		exit (1);
 	}
 	}
 	return (0);
 	return (0);