* first shot at unit tests
authorMichal Voců <michal@ruk.cuni.cz>
Tue, 31 Aug 2004 13:27:02 +0000 (13:27 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Tue, 31 Aug 2004 13:27:02 +0000 (13:27 +0000)
org.glite.lb.logger/test/ll_test.cpp [new file with mode: 0644]
org.glite.lb.logger/test/logd_proto_test.c [new file with mode: 0644]

diff --git a/org.glite.lb.logger/test/ll_test.cpp b/org.glite.lb.logger/test/ll_test.cpp
new file mode 100644 (file)
index 0000000..438c088
--- /dev/null
@@ -0,0 +1,38 @@
+#include <iostream>
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+
+class LLTest: public  CppUnit::TestFixture
+{
+       CPPUNIT_TEST_SUITE(LLTest);
+       CPPUNIT_TEST(testProtoServer);
+       CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void setUp() {
+  }
+
+  void tearDown() {
+  }
+
+  void testProtoServer() {
+  }
+
+};
+
+
+CPPUNIT_TEST_SUITE_REGISTRATION( LLTest );
+
+int main (int ac,const char *av[])
+{
+       CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
+       CppUnit::TextUi::TestRunner runner;
+       
+       runner.addTest(suite);
+       return runner.run() ? 0 : 1;
+}
diff --git a/org.glite.lb.logger/test/logd_proto_test.c b/org.glite.lb.logger/test/logd_proto_test.c
new file mode 100644 (file)
index 0000000..e8eb527
--- /dev/null
@@ -0,0 +1,31 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <signal.h>
+#include <string.h>
+#include <syslog.h>
+#include <fcntl.h>
+
+#include "logd_proto.h"
+#include "glite/lb/context-int.h"
+#include "glite/lb/escape.h"
+#include "glite/lb/events_parse.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_GssConnection               int
+
+int
+test_edg_wll_gss_read_full(int *fd,
+                          void *buf,
+                          size_t bufsize,
+                          struct timeval *timeout,
+                          size_t *total,
+                          edg_wll_GssStatus *code) 
+{
+  *total = read(*fd, buf, bufsize);
+  return(*total < 0 ? *total : 0);
+}
+
+#include "logd_proto.c"