2018-06-14 16:04:42 +02:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2018-11-18 03:22:52 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <winsock2.h>
|
|
|
|
int
|
|
|
|
startWinsock()
|
|
|
|
{
|
|
|
|
WSADATA wsockd;
|
|
|
|
int err;
|
|
|
|
err = ::WSAStartup(MAKEWORD(2, 2), &wsockd);
|
|
|
|
if(err)
|
|
|
|
{
|
|
|
|
perror("Failed to start Windows Sockets");
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-06-14 16:04:42 +02:00
|
|
|
int
|
|
|
|
main(int argc, char** argv)
|
|
|
|
{
|
2018-11-18 03:22:52 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
if(startWinsock())
|
|
|
|
return -1;
|
|
|
|
#endif
|
2019-03-03 16:01:05 +01:00
|
|
|
|
2018-06-14 16:04:42 +02:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
2018-11-18 03:22:52 +01:00
|
|
|
int r = RUN_ALL_TESTS();
|
|
|
|
#ifdef _WIN32
|
|
|
|
WSACleanup();
|
|
|
|
#endif
|
|
|
|
return r;
|
2019-03-03 16:01:05 +01:00
|
|
|
}
|