#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTest/TestHarness.h>
-#include "../file_connector.h"
-#include "../file_connector_module.h"
+#include "connectors/file_connector/file_connector.h"
+#include "connectors/file_connector/file_connector_module.h"
-#include "../../../main/snort_debug.h"
+#include "main/snort_debug.h"
void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
const char* get_instance_file(std::string& file, const char* name)
{ UNUSED(file); UNUSED(name); return "filename"; }
-void Debug::print(const char* file, int line, uint64_t dbg, const char* fmt, ...)
-{ UNUSED(file); UNUSED(line); UNUSED(dbg); UNUSED(fmt); }
+void Debug::print(const char*, int, uint64_t, const char*, ...) { }
TEST_GROUP(file_connector_msg_handle)
{
// ip4 key is smaller by 2*(ip6-addr-size - ip4-addr-size) or 2*(16 - 4) = 24
static const uint8_t key_size_ip4 = sizeof(FlowKey)-24;
-static const int ONE_MILLION = 1000000;
+static const suseconds_t USEC_PER_SEC = 1000000;
enum
{
void FlowHAState::set_next_update()
{
next_update.tv_usec += min_session_lifetime.tv_usec;
- if (next_update.tv_usec > ONE_MILLION)
+ if (next_update.tv_usec > USEC_PER_SEC)
{
- next_update.tv_usec -= ONE_MILLION;
+ next_update.tv_usec -= USEC_PER_SEC;
next_update.tv_sec++;
}
next_update.tv_sec += min_session_lifetime.tv_sec;
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTest/TestHarness.h>
-#include "../ha.h"
+#include "flow/ha.h"
-#include "../flow.h"
-#include "../../main/snort_debug.h"
+#include "flow/flow.h"
+#include "main/snort_debug.h"
#define MSG_SIZE 100
~StreamHAClient() { }
void consume(Flow*, HAMessage*) { }
void produce(Flow*, HAMessage* msg)
- { for ( uint8_t i=0; i<10; i++,*(msg->cursor)++=i); }
- size_t get_message_size() { return sizeof(10); }
+ {
+ for ( uint8_t i=0; i<10; i++ )
+ *(msg->cursor)++ = i;
+ }
+ size_t get_message_size() { return 10; }
private:
};
static Flow s_flow;
static DAQ_PktHdr_t s_pkthdr;
-void LogMessage(const char* format,...)
-{ UNUSED(format); }
+void LogMessage(const char*,...) { }
-void Debug::print(const char* file, int line, uint64_t dbg, const char* fmt, ...)
-{ UNUSED(file); UNUSED(line); UNUSED(dbg); UNUSED(fmt); }
+void Debug::print(const char*, int, uint64_t, const char*, ...) { }
void packet_gettimeofday(struct timeval* tv)
{ *tv = s_time; }
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTest/TestHarness.h>
-#include "../side_channel.h"
+#include "side_channel/side_channel.h"
+#include "side_channel/side_channel_module.h"
-#include "../../log/messages.h"
-#include "../main/snort_debug.h"
-#include "../managers/connector_manager.h"
-#include "../side_channel_module.h"
+#include "log/messages.h"
+#include "main/snort_debug.h"
+#include "managers/connector_manager.h"
class TestConnector : public Connector
{
void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*) { }
-void ParseWarning(WarningGroup wg, const char* format, ...)
-{ UNUSED(wg); UNUSED(format); }
+void ParseWarning(WarningGroup, const char*, ...) { }
-void Debug::print(const char* file, int line, uint64_t dbg, const char* fmt, ...)
-{ UNUSED(file); UNUSED(line); UNUSED(dbg); UNUSED(fmt); }
+void Debug::print(const char*, int, uint64_t, const char*, ...) { }
TEST_GROUP(side_channel)
{