Nmap Development mailing list archives

Re: [Patch] nsock/tests/tests_main.c


From: Gisle Vanem <gvanem () broadpark no>
Date: Wed, 07 Aug 2013 13:53:24 +0200

"Gisle Vanem" <gvanem () broadpark no> wrote:

simple tcp connection                           Socket troubles: No error
Assertion failed: sd >= 0, file engine_select.c, line 353

The assert() is also a non-portable issue with WinPcap; it doesn't
have a selectable pcap structure or something.

No it wasn't that. Simply that WSAStartup() wasn't called. That could
go into a local win_init() that sets up the WinConsole.

BTW. the nsock/tests/*.c files has stuff like:

const struct test_case TestConnectTCP = {
  .t_name     = "simple tcp connection",
  .t_setup    = connect_setup,
  .t_run      = connect_tcp,
  .t_teardown = connect_teardown
};

This C99 (?) feature doesn't work with my MSVC v16. (it works for MingW-gcc though). Would it hurt that we rewrite this
as:

const struct test_case TestConnectTCP = {
 /* .t_name     = */ "simple tcp connection",
 /* .t_setup    = */ connect_setup,
 /* .t_run      = */ connect_tcp,
 /* .t_teardown = */ connect_teardown
};


--gv
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: