From: Michal Voců Date: Tue, 31 Aug 2004 14:51:19 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: ext_bones_merge_dest~49 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=ab22e58de7d2e3f60f5bc8caaf705d06cfe03be4;p=jra1mw.git *** empty log message *** --- diff --git a/org.glite.lb.logger/test/ll_test.cpp b/org.glite.lb.logger/test/ll_test.cpp index 13855c1..80cff7f 100644 --- a/org.glite.lb.logger/test/ll_test.cpp +++ b/org.glite.lb.logger/test/ll_test.cpp @@ -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 ); +} + }; diff --git a/org.glite.lb.logger/test/logd_proto_test.c b/org.glite.lb.logger/test/logd_proto_test.c index 95e64a7..9ee0b44 100644 --- a/org.glite.lb.logger/test/logd_proto_test.c +++ b/org.glite.lb.logger/test/logd_proto_test.c @@ -9,6 +9,7 @@ #include #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"