[Patch 6/8] CLD: cleanup: add a event stub just to test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tests do not really need this kind of thing, in fact if everything
goes well, we should NOT receive any events while test is running.
Still, I am curious about being sure that we do not. This will also
pop if we change something in the library implementation and start
leaking some events.

Signed-off-by: Pete Zaitcev <zaitcev@xxxxxxxxxx>

---
 test/lock-file.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/test/lock-file.c b/test/lock-file.c
index 36cc62c..3bbe49b 100644
--- a/test/lock-file.c
+++ b/test/lock-file.c
@@ -31,6 +31,15 @@
 #include <ncld.h>
 #include "test.h"
 
+static void sess_event(void *priv, unsigned int what)
+{
+	if (what == CE_SESS_FAILED) {
+		fprintf(stderr, "Session failed\n");
+		exit(1);
+	}
+	fprintf(stderr, "Unknown event %d\n", what);
+}
+
 int main (int argc, char *argv[])
 {
 	struct ncld_sess *nsess;
@@ -49,7 +58,7 @@ int main (int argc, char *argv[])
 	if (port == 0)
 		return -1;
 
-	nsess = ncld_sess_open(TEST_HOST, port, &error, NULL, NULL,
+	nsess = ncld_sess_open(TEST_HOST, port, &error, sess_event, NULL,
 			     TEST_USER, TEST_USER_KEY, NULL);
 	if (!nsess) {
 		fprintf(stderr, "ncld_sess_open(host %s port %u) failed: %d\n",
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux