From 07175b97561c3045b105bdf293f28c450cf21e97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Tue, 31 Aug 2004 13:27:02 +0000 Subject: [PATCH] * first shot at unit tests --- org.glite.lb.logger/test/ll_test.cpp | 38 ++++++++++++++++++++++++++++++ org.glite.lb.logger/test/logd_proto_test.c | 31 ++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 org.glite.lb.logger/test/ll_test.cpp create mode 100644 org.glite.lb.logger/test/logd_proto_test.c diff --git a/org.glite.lb.logger/test/ll_test.cpp b/org.glite.lb.logger/test/ll_test.cpp new file mode 100644 index 0000000..438c088 --- /dev/null +++ b/org.glite.lb.logger/test/ll_test.cpp @@ -0,0 +1,38 @@ +#include + +#include +#include +#include +#include + + +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 index 0000000..e8eb527 --- /dev/null +++ b/org.glite.lb.logger/test/logd_proto_test.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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" -- 1.8.2.3