// -*- 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