blob: f546c8b6c5dc2feb4c0e045f5fdf10e8af74a950 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// -*- mode: c++; c-basic-offset: 2; -*-
#ifndef TEST_PACKAGE_HH
#define TEST_PACKAGE_HH
#include "package.hh"
namespace {
void setup(Package* pkg) {
pkg->id = 42;
pkg->timestamp.tv_sec = 123;
pkg->timestamp.tv_nsec = 999999999;
pkg->source_port = 0;
pkg->source_host = "source";
pkg->target_port = 65535;
pkg->target_host = "target";
}
bool pkg_eq(Package const& p1, Package const& p2) {
return p1.id == p2.id
&& p1.timestamp.tv_sec == p2.timestamp.tv_sec
&& p1.timestamp.tv_nsec == p2.timestamp.tv_nsec
&& p1.source_port == p2.source_port
&& p1.source_host.compare(p2.source_host) == 0
&& p1.target_port == p2.target_port
&& p1.target_host.compare(p2.target_host) == 0;
}
} // namespace
#endif // TEST_PACKAGE_HH
|