OSDN Git Service

protocol_module_controlのunittestを追加
authornakai <nakai@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Tue, 6 Jan 2009 05:43:12 +0000 (05:43 +0000)
committernakai <nakai@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Tue, 6 Jan 2009 05:43:12 +0000 (05:43 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-shamshel@5660 1ed66053-1c2d-0410-8867-f7571e6e31d3

unit_tests/module_controls/Makefile [new file with mode: 0644]
unit_tests/module_controls/protocol_module_control_test.cpp [new file with mode: 0644]

diff --git a/unit_tests/module_controls/Makefile b/unit_tests/module_controls/Makefile
new file mode 100644 (file)
index 0000000..2b85a6c
--- /dev/null
@@ -0,0 +1,33 @@
+#
+#
+#      Makefile for module_control unit test frameworks.
+#
+#
+TARGET         = module_control_ut
+CPP                    = g++
+CPPFLAGS       = -g -Wall -Werror -pthread -O0
+INCLUDES       =       -I../../logger \
+                               -I../../parameter \
+                               -I../../include \
+                               -I../../src
+LIBS           =       -lboost_system-gcc41-mt \
+                               -lboost_thread-gcc41-mt \
+                               -lboost_unit_test_framework-gcc41-mt
+
+LDFLAGS                = -lrt -ldl
+
+SRCS           =       protocol_module_control_test.cpp
+
+OBJS           = $(SRCS:.cpp=.o)
+
+all:   $(TARGET)
+
+$(TARGET):     $(OBJS)
+       $(CPP) $(INCLUDES) -o $@ $(OBJS) $(LIBS)
+
+clean:
+       rm -f $(TARGET) $(OBJS)
+
+.cpp.o:
+       $(CPP) $(CFLAGS) $(INCLUDES) -c $<
+
diff --git a/unit_tests/module_controls/protocol_module_control_test.cpp b/unit_tests/module_controls/protocol_module_control_test.cpp
new file mode 100644 (file)
index 0000000..8825eb0
--- /dev/null
@@ -0,0 +1,27 @@
+#define        MAX_BUFFER_SIZE (65535)
+
+
+#include <boost/test/included/unit_test.hpp>
+#include "../../src/protocol_module_control.cpp"
+
+using namespace boost::unit_test;
+
+//test case1.
+void   protocol_module_control_test(){
+       l7vs::protocol_module_control& control = l7vs::protocol_module_control::getInstance();
+       control.initialize( "./" );
+       control.finalize();
+       control.initialize( NULL );
+
+}
+
+test_suite*    init_unit_test_suite( int argc, char* argv[] ){
+
+       // create unit test suite
+       test_suite* ts = BOOST_TEST_SUITE( "protocol_module_control" );
+       ts->add( BOOST_TEST_CASE( &protocol_module_control_test ) );
+
+       framework::master_test_suite().add( ts );
+
+       return 0;
+}
\ No newline at end of file