mirror of
https://github.com/solemnwarning/ipxwrapper
synced 2024-12-30 16:45:37 +01:00
test log
This commit is contained in:
parent
db955a3f54
commit
c7be8e95a2
@ -867,9 +867,13 @@ static DWORD router_main(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
wait_ms = 50;
|
||||
|
||||
WaitForMultipleObjects(n_events, wait_events, FALSE, wait_ms);
|
||||
WSAResetEvent(router_event);
|
||||
|
||||
log_printf(LOG_INFO, "router tick");
|
||||
|
||||
if(!router_running)
|
||||
{
|
||||
break;
|
||||
|
@ -23,6 +23,7 @@ use FindBin;
|
||||
use lib "$FindBin::Bin/lib/";
|
||||
|
||||
use IPXWrapper::Capture::IPXOverUDP;
|
||||
use IPXWrapper::LogServer;
|
||||
use IPXWrapper::SPX;
|
||||
use IPXWrapper::Tool::Generic;
|
||||
use IPXWrapper::Util;
|
||||
@ -50,6 +51,27 @@ describe "IPXWrapper using IP encapsulation" => sub
|
||||
reg_set_addr( $remote_ip_a, "HKCU\\Software\\IPXWrapper\\$remote_mac_b", "net", "00:00:00:02");
|
||||
};
|
||||
|
||||
my $log = undef;
|
||||
|
||||
before each => sub
|
||||
{
|
||||
$log = IPXWrapper::LogServer->new();
|
||||
|
||||
reg_set_string($remote_ip_a, "HKCU\\Software\\IPXWrapper", "log_server_addr", $local_ip_a);
|
||||
reg_set_dword( $remote_ip_a, "HKCU\\Software\\IPXWrapper", "log_server_port", $log->port());
|
||||
};
|
||||
|
||||
after each => sub
|
||||
{
|
||||
# TODO: Call this if the test succeeded.
|
||||
#
|
||||
# If a test fails due to an exception, the after blocks won't be called, however a
|
||||
# test failing due to an assertion still calls the after blocks. I haven't found
|
||||
# any way to actually determine if the test passed from code.
|
||||
|
||||
# $log->discard();
|
||||
};
|
||||
|
||||
it "responds to SPX lookups" => sub
|
||||
{
|
||||
my $listener = IPXWrapper::Tool::Generic->new(
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* IPXWrapper test tools
|
||||
* Copyright (C) 2014 Daniel Collins <solemnwarning@solemnwarning.net>
|
||||
* Copyright (C) 2014-2024 Daniel Collins <solemnwarning@solemnwarning.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published by
|
||||
@ -113,7 +113,11 @@ int main(int argc, char **argv)
|
||||
for(int i = 0; i < sizeof(data);)
|
||||
{
|
||||
int r = recv(sock, buf + i, sizeof(data) - i, 0);
|
||||
assert(r != -1);
|
||||
if(r < 0)
|
||||
{
|
||||
printf("recv: %u\n", (unsigned int)(WSAGetLastError()));
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Read %d bytes from socket\n", r);
|
||||
i += r;
|
||||
|
Loading…
x
Reference in New Issue
Block a user