diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-04-01 15:58:07 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-04-01 15:58:07 +0200 |
commit | 0b1e4acfa1c0a5656ff1293678f52eb287c2682d (patch) | |
tree | 10794c33e9d0085956f8d733e2fbf0c35694beee /tests | |
parent | 8caf15e38c6c1a803c110028b0d8a10d6fece776 (diff) | |
download | wolfbones-0b1e4acfa1c0a5656ff1293678f52eb287c2682d.tar.gz wolfbones-0b1e4acfa1c0a5656ff1293678f52eb287c2682d.tar.bz2 |
fixed gai_strerror_r test on native Windows
Diffstat (limited to 'tests')
-rw-r--r-- | tests/port/test_gai_strerror_r.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/port/test_gai_strerror_r.c b/tests/port/test_gai_strerror_r.c index eb4c249..d744bbc 100644 --- a/tests/port/test_gai_strerror_r.c +++ b/tests/port/test_gai_strerror_r.c @@ -7,22 +7,25 @@ #include <stdio.h> /* for printf */ int main( void ) { - signed int i; int res; char buf[1024]; - /* go through gai errors (TODO: find out how many of them there are!) */ - for( i = -1; i >= -255; i-- ) { - *buf = '\0'; - res = gai_strerror_r( i, buf, 1024 ); - printf( "%d: %d \"%s\"\n", i, res, buf ); - } - - /* go through gai errors (TODO: find out how many of them there are!) */ - for( i = -1; i >= -255; i-- ) { - *buf = '\0'; - res = wolf_port_gai_strerror_r( i, buf, 1024 ); - printf( "%d: %d \"%s\"\n", i, res, buf ); - } +#ifdef _WIN32 + WSADATA wsa_data; + WSAStartup( MAKEWORD( 2, 2 ), &wsa_data ); +#endif + + *buf = '\0'; + res = gai_strerror_r( EAI_NONAME, buf, 1024 ); + printf( "%d: %d \"%s\"\n", EAI_NONAME, res, buf ); + + *buf = '\0'; + res = wolf_port_gai_strerror_r( EAI_NONAME, buf, 1024 ); + printf( "%d: %d \"%s\"\n", EAI_NONAME, res, buf ); + +#ifdef _WIN32 + WSACleanup( ); +#endif + exit( EXIT_SUCCESS ); } |