*** empty log message ***
authorMichal Voců <michal@ruk.cuni.cz>
Tue, 31 Aug 2004 14:51:19 +0000 (14:51 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Tue, 31 Aug 2004 14:51:19 +0000 (14:51 +0000)
org.glite.lb.logger/test/ll_test.cpp
org.glite.lb.logger/test/logd_proto_test.c

index 13855c1..80cff7f 100644 (file)
@@ -20,6 +20,7 @@ public:
 
   void setUp() {
     pipe(pd);
+    log_proto_client(pd[1], msg);
   }
 
   void tearDown() {
@@ -28,10 +29,40 @@ public:
   }
 
   void testProtoServer() {
+    int ret = edg_wll_log_proto_server(con, 
+                                      "michal",
+                                      "/tmp/dglogd.log",
+                                      0,
+                                      0);
+    CPPUNIT_ASSERT( ret == 0 );
   }
 
 private:
   int  pd[2];
+  const char *msg = "";
+
+  int log_proto_client(int con, char *logline) {
+    char       header[32];
+    int        err;
+    int        size;
+    u_int8_t size_end[4];
+
+    err = 0;
+    size = strlen(logline)+1;
+    size_end[0] = size & 0xff; size >>= 8;
+    size_end[1] = size & 0xff; size >>= 8;
+    size_end[2] = size & 0xff; size >>= 8;
+    size_end[3] = size;
+    size = strlen(logline)+1;
+
+    err = write(con, "DGLOG", 5);
+    CPPUNIT_ASSERT(err == 5);
+    err = write(con, size_end, 4);
+    CPPUNIT_ASSERT(err == 4);
+    err = write(con, logline, size);
+    CPPUNIT_ASSERT( err == size );
+}
+
 };
 
 
index 95e64a7..9ee0b44 100644 (file)
@@ -9,6 +9,7 @@
 #include <fcntl.h>
 
 #define edg_wll_gss_read_full(a,b,c,d,e,f)  test_edg_wll_gss_read_full(a,b,c,d,e,f)
+#define edg_wll_gss_write_full(a,b,c,d,e,f) test_edg_wll_gss_write_full(a,b,c,d,e,f)
 #define edg_wll_GssConnection               int
 
 #include "logd_proto.h"
@@ -28,4 +29,15 @@ test_edg_wll_gss_read_full(int *fd,
   return(*total < 0 ? *total : 0);
 }
 
+int
+test_edg_wll_gss_write_full(int *fd,
+                           const void *buf,
+                           size_t bufsize,
+                           struct timeval *timeout,
+                           size_t *total,
+                           edg_wll_GssStatus *code) 
+{
+  return(0);
+}
+
 #include "logd_proto.c"