#ifndef COMMAND_RECEIVER_H
#define COMMAND_RECEIVER_H
+#include <boost/asio.hpp>
#include <boost/utility.hpp>
#include "command_session.h"
#include "l7vsd.h"
//! @param[in] l7vsd refernce
command_receiver::command_receiver( boost::asio::io_service& io_service, const std::string& file, l7vsd& parent )
: dispatcher( io_service ),
- acceptor( io_service, boost::asio::local::stream_protocol::endpoint( file ) ),
+ acceptor_( io_service, boost::asio::local::stream_protocol::endpoint( file ) ),
vsd( parent ){
}
//! @brief destructor
-~command_receiver(){
+command_receiver::~command_receiver(){
}
//! @brief accept handler
}
-} //namespace l7vs
\ No newline at end of file
+} //namespace l7vs
--- /dev/null
+#
+#
+# Makefile for command_receiver unit test frameworks.
+#
+#
+TARGET = command_receiver_ut
+CPP = g++
+CPPFLAGS = -O0 -g -Werror -pthread
+INCLUDES = -I../../logger \
+ -I../../parameter \
+ -I../../include
+LIBS = -lboost_system-gcc41-mt \
+ -lboost_thread-gcc41-mt \
+ -lboost_unit_test_framework-gcc41-mt
+
+LDFLAGS = -lrt -ldl
+
+SRCS = \
+ command_receiver_test.cpp
+
+.SUFFIX: .cpp .o
+.cpp.o:
+ $(CPP) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
+
+OBJS = $(SRCS:.cpp=.o)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CPP) $(INCLUDES) -o $@ $(OBJS) $(LIBS)
+
+clean:
+ rm -f $(TARGET) $(OBJS)
--- /dev/null
+#include <boost/test/included/unit_test.hpp>
+
+#include "l7vsd_stub.h"
+#include "command_session_stub.h"
+
+#include "../../src/command_receiver.cpp"
+
+using namespace boost::unit_test_framework;
+
+class command_receiver_test :public l7vs::command_receiver {
+public:
+ static void constractor_test();
+
+};
+
+//--tests--
+
+void command_receiver_test::constractor_test(){
+
+}
+
+
+test_suite* init_unit_test_suite( int argc, char* argv[] ){
+
+ test_suite* ts = BOOST_TEST_SUITE( "command_receiver class test" );
+ ts->add( BOOST_TEST_CASE( &command_receiver_test::constractor_test ) );
+
+
+ framework::master_test_suite().add( ts );
+
+ return 0;
+}
--- /dev/null
+#ifndef COMMAND_SESSION_H
+#define COMMAND_SESSION_H
+namespace l7vs{
+class command_session{
+
+};
+} //namespace l7vs
+#endif //COMMAND_SESSION_H
--- /dev/null
+#ifndef L7VSD_H
+#define L7VSD_H
+namespace l7vs{
+class l7vsd{
+
+};
+} //namespace l7vs
+#endif //L7VSD_H
all: $(TARGET)
$(TARGET): $(OBJS)
- $(CPP) $(INCLUDES) -o $@ $(OBJS) $(LIBS) /usr/lib64/libboost_unit_test_framework-gcc41-mt.a
+ $(CPP) $(INCLUDES) -o $@ $(OBJS) $(LIBS)
clean:
rm -f $(TARGET) $(OBJS)
#define TEST_CASE
-#include <boost/test/unit_test.hpp>
+#include <boost/test/included/unit_test.hpp>
#include "logger_enum.h"
#include "logger_stub.h"