mirror of
https://github.com/mfontanini/libtins
synced 2026-01-26 20:01:35 +01:00
Add TCP and Utils::resolve_hwaddress active tests
[ci skip]
This commit is contained in:
@@ -90,23 +90,9 @@ void ActiveTestRunner::do_run() {
|
||||
auto packets = capturer_.captured_packets();
|
||||
cout << prefix << "Captured " << packets.size() << " packets" << endl;
|
||||
for (const auto& test : tests_) {
|
||||
prefix = "[" + test->name() + "] ";
|
||||
size_t i = 0;
|
||||
while (i < packets.size() && !test->matches_packet(*packets[i])) {
|
||||
++i;
|
||||
}
|
||||
if (i == packets.size()) {
|
||||
cout << prefix << "ERROR: Packet was not captured" << endl;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
test->validate_packet(*packets[i]);
|
||||
cout << prefix << "OK" << endl;
|
||||
}
|
||||
catch (TestFailed& ex) {
|
||||
cout << prefix << "ERROR: " << ex.what() << endl;
|
||||
}
|
||||
packets.erase(packets.begin() + i);
|
||||
if (test->is_enabled()) {
|
||||
test->validate(packets);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user